ERC-721
NFT
Overview
Max Total Supply
2,927 BB
Holders
1,376
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 BBLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
BlockBots
Compiler Version
v0.8.0+commit.c7dfd78e
Optimization Enabled:
Yes with 750 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./ERC721Full.sol"; import "./IMintPass.sol"; import "./ValidateString.sol"; import "./VerifySignature.sol"; contract BlockBots is Ownable, ReentrancyGuard, AccessControl, ERC721Full, ValidateString, VerifySignature { using SafeMath for uint256; using SafeERC20 for IERC20; bytes32 public constant MINT_PASS_CONTRACT_ROLE = keccak256("MINT_PASS_CONTRACT_ROLE"); bytes32 public constant BUNDLE_CONTRACT_ROLE = keccak256("BUNDLE_CONTRACT_ROLE"); uint256 private BLOCK_BOTS_TOTAL_SUPPLY = 9998; uint256 public MAX_BLOCK_BOTS_CLAIMED_BY_RAFFLE = 2000; uint256 public constant MAX_MINT_LIMIT = 50; uint256 public totalBlockBotsMinted; uint256 public totalClaimedBlockBotsByRaffle; address public redeemerAddress; uint256 public nameChangePrice; address public immutable MINT_PASS_ADDRESS; address public immutable INDORSE_TOKEN_ADDRESS; address public changeNameProtocolFeeAddress; bool public pauseDeflatinate = true; uint256 private _currentTokenId = 0; uint256 private _deflatinatedTokenId = 10000; string private _uri; struct TokenLineageDetail { uint256 gen; uint256 parent1; uint256 parent2; } /** * @dev maps tokenId with tokenName. */ mapping(uint256 => string) public tokenNameByTokenId; mapping(uint256 => TokenLineageDetail) private _lineage; event Mint(address indexed _recipient, uint256 _startId, uint256 _quantity); event Pause(bool _pauseDeflatinate); event Deflatination( uint256 indexed _tokenId1, uint256 indexed _tokenId2, uint256 _newToken ); /** * @dev Initializes the contract by setting a `MINT_PASS_ADDRESS`, `changeNameProtocolFeeAddress`, `indorsetokenAddress`, `mintPassReserveTokens` * and `tokenDetailchangePrice` to the tokens. * @param _mintPassAddress is an address * @param _changeNameProtocolFeeAddress is an address * @param _indorseTokenAddress is an address * @param _nameChangePrice is uint256 * @param _baseUri is string */ constructor( address _mintPassAddress, address _changeNameProtocolFeeAddress, address _indorseTokenAddress, address _redeemerAddress, address _bundleAddress, uint256 _nameChangePrice, string memory _baseUri ) ERC721Full("BlockBots", "BB") { require( _mintPassAddress != address(0), "_mintPassAddress cannot be zero" ); require( _changeNameProtocolFeeAddress != address(0), "_changeNameProtocolFeeAddress cannot be zero" ); require( _indorseTokenAddress != address(0), "_indorseTokenAddress cannot be zero" ); require( _redeemerAddress != address(0), "_redeemerAddress cannot be zero" ); nameChangePrice = _changeToWei(_nameChangePrice); changeNameProtocolFeeAddress = _changeNameProtocolFeeAddress; MINT_PASS_ADDRESS = _mintPassAddress; _uri = _baseUri; INDORSE_TOKEN_ADDRESS = _indorseTokenAddress; redeemerAddress = _redeemerAddress; _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); _setRoleAdmin(MINT_PASS_CONTRACT_ROLE, DEFAULT_ADMIN_ROLE); _setupRole(MINT_PASS_CONTRACT_ROLE, _mintPassAddress); _setRoleAdmin(BUNDLE_CONTRACT_ROLE, DEFAULT_ADMIN_ROLE); _setupRole(BUNDLE_CONTRACT_ROLE, _bundleAddress); } /** * @notice Query if a contract implements an interface * @param interfaceId The interface identifier, as specified in ERC-165 * @dev Interface identification is specified in ERC-165. This function * uses less than 30,000 gas. * @return `true` if the contract implements `interfaceId` and * `interfaceId` is not 0xffffffff, `false` otherwise */ function supportsInterface(bytes4 interfaceId) public view override(AccessControl, ERC721Full) returns (bool) { return AccessControl.supportsInterface(interfaceId) || ERC721Full.supportsInterface(interfaceId); } function remainingBlockBots() public view returns (uint256) { return getMaxTotalSupply().sub(totalBlockBotsMinted).sub( IMintPass(MINT_PASS_ADDRESS).totalSupply(1) // 1 is pass because mintId is 1 ); } // Remaining Blockbots is substracted with total unclaimed BlockBots function remainingBlockBotsByBundles() public view returns (uint256) { return remainingBlockBots().add(totalClaimedBlockBotsByRaffle).sub( MAX_BLOCK_BOTS_CLAIMED_BY_RAFFLE ); } function getMaxTotalSupply() public view virtual returns (uint256) { return BLOCK_BOTS_TOTAL_SUPPLY; } function getNextDeflatinatedTokenId() public view returns (uint256) { return _deflatinatedTokenId.add(1); } /** * @dev calculates the next token ID based on value of _currentTokenId * @return uint256 for the next token ID */ function getNextTokenId() public view returns (uint256) { return _currentTokenId.add(1); } function calculateGen(uint256 tokenId1, uint256 tokenId2) public view returns (uint256) { uint256 genToken1 = _getGenOfToken(tokenId1); uint256 genToken2 = _getGenOfToken(tokenId2); if (genToken1 > genToken2) return genToken1.add(1); return genToken2.add(1); } function getParentOfBots(uint256 tokenId) external view returns (TokenLineageDetail memory) { TokenLineageDetail memory data = _lineage[tokenId]; if (tokenId < getMaxTotalSupply().add(1)) { data.gen = 1; } return data; } function walletOfOwner(address _owner) external view returns (uint256[] memory) { uint256 tokenCount = balanceOf(_owner); uint256[] memory tokensId = new uint256[](tokenCount); for (uint256 i = 0; i < tokenCount; i = i.add(1)) { tokensId[i] = tokenOfOwnerByIndex(_owner, i); } return tokensId; } function isTokenActive(uint256 tokenId) public view returns (bool) { return _exists(tokenId); } /** * @dev Set the sale and redeem pause by owner. * @param _pauseDeflatinate is a bool value. */ function setPause(bool _pauseDeflatinate) external onlyOwner { pauseDeflatinate = _pauseDeflatinate; emit Pause(_pauseDeflatinate); } /** * @dev Set the sale and redeem pause by owner. * @param _changeNameProtocolFeeAddress is an address where we send fee for changeName. */ function setChangeNameProtocolFeeAddress( address _changeNameProtocolFeeAddress ) external onlyOwner { require( changeNameProtocolFeeAddress != address(0), "cannot set to zero address" ); changeNameProtocolFeeAddress = _changeNameProtocolFeeAddress; } function getRaffleMessage( address _recipient, uint256 _quantity, uint256 _blockHeight ) public pure returns (bytes32) { return keccak256(abi.encodePacked(_recipient, _quantity, _blockHeight)); } function setRedeemerAddress(address _redeemer) external onlyOwner { require(_redeemer != address(0), "address cannot set to zero"); redeemerAddress = _redeemer; } function claimBlockBotsByRaffle( uint256 _quantity, uint256 _blockHeight, bytes memory _redeemerSignatureHash ) external nonReentrant { require(_quantity != 0, "quantity cannot be zero"); require( totalClaimedBlockBotsByRaffle.add(_quantity) <= MAX_BLOCK_BOTS_CLAIMED_BY_RAFFLE ); totalClaimedBlockBotsByRaffle = totalClaimedBlockBotsByRaffle.add( _quantity ); _setMessageHashClaimed( getRaffleMessage(msg.sender, _quantity, _blockHeight), redeemerAddress, _redeemerSignatureHash ); _mintBatch(msg.sender, _quantity); } /** * @dev set the price of a token detail change by owner. * @param _nameChangePrice is a integer value. */ function setNameChangePrice(uint256 _nameChangePrice) external onlyOwner { require(_nameChangePrice != 0, "cannot set price zero"); nameChangePrice = _changeToWei(_nameChangePrice); } /** * @dev deflatinate the token ID. * @param tokenId1, is a integer value denotes the token ID. * @param tokenId2, is a integer value denotes the token ID. */ function deflatinate(uint256 tokenId1, uint256 tokenId2) external nonReentrant { require(!pauseDeflatinate, "deflatination of tokens are paused"); uint256 deflatinatedTokenId = getNextDeflatinatedTokenId(); TokenLineageDetail storage data = _lineage[deflatinatedTokenId]; data.parent1 = tokenId1; data.parent2 = tokenId2; data.gen = calculateGen(tokenId1, tokenId2); _incrementDefaltinatedTokenId(); _burnBot(tokenId1); _burnBot(tokenId2); _safeMint(msg.sender, deflatinatedTokenId); emit Deflatination(tokenId1, tokenId2, deflatinatedTokenId); } function _burnBot(uint256 tokenId) internal { require(ownerOf(tokenId) == msg.sender, "sender is not owner of token"); _burn(tokenId); } function mintBlockBotsByBundle(address _recipient, uint256 _quantity) external onlyRole(BUNDLE_CONTRACT_ROLE) nonReentrant { _mintBatch(_recipient, _quantity); } function redeemMintPass(address _recipient, uint256 _quantity) external onlyRole(MINT_PASS_CONTRACT_ROLE) nonReentrant { _mintBatch(_recipient, _quantity); } function endRaffle() external onlyOwner { MAX_BLOCK_BOTS_CLAIMED_BY_RAFFLE = totalClaimedBlockBotsByRaffle; } function mintUnsoldBlockBots() external onlyOwner { uint256 BBUnsold = remainingBlockBots(); if (BBUnsold > MAX_MINT_LIMIT) { _mintBatch(msg.sender, MAX_MINT_LIMIT); } else { _mintBatch(msg.sender, BBUnsold); } } /** * @dev Changes the name for Hashmask tokenId */ function changeName(uint256 tokenId, string memory newName) external nonReentrant { require( msg.sender == ownerOf(tokenId), "ERC721: caller is not the owner" ); require(validateName(newName) == true, "Not a valid new name"); require( sha256(bytes(newName)) != sha256(bytes(tokenNameByTokenId[tokenId])), "New name is same as the current one" ); require(isNameReserved(newName) == false, "Name already reserved"); // If already named, dereserve old name if (bytes(tokenNameByTokenId[tokenId]).length > 0) { _toggleReserveName(tokenNameByTokenId[tokenId], false); } _toggleReserveName(newName, true); tokenNameByTokenId[tokenId] = newName; uint256 burnAmount = (nameChangePrice.mul(30)).div(100); _sendERC20(msg.sender, address(0), burnAmount); // 30% tokens as protocol fee _sendERC20( msg.sender, changeNameProtocolFeeAddress, nameChangePrice.sub(burnAmount) ); // 100% tokens as protocol fee emit NameChange(tokenId, newName); } function withdraw() external payable onlyOwner nonReentrant { _sendEther(owner(), address(this).balance); } function _mintBatch(address _recipient, uint256 _quantity) internal { require(_quantity <= MAX_MINT_LIMIT, "Exceeds maximum mint limit"); require(_quantity <= remainingBlockBots(), "Exceeds available bots"); totalBlockBotsMinted = totalBlockBotsMinted.add(_quantity); uint256 tokenId; uint256 startTokenId = getNextTokenId(); for (uint256 i = 0; i < _quantity; i = i.add(1)) { tokenId = getNextTokenId(); _incrementTokenId(); _safeMint(_recipient, tokenId); } emit Mint(_recipient, startTokenId, _quantity); } function _sendEther(address _recipient, uint256 _quantity) internal { (bool success, ) = payable(_recipient).call{value: _quantity}(""); require(success, "Withdraw failure"); } function _sendERC20( address _from, address _to, uint256 _quantity ) internal { require( IERC20(INDORSE_TOKEN_ADDRESS).transferFrom(_from, _to, _quantity), "Unable to transfer Indorse tokens" ); } /** * @dev increments the value of _currentTokenId */ function _incrementTokenId() internal { _currentTokenId = _currentTokenId.add(1); } function _baseURI() internal view override returns (string memory) { return _uri; } function _incrementDefaltinatedTokenId() internal { _deflatinatedTokenId = _deflatinatedTokenId.add(1); } function _getGenOfToken(uint256 tokenId) internal view returns (uint256) { require( isTokenActive(tokenId), "ERC721: operator query for nonexistent token" ); TokenLineageDetail memory data = _lineage[tokenId]; if (data.gen == 0) return 1; return data.gen; } function _changeToWei(uint256 _value) internal pure returns (uint256) { return _value.mul(1 wei); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT 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 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 pragma solidity ^0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s; uint8 v; assembly { s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) v := add(shr(255, vs), 27) } return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT 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 pragma solidity ^0.8.0; /** * @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 * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT 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 pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT 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) { require(_exists(tokenId), "ERC721URIStorage: URI query for nonexistent token"); 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 Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual override { super._burn(tokenId); if (bytes(_tokenURIs[tokenId]).length != 0) { delete _tokenURIs[tokenId]; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT 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 `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT 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`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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 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); /** * @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; }
// SPDX-License-Identifier: MIT 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: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); 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) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); 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 overriden 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 owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_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: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); } /** * @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 of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @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 { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC20.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT 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() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { 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 { _setOwner(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"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
pragma solidity >=0.8.0; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; contract VerifySignature { using ECDSA for bytes32; mapping(bytes32 => bool) private _claimedHashes; function isHashClaimed(bytes32 _hash) public view returns (bool) { return _claimedHashes[_hash]; } function getEthSignedMessageHash(bytes32 _messageHash) public pure returns (bytes32) { return _messageHash.toEthSignedMessageHash(); } function _setMessageHashClaimed( bytes32 _messageHash, address _signer, bytes memory _signature ) internal { require(!isHashClaimed(_messageHash), "cannot claim again"); require( verify(getEthSignedMessageHash(_messageHash), _signer, _signature), "signature not verified" ); _claimedHashes[_messageHash] = true; } function verify( bytes32 _ethSignedMessageHash, address _signer, bytes memory _signature ) public pure returns (bool) { return _ethSignedMessageHash.recover(_signature) == _signer; } }
pragma solidity >=0.8.0; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; contract ValidateString { using SafeMath for uint256; mapping(string => bool) private _nameReserved; event NameChange(uint256 indexed maskIndex, string newName); /** * @dev Reserves the name if isReserve is set to true, de-reserves if set to false */ function _toggleReserveName(string memory str, bool isReserve) internal { _nameReserved[toLower(str)] = isReserve; } /** * @dev Check if the name string is valid (Alphanumeric and spaces without leading or trailing space) */ function validateName(string memory str) public pure returns (bool) { bytes memory b = bytes(str); if (b.length < 1) return false; if (b.length > 25) return false; // Cannot be longer than 25 characters if (b[0] == 0x20) return false; // Leading space if (b[b.length.sub(1)] == 0x20) return false; // Trailing space bytes1 lastChar = b[0]; for (uint256 i = 0; i < b.length; i = i.add(1)) { bytes1 char = b[i]; if (char == 0x20 && lastChar == 0x20) return false; // Cannot contain continous spaces if ( !(char >= 0x30 && char <= 0x39) && //9-0 !(char >= 0x41 && char <= 0x5A) && //A-Z !(char >= 0x61 && char <= 0x7A) && //a-z !(char == 0x20) //space ) return false; lastChar = char; } return true; } function isNameReserved(string memory nameString) public view returns (bool) { return _nameReserved[toLower(nameString)]; } function toLower(string memory str) public pure returns (string memory) { bytes memory bStr = bytes(str); bytes memory bLower = new bytes(bStr.length); for (uint256 i = 0; i < bStr.length; i = i.add(1)) { // Uppercase character if ((uint8(bStr[i]) >= 65) && (uint8(bStr[i]) <= 90)) { bLower[i] = bytes1(uint8(bStr[i]) + 32); } else { bLower[i] = bStr[i]; } } return string(bLower); } function isNotEmptyString(string memory str) internal pure returns (bool) { bytes memory bStr = bytes(str); return bStr.length > 0; } }
pragma solidity >=0.8.0; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; interface IMintPass is IERC1155 { function totalMinted() external view returns (uint256); function getOnMarketMintPassTokenId() external view returns (uint256); function getOffMarketMintPassTokenId() external view returns (uint256); function totalSupply(uint256 tokenId) external view returns (uint256); function setUri(string memory _uri) external; function uri(uint256 tokenId) external view returns (string memory); function setMintPause(bool _pauseMintPass, bool _pauseBatchMintPass) external; function createMintPass(address recipient, uint256 quantity) external; function onMarketRedeemPass(address blockbots, uint256 quantity) external payable; function offMarketRedeemPass( address blockbots, address recipient, uint256 quantity ) external; function fetchBalanceOf(address owner) external view returns (uint256); function withdraw() external payable; function batchMintPass( address[] memory _recipients, uint256[] memory _quantities ) external; function batchOffMarketRedeemPass( address blockbots, address[] memory _recipients, uint256[] memory _quantities ) external; }
pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; contract ERC721Full is ERC721Enumerable, ERC721URIStorage { /// @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. /// @param name is a non-empty string /// @param symbol is a non-empty string constructor(string memory name, string memory symbol) ERC721(name, symbol) {} /// @dev Hook that is called before any token transfer. This includes minting and burning. `from`'s `tokenId` will be transferred to `to` /// @param from is an non-zero address /// @param to is an non-zero address /// @param tokenId is an uint256 which determine token transferred from `from` to `to` function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal override(ERC721Enumerable, ERC721) { ERC721Enumerable._beforeTokenTransfer(from, to, tokenId); } /// @notice Interface of the ERC165 standard /// @param interfaceId is a byte4 which determine interface used /// @return true if this contract implements the interface defined by `interfaceId` function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable, ERC721) returns (bool) { return ERC721.supportsInterface(interfaceId) || ERC721Enumerable.supportsInterface(interfaceId); } /// @notice the Uniform Resource Identifier (URI) for `tokenId` token /// @param tokenId is unit256 /// @return string of (URI) for `tokenId` token function tokenURI(uint256 tokenId) public view virtual override(ERC721URIStorage, ERC721) returns (string memory) { return ERC721URIStorage.tokenURI(tokenId); } function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) { return ERC721URIStorage._burn(tokenId); } }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 750 }, "evmVersion": "istanbul", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_mintPassAddress","type":"address"},{"internalType":"address","name":"_changeNameProtocolFeeAddress","type":"address"},{"internalType":"address","name":"_indorseTokenAddress","type":"address"},{"internalType":"address","name":"_redeemerAddress","type":"address"},{"internalType":"address","name":"_bundleAddress","type":"address"},{"internalType":"uint256","name":"_nameChangePrice","type":"uint256"},{"internalType":"string","name":"_baseUri","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_tokenId1","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"_tokenId2","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_newToken","type":"uint256"}],"name":"Deflatination","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"_startId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"maskIndex","type":"uint256"},{"indexed":false,"internalType":"string","name":"newName","type":"string"}],"name":"NameChange","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":"bool","name":"_pauseDeflatinate","type":"bool"}],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"BUNDLE_CONTRACT_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INDORSE_TOKEN_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_BLOCK_BOTS_CLAIMED_BY_RAFFLE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_MINT_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_PASS_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_PASS_CONTRACT_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId1","type":"uint256"},{"internalType":"uint256","name":"tokenId2","type":"uint256"}],"name":"calculateGen","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"newName","type":"string"}],"name":"changeName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"changeNameProtocolFeeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"uint256","name":"_blockHeight","type":"uint256"},{"internalType":"bytes","name":"_redeemerSignatureHash","type":"bytes"}],"name":"claimBlockBotsByRaffle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId1","type":"uint256"},{"internalType":"uint256","name":"tokenId2","type":"uint256"}],"name":"deflatinate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endRaffle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_messageHash","type":"bytes32"}],"name":"getEthSignedMessageHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getMaxTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNextDeflatinatedTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNextTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getParentOfBots","outputs":[{"components":[{"internalType":"uint256","name":"gen","type":"uint256"},{"internalType":"uint256","name":"parent1","type":"uint256"},{"internalType":"uint256","name":"parent2","type":"uint256"}],"internalType":"struct BlockBots.TokenLineageDetail","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"uint256","name":"_blockHeight","type":"uint256"}],"name":"getRaffleMessage","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_hash","type":"bytes32"}],"name":"isHashClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"nameString","type":"string"}],"name":"isNameReserved","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isTokenActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"mintBlockBotsByBundle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintUnsoldBlockBots","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nameChangePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pauseDeflatinate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"redeemMintPass","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"redeemerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"remainingBlockBots","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"remainingBlockBotsByBundles","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"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":"address","name":"_changeNameProtocolFeeAddress","type":"address"}],"name":"setChangeNameProtocolFeeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_nameChangePrice","type":"uint256"}],"name":"setNameChangePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_pauseDeflatinate","type":"bool"}],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_redeemer","type":"address"}],"name":"setRedeemerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"toLower","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenNameByTokenId","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalBlockBotsMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalClaimedBlockBotsByRaffle","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"validateName","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_ethSignedMessageHash","type":"bytes32"},{"internalType":"address","name":"_signer","type":"address"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"verify","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"walletOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"payable","type":"function"}]
Contract Creation Code
60c060405261270e6010556107d06011556016805460ff60a01b1916600160a01b17905560006017556127106018553480156200003b57600080fd5b506040516200561f3803806200561f8339810160408190526200005e916200051b565b60405180604001604052806009815260200168426c6f636b426f747360b81b81525060405180604001604052806002815260200161212160f11b8152508181620000b7620000b16200029e60201b60201c565b620002a2565b600180558151620000d09060039060208501906200045d565b508051620000e69060049060208401906200045d565b50505050506001600160a01b0387166200011d5760405162461bcd60e51b815260040162000114906200068b565b60405180910390fd5b6001600160a01b038616620001465760405162461bcd60e51b81526004016200011490620006c2565b6001600160a01b0385166200016f5760405162461bcd60e51b815260040162000114906200070e565b6001600160a01b038416620001985760405162461bcd60e51b8152600401620001149062000654565b620001a382620002f2565b601555601680546001600160a01b0319166001600160a01b038816179055606087901b6001600160601b0319166080528051620001e89060199060208401906200045d565b50606085901b6001600160601b03191660a052601480546001600160a01b0319166001600160a01b0386161790556200022360003362000317565b6200023f600080516020620055ff833981519152600062000327565b6200025a600080516020620055ff8339815191528862000317565b62000276600080516020620055df833981519152600062000327565b62000291600080516020620055df8339815191528462000317565b50505050505050620007d0565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006200030f6001836200037c60201b620022911790919060201c565b90505b919050565b62000323828262000391565b5050565b600062000334836200041d565b600084815260026020526040808220600101859055519192508391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b60006200038a828462000751565b9392505050565b6200039d828262000432565b620003235760008281526002602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620003d96200029e565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60009081526002602052604090206001015490565b60009182526002602090815260408084206001600160a01b0393909316845291905290205460ff1690565b8280546200046b906200077d565b90600052602060002090601f0160209004810192826200048f5760008555620004da565b82601f10620004aa57805160ff1916838001178555620004da565b82800160010185558215620004da579182015b82811115620004da578251825591602001919060010190620004bd565b50620004e8929150620004ec565b5090565b5b80821115620004e85760008155600101620004ed565b80516001600160a01b03811681146200031257600080fd5b600080600080600080600060e0888a03121562000536578283fd5b620005418862000503565b9650602062000552818a0162000503565b96506200056260408a0162000503565b95506200057260608a0162000503565b94506200058260808a0162000503565b60a08a015160c08b015191955093506001600160401b0380821115620005a6578384fd5b818b0191508b601f830112620005ba578384fd5b815181811115620005cf57620005cf620007ba565b604051601f8201601f1916810185018381118282101715620005f557620005f5620007ba565b60405281815283820185018e10156200060c578586fd5b8592505b818310156200062f578383018501518184018601529184019162000610565b818311156200064057858583830101525b809550505050505092959891949750929550565b6020808252601f908201527f5f72656465656d6572416464726573732063616e6e6f74206265207a65726f00604082015260600190565b6020808252601f908201527f5f6d696e7450617373416464726573732063616e6e6f74206265207a65726f00604082015260600190565b6020808252602c908201527f5f6368616e67654e616d6550726f746f636f6c4665654164647265737320636160408201526b6e6e6f74206265207a65726f60a01b606082015260800190565b60208082526023908201527f5f696e646f727365546f6b656e416464726573732063616e6e6f74206265207a60408201526265726f60e81b606082015260800190565b60008160001904831182151516156200077857634e487b7160e01b81526011600452602481fd5b500290565b6002810460018216806200079257607f821691505b60208210811415620007b457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b60805160601c60a05160601c614dd56200080a6000396000818161126d0152612a4c0152600081816113390152611bbf0152614dd56000f3fe6080604052600436106103f95760003560e01c80638febba2a1161020d578063be11a25911610128578063d5fee1c7116100bb578063e985e9c51161008a578063f2fde38b1161006f578063f2fde38b14610b0c578063f5cf2ce114610b2c578063fa54080114610b4c576103f9565b8063e985e9c514610ad7578063ee095c0e14610af7576103f9565b8063d5fee1c714610a6d578063d7ca901814610a82578063e650f73614610a97578063e838f2a214610ab7576103f9565b8063c87b56dd116100f7578063c87b56dd14610a03578063caa0f92a14610a23578063cdde0a5a14610a38578063d547741f14610a4d576103f9565b8063be11a25914610983578063bedb86fb146109a3578063bee99537146109c3578063c39cbef1146109e3576103f9565b8063a217fddf116101a0578063aff01bd31161016f578063aff01bd314610924578063b542f47c14610939578063b7d578c11461094e578063b88d4fde14610963576103f9565b8063a217fddf146108af578063a22cb465146108c4578063a2af0419146108e4578063a90f08a614610904576103f9565b8063994569c0116101dc578063994569c01461082f5780639b0b92ef1461084f5780639bd0cebe1461086f5780639ffdb65a1461088f576103f9565b80638febba2a146107c557806391d14854146107da5780639416b423146107fa57806395d89b411461081a576103f9565b80633ccfd60b116103185780636352211e116102ab5780637d8c72121161027a57806384a1b9021161025f57806384a1b9021461077b578063896e7b091461079b5780638da5cb5b146107b0576103f9565b80637d8c7212146107515780637f59230f14610766576103f9565b80636352211e146106e757806370a0823114610707578063715018a614610727578063733ad1851461073c576103f9565b80634acc17b3116102e75780634acc17b3146106885780634bcab8981461069d5780634f6ccce7146106b25780635db30bb1146106d2576103f9565b80633ccfd60b1461061e57806342842e0e14610626578063438b63001461064657806345ca773814610673576103f9565b806318160ddd116103905780632f2ff15d1161035f5780632f2ff15d1461059e5780632f745c59146105be57806330d3cfe2146105de57806336568abe146105fe576103f9565b806318160ddd1461052757806323b872dd14610549578063248a9ca31461056957806329a6864e14610589576103f9565b8063095ea7b3116103cc578063095ea7b3146104b05780631157b834146104d2578063145783b8146104e757806315b56d1014610507576103f9565b806301ffc9a7146103fe57806306a4bcba1461043457806306fdde0314610461578063081812fc14610483575b600080fd5b34801561040a57600080fd5b5061041e610419366004613caa565b610b6c565b60405161042b919061405c565b60405180910390f35b34801561044057600080fd5b5061045461044f366004613c03565b610b8e565b60405161042b9190614bca565b34801561046d57600080fd5b50610476610bf1565b60405161042b919061408e565b34801561048f57600080fd5b506104a361049e366004613c03565b610c83565b60405161042b9190613fa4565b3480156104bc57600080fd5b506104d06104cb366004613b70565b610ccf565b005b3480156104de57600080fd5b506104a3610d67565b3480156104f357600080fd5b506104d0610502366004613d7b565b610d76565b34801561051357600080fd5b5061041e610522366004613ce2565b610e19565b34801561053357600080fd5b5061053c610e4d565b60405161042b9190614067565b34801561055557600080fd5b506104d0610564366004613a99565b610e53565b34801561057557600080fd5b5061053c610584366004613c03565b610e8b565b34801561059557600080fd5b5061053c610ea0565b3480156105aa57600080fd5b506104d06105b9366004613c33565b610ea6565b3480156105ca57600080fd5b5061053c6105d9366004613b70565b610eca565b3480156105ea57600080fd5b5061053c6105f9366004613d5a565b610f1f565b34801561060a57600080fd5b506104d0610619366004613c33565b610f6a565b6104d0610fb0565b34801561063257600080fd5b506104d0610641366004613a99565b61102e565b34801561065257600080fd5b50610666610661366004613a4d565b611049565b60405161042b9190614018565b34801561067f57600080fd5b5061053c611107565b34801561069457600080fd5b5061053c61110d565b3480156106a957600080fd5b506104a3611131565b3480156106be57600080fd5b5061053c6106cd366004613c03565b611140565b3480156106de57600080fd5b5061053c61119b565b3480156106f357600080fd5b506104a3610702366004613c03565b6111a1565b34801561071357600080fd5b5061053c610722366004613a4d565b6111d6565b34801561073357600080fd5b506104d061121a565b34801561074857600080fd5b5061053c611265565b34801561075d57600080fd5b506104a361126b565b34801561077257600080fd5b5061053c61128f565b34801561078757600080fd5b506104d0610796366004613c03565b611294565b3480156107a757600080fd5b5061053c6112ff565b3480156107bc57600080fd5b506104a3611323565b3480156107d157600080fd5b5061053c611332565b3480156107e657600080fd5b5061041e6107f5366004613c33565b6113ed565b34801561080657600080fd5b50610476610815366004613ce2565b611418565b34801561082657600080fd5b506104766115d5565b34801561083b57600080fd5b5061047661084a366004613c03565b6115e4565b34801561085b57600080fd5b5061041e61086a366004613c03565b61167e565b34801561087b57600080fd5b506104d061088a366004613d5a565b611689565b34801561089b57600080fd5b5061041e6108aa366004613ce2565b611777565b3480156108bb57600080fd5b5061053c6119c4565b3480156108d057600080fd5b506104d06108df366004613b3a565b6119c9565b3480156108f057600080fd5b506104d06108ff366004613a4d565b611a97565b34801561091057600080fd5b506104d061091f366004613a4d565b611b1e565b34801561093057600080fd5b5061041e611ba7565b34801561094557600080fd5b5061053c611bb7565b34801561095a57600080fd5b506104a3611bbd565b34801561096f57600080fd5b506104d061097e366004613ad4565b611be1565b34801561098f57600080fd5b5061053c61099e366004613b99565b611c20565b3480156109af57600080fd5b506104d06109be366004613bcb565b611c56565b3480156109cf57600080fd5b506104d06109de366004613b70565b611d02565b3480156109ef57600080fd5b506104d06109fe366004613d15565b611d61565b348015610a0f57600080fd5b50610476610a1e366004613c03565b612066565b348015610a2f57600080fd5b5061053c612071565b348015610a4457600080fd5b506104d0612082565b348015610a5957600080fd5b506104d0610a68366004613c33565b6120f3565b348015610a7957600080fd5b5061053c612112565b348015610a8e57600080fd5b5061053c612128565b348015610aa357600080fd5b5061041e610ab2366004613c03565b612139565b348015610ac357600080fd5b506104d0610ad2366004613b70565b61214e565b348015610ae357600080fd5b5061041e610af2366004613a67565b61217b565b348015610b0357600080fd5b506104d06121a9565b348015610b1857600080fd5b506104d0610b27366004613a4d565b6121f0565b348015610b3857600080fd5b5061041e610b47366004613c55565b61225e565b348015610b5857600080fd5b5061053c610b67366004613c03565b612286565b6000610b77826122a4565b80610b865750610b86826122c9565b90505b919050565b610b966138c3565b6000828152601b60209081526040918290208251606081018452815481526001808301549382019390935260029091015492810192909252610be090610bda61119b565b906122e3565b831015610b86576001815292915050565b606060038054610c0090614ccf565b80601f0160208091040260200160405190810160405280929190818152602001828054610c2c90614ccf565b8015610c795780601f10610c4e57610100808354040283529160200191610c79565b820191906000526020600020905b815481529060010190602001808311610c5c57829003601f168201915b5050505050905090565b6000610c8e826122ef565b610cb35760405162461bcd60e51b8152600401610caa906146f0565b60405180910390fd5b506000908152600760205260409020546001600160a01b031690565b6000610cda826111a1565b9050806001600160a01b0316836001600160a01b03161415610d0e5760405162461bcd60e51b8152600401610caa906149cd565b806001600160a01b0316610d2061230c565b6001600160a01b03161480610d3c5750610d3c81610af261230c565b610d585760405162461bcd60e51b8152600401610caa90614497565b610d628383612310565b505050565b6014546001600160a01b031681565b60026001541415610d995760405162461bcd60e51b8152600401610caa90614ac8565b600260015582610dbb5760405162461bcd60e51b8152600401610caa906145f0565b601154601354610dcb90856122e3565b1115610dd657600080fd5b601354610de390846122e3565b601355610e06610df4338585611c20565b6014546001600160a01b03168361237e565b610e1033846123f0565b50506001805550565b6000600e610e2683611418565b604051610e339190613e09565b9081526040519081900360200190205460ff169050919050565b600b5490565b610e64610e5e61230c565b826124d8565b610e805760405162461bcd60e51b8152600401610caa90614a0e565b610d6283838361255d565b60009081526002602052604090206001015490565b60115481565b610eaf82610e8b565b610ec081610ebb61230c565b61268a565b610d6283836126ee565b6000610ed5836111d6565b8210610ef35760405162461bcd60e51b8152600401610caa9061417b565b506001600160a01b03821660009081526009602090815260408083208484529091529020545b92915050565b600080610f2b84612775565b90506000610f3884612775565b905080821115610f5657610f4d8260016122e3565b92505050610f19565b610f618160016122e3565b95945050505050565b610f7261230c565b6001600160a01b0316816001600160a01b031614610fa25760405162461bcd60e51b8152600401610caa90614b6d565b610fac82826127e9565b5050565b610fb861230c565b6001600160a01b0316610fc9611323565b6001600160a01b031614610fef5760405162461bcd60e51b8152600401610caa9061473c565b600260015414156110125760405162461bcd60e51b8152600401610caa90614ac8565b6002600155611028611022611323565b4761286e565b60018055565b610d6283838360405180602001604052806000815250611be1565b60606000611056836111d6565b905060008167ffffffffffffffff81111561108157634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156110aa578160200160208202803683370190505b50905060005b828110156110ff576110c28582610eca565b8282815181106110e257634e487b7160e01b600052603260045260246000fd5b60209081029190910101526110f88160016122e3565b90506110b0565b509392505050565b60155481565b7f526cc681c766655377276210dc2bb3de075795eb17ad3a4ad288c6b7d7cc4da181565b6016546001600160a01b031681565b600061114a610e4d565b82106111685760405162461bcd60e51b8152600401610caa90614a6b565b600b828154811061118957634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b60105490565b6000818152600560205260408120546001600160a01b031680610b865760405162461bcd60e51b8152600401610caa90614551565b60006001600160a01b0382166111fe5760405162461bcd60e51b8152600401610caa906144f4565b506001600160a01b031660009081526006602052604090205490565b61122261230c565b6001600160a01b0316611233611323565b6001600160a01b0316146112595760405162461bcd60e51b8152600401610caa9061473c565b61126360006128ea565b565b60125481565b7f000000000000000000000000000000000000000000000000000000000000000081565b603281565b61129c61230c565b6001600160a01b03166112ad611323565b6001600160a01b0316146112d35760405162461bcd60e51b8152600401610caa9061473c565b806112f05760405162461bcd60e51b8152600401610caa90614771565b6112f98161293a565b60155550565b7fdbe1f638ff655f202dd9bfd93eac2cb9178070f9e7ea6af4d6eee532495f9c6881565b6000546001600160a01b031690565b60006113e87f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663bd85b03960016040518263ffffffff1660e01b81526004016113849190614067565b60206040518083038186803b15801561139c57600080fd5b505afa1580156113b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d49190613c1b565b6113e26012546113e261119b565b90612947565b905090565b60009182526002602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060008290506000815167ffffffffffffffff81111561144957634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611473576020820181803683370190505b50905060005b82518110156110ff5760418382815181106114a457634e487b7160e01b600052603260045260246000fd5b016020015160f81c108015906114e25750605a8382815181106114d757634e487b7160e01b600052603260045260246000fd5b016020015160f81c11155b156115605782818151811061150757634e487b7160e01b600052603260045260246000fd5b602001015160f81c60f81b60f81c60206115219190614c1d565b60f81b82828151811061154457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506115c3565b82818151811061158057634e487b7160e01b600052603260045260246000fd5b602001015160f81c60f81b8282815181106115ab57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053505b6115ce8160016122e3565b9050611479565b606060048054610c0090614ccf565b601a60205260009081526040902080546115fd90614ccf565b80601f016020809104026020016040519081016040528092919081815260200182805461162990614ccf565b80156116765780601f1061164b57610100808354040283529160200191611676565b820191906000526020600020905b81548152906001019060200180831161165957829003601f168201915b505050505081565b6000610b86826122ef565b600260015414156116ac5760405162461bcd60e51b8152600401610caa90614ac8565b6002600155601654600160a01b900460ff16156116db5760405162461bcd60e51b8152600401610caa906147df565b60006116e5612128565b6000818152601b60205260409020600181018590556002810184905590915061170e8484610f1f565b8155611718612953565b61172184612966565b61172a83612966565b611734338361299f565b82847f21c0232e7d26add049e6ee748e7965695c08264b89aa4aec89d17b4c27bc1fd6846040516117659190614067565b60405180910390a35050600180555050565b600080829050600181511015611791576000915050610b89565b6019815111156117a5576000915050610b89565b806000815181106117c657634e487b7160e01b600052603260045260246000fd5b6020910101516001600160f81b031916600160fd1b14156117eb576000915050610b89565b805181906117fa906001612947565b8151811061181857634e487b7160e01b600052603260045260246000fd5b6020910101516001600160f81b031916600160fd1b141561183d576000915050610b89565b60008160008151811061186057634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b031916905060005b82518110156119b957600083828151811061189f57634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b0319169050600160fd1b811480156118d05750600160fd1b6001600160f81b03198416145b156118e2576000945050505050610b89565b600360fc1b6001600160f81b031982161080159061190e5750603960f81b6001600160f81b0319821611155b1580156119445750604160f81b6001600160f81b03198216108015906119425750602d60f91b6001600160f81b0319821611155b155b80156119795750606160f81b6001600160f81b03198216108015906119775750603d60f91b6001600160f81b0319821611155b155b80156119935750600160fd1b6001600160f81b0319821614155b156119a5576000945050505050610b89565b91506119b28160016122e3565b9050611874565b506001949350505050565b600081565b6119d161230c565b6001600160a01b0316826001600160a01b03161415611a025760405162461bcd60e51b8152600401610caa9061432d565b8060086000611a0f61230c565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155611a5361230c565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611a8b919061405c565b60405180910390a35050565b611a9f61230c565b6001600160a01b0316611ab0611323565b6001600160a01b031614611ad65760405162461bcd60e51b8152600401610caa9061473c565b6001600160a01b038116611afc5760405162461bcd60e51b8152600401610caa90614aff565b601480546001600160a01b0319166001600160a01b0392909216919091179055565b611b2661230c565b6001600160a01b0316611b37611323565b6001600160a01b031614611b5d5760405162461bcd60e51b8152600401610caa9061473c565b6016546001600160a01b0316611b855760405162461bcd60e51b8152600401610caa9061439b565b601680546001600160a01b0319166001600160a01b0392909216919091179055565b601654600160a01b900460ff1681565b60135481565b7f000000000000000000000000000000000000000000000000000000000000000081565b611bf2611bec61230c565b836124d8565b611c0e5760405162461bcd60e51b8152600401610caa90614a0e565b611c1a848484846129b9565b50505050565b6000838383604051602001611c3793929190613ddf565b6040516020818303038152906040528051906020012090509392505050565b611c5e61230c565b6001600160a01b0316611c6f611323565b6001600160a01b031614611c955760405162461bcd60e51b8152600401610caa9061473c565b601680547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b831515021790556040517f9422424b175dda897495a07b091ef74a3ef715cf6d866fc972954c1c7f45930490611cf790839061405c565b60405180910390a150565b7fdbe1f638ff655f202dd9bfd93eac2cb9178070f9e7ea6af4d6eee532495f9c68611d2f81610ebb61230c565b60026001541415611d525760405162461bcd60e51b8152600401610caa90614ac8565b6002600155610e1083836123f0565b60026001541415611d845760405162461bcd60e51b8152600401610caa90614ac8565b6002600155611d92826111a1565b6001600160a01b0316336001600160a01b031614611dc25760405162461bcd60e51b8152600401610caa90614144565b611dcb81611777565b1515600114611dec5760405162461bcd60e51b8152600401610caa90614b36565b6000828152601a6020526040908190209051600291611e0a91613e25565b602060405180830381855afa158015611e27573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190611e4a9190613c1b565b600282604051611e5a9190613e09565b602060405180830381855afa158015611e77573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190611e9a9190613c1b565b1415611eb85760405162461bcd60e51b8152600401610caa90614912565b611ec181610e19565b15611ede5760405162461bcd60e51b8152600401610caa9061465c565b6000828152601a602052604081208054611ef790614ccf565b90501115611fa2576000828152601a602052604090208054611fa29190611f1d90614ccf565b80601f0160208091040260200160405190810160405280929190818152602001828054611f4990614ccf565b8015611f965780601f10611f6b57610100808354040283529160200191611f96565b820191906000526020600020905b815481529060010190602001808311611f7957829003601f168201915b505050505060006129ec565b611fad8160016129ec565b6000828152601a602090815260409091208251611fcc928401906138e4565b506000611ff06064611fea601e60155461229190919063ffffffff16565b90612a29565b9050611ffe33600083612a35565b6016546015546120259133916001600160a01b03909116906120209085612947565b612a35565b827f7e632a301794d8d4a81ea7e20f37d1947158d36e66403af04ba85dd194b66f1b83604051612055919061408e565b60405180910390a250506001805550565b6060610b8682612af3565b6017546000906113e89060016122e3565b61208a61230c565b6001600160a01b031661209b611323565b6001600160a01b0316146120c15760405162461bcd60e51b8152600401610caa9061473c565b60006120cb611332565b905060328111156120e6576120e13360326123f0565b6120f0565b6120f033826123f0565b50565b6120fc82610e8b565b61210881610ebb61230c565b610d6283836127e9565b60006113e86011546113e2601354610bda611332565b6018546000906113e89060016122e3565b6000908152600f602052604090205460ff1690565b7f526cc681c766655377276210dc2bb3de075795eb17ad3a4ad288c6b7d7cc4da1611d2f81610ebb61230c565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b6121b161230c565b6001600160a01b03166121c2611323565b6001600160a01b0316146121e85760405162461bcd60e51b8152600401610caa9061473c565b601354601155565b6121f861230c565b6001600160a01b0316612209611323565b6001600160a01b03161461222f5760405162461bcd60e51b8152600401610caa9061473c565b6001600160a01b0381166122555760405162461bcd60e51b8152600401610caa90614235565b6120f0816128ea565b60006001600160a01b0383166122748584612c0c565b6001600160a01b031614949350505050565b6000610b8682612c28565b600061229d8284614c56565b9392505050565b60006001600160e01b03198216637965db0b60e01b1480610b865750610b8682612c58565b60006122d482612c71565b80610b865750610b8682612cb1565b600061229d8284614c05565b6000908152600560205260409020546001600160a01b0316151590565b3390565b600081815260076020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612345826111a1565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b61238783612139565b156123a45760405162461bcd60e51b8152600401610caa90614955565b6123b76123b084612286565b838361225e565b6123d35760405162461bcd60e51b8152600401610caa906142b2565b50506000908152600f60205260409020805460ff19166001179055565b60328111156124115760405162461bcd60e51b8152600401610caa90614821565b612419611332565b8111156124385760405162461bcd60e51b8152600401610caa906147a8565b60125461244590826122e3565b601255600080612453612071565b905060005b8381101561248e57612468612071565b9250612472612cd6565b61247c858461299f565b6124878160016122e3565b9050612458565b50836001600160a01b03167f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f82856040516124ca929190614beb565b60405180910390a250505050565b60006124e3826122ef565b6124ff5760405162461bcd60e51b8152600401610caa90614414565b600061250a836111a1565b9050806001600160a01b0316846001600160a01b031614806125455750836001600160a01b031661253a84610c83565b6001600160a01b0316145b806125555750612555818561217b565b949350505050565b826001600160a01b0316612570826111a1565b6001600160a01b0316146125965760405162461bcd60e51b8152600401610caa90614858565b6001600160a01b0382166125bc5760405162461bcd60e51b8152600401610caa906142e9565b6125c7838383612ce9565b6125d2600082612310565b6001600160a01b03831660009081526006602052604081208054600192906125fb908490614c75565b90915550506001600160a01b0382166000908152600660205260408120805460019290612629908490614c05565b909155505060008181526005602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b61269482826113ed565b610fac576126ac816001600160a01b03166014612cf4565b6126b7836020612cf4565b6040516020016126c8929190613f23565b60408051601f198184030181529082905262461bcd60e51b8252610caa9160040161408e565b6126f882826113ed565b610fac5760008281526002602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561273161230c565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006127808261167e565b61279c5760405162461bcd60e51b8152600401610caa90614414565b6000828152601b602090815260409182902082516060810184528154808252600183015493820193909352600290910154928101929092526127e2576001915050610b89565b5192915050565b6127f382826113ed565b15610fac5760008281526002602090815260408083206001600160a01b03851684529091529020805460ff1916905561282a61230c565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000826001600160a01b03168260405161288790613f20565b60006040518083038185875af1925050503d80600081146128c4576040519150601f19603f3d011682016040523d82523d6000602084013e6128c9565b606091505b5050905080610d625760405162461bcd60e51b8152600401610caa90614364565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610b86826001612291565b600061229d8284614c75565b6018546129619060016122e3565b601855565b33612970826111a1565b6001600160a01b0316146129965760405162461bcd60e51b8152600401610caa90614460565b6120f081612eb3565b610fac828260405180602001604052806000815250612ebc565b6129c484848461255d565b6129d084848484612eef565b611c1a5760405162461bcd60e51b8152600401610caa906141d8565b80600e6129f884611418565b604051612a059190613e09565b908152604051908190036020019020805491151560ff199092169190911790555050565b600061229d8284614c42565b6040516323b872dd60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906323b872dd90612a8590869086908690600401613fb8565b602060405180830381600087803b158015612a9f57600080fd5b505af1158015612ab3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ad79190613be7565b610d625760405162461bcd60e51b8152600401610caa9061498c565b6060612afe826122ef565b612b1a5760405162461bcd60e51b8152600401610caa90614693565b6000828152600d602052604081208054612b3390614ccf565b80601f0160208091040260200160405190810160405280929190818152602001828054612b5f90614ccf565b8015612bac5780601f10612b8157610100808354040283529160200191612bac565b820191906000526020600020905b815481529060010190602001808311612b8f57829003601f168201915b505050505090506000612bbd612fff565b9050805160001415612bd157509050610b89565b815115612c03578082604051602001612beb929190613ec0565b60405160208183030381529060405292505050610b89565b6125558461300e565b6000806000612c1b8585613090565b915091506110ff81613100565b600081604051602001612c3b9190613eef565b604051602081830303815290604052805190602001209050919050565b6001600160e01b031981166301ffc9a760e01b14919050565b60006001600160e01b031982166380ac58cd60e01b1480612ca257506001600160e01b03198216635b5e139f60e01b145b80610b865750610b86826122a4565b60006001600160e01b0319821663780e9d6360e01b1480610b865750610b8682612c71565b601754612ce49060016122e3565b601755565b610d6283838361322d565b60606000612d03836002614c56565b612d0e906002614c05565b67ffffffffffffffff811115612d3457634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612d5e576020820181803683370190505b509050600360fc1b81600081518110612d8757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612dc457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000612de8846002614c56565b612df3906001614c05565b90505b6001811115612e94577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612e4257634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110612e6657634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93612e8d81614cb8565b9050612df6565b50831561229d5760405162461bcd60e51b8152600401610caa906140d8565b6120f0816132b6565b612ec683836132f6565b612ed36000848484612eef565b610d625760405162461bcd60e51b8152600401610caa906141d8565b6000612f03846001600160a01b03166133d5565b156119b957836001600160a01b031663150b7a02612f1f61230c565b8786866040518563ffffffff1660e01b8152600401612f419493929190613fdc565b602060405180830381600087803b158015612f5b57600080fd5b505af1925050508015612f8b575060408051601f3d908101601f19168201909252612f8891810190613cc6565b60015b612fe5573d808015612fb9576040519150601f19603f3d011682016040523d82523d6000602084013e612fbe565b606091505b508051612fdd5760405162461bcd60e51b8152600401610caa906141d8565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612555565b606060198054610c0090614ccf565b6060613019826122ef565b6130355760405162461bcd60e51b8152600401610caa906148b5565b600061303f612fff565b9050600081511161305f576040518060200160405280600081525061229d565b80613069846133db565b60405160200161307a929190613ec0565b6040516020818303038152906040529392505050565b6000808251604114156130c75760208301516040840151606085015160001a6130bb878285856134f6565b945094505050506130f9565b8251604014156130f157602083015160408401516130e68683836135d6565b9350935050506130f9565b506000905060025b9250929050565b600081600481111561312257634e487b7160e01b600052602160045260246000fd5b141561312d576120f0565b600181600481111561314f57634e487b7160e01b600052602160045260246000fd5b141561316d5760405162461bcd60e51b8152600401610caa906140a1565b600281600481111561318f57634e487b7160e01b600052602160045260246000fd5b14156131ad5760405162461bcd60e51b8152600401610caa9061410d565b60038160048111156131cf57634e487b7160e01b600052602160045260246000fd5b14156131ed5760405162461bcd60e51b8152600401610caa906143d2565b600481600481111561320f57634e487b7160e01b600052602160045260246000fd5b14156120f05760405162461bcd60e51b8152600401610caa906145ae565b613238838383610d62565b6001600160a01b0383166132545761324f8161361e565b613277565b816001600160a01b0316836001600160a01b031614613277576132778382613662565b6001600160a01b0382166132935761328e816136ff565b610d62565b826001600160a01b0316826001600160a01b031614610d6257610d6282826137d8565b6132bf8161381c565b6000818152600d6020526040902080546132d890614ccf565b1590506120f0576000818152600d602052604081206120f091613968565b6001600160a01b03821661331c5760405162461bcd60e51b8152600401610caa90614627565b613325816122ef565b156133425760405162461bcd60e51b8152600401610caa9061427b565b61334e60008383612ce9565b6001600160a01b0382166000908152600660205260408120805460019290613377908490614c05565b909155505060008181526005602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b3b151590565b60608161340057506040805180820190915260018152600360fc1b6020820152610b89565b8160005b811561342a578061341481614d0a565b91506134239050600a83614c42565b9150613404565b60008167ffffffffffffffff81111561345357634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561347d576020820181803683370190505b5090505b841561255557613492600183614c75565b915061349f600a86614d25565b6134aa906030614c05565b60f81b8183815181106134cd57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506134ef600a86614c42565b9450613481565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561352d57506000905060036135cd565b8460ff16601b1415801561354557508460ff16601c14155b1561355657506000905060046135cd565b60006001878787876040516000815260200160405260405161357b9493929190614070565b6020604051602081039080840390855afa15801561359d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166135c6576000600192509250506135cd565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831660ff84901c601b01613610878288856134f6565b935093505050935093915050565b600b80546000838152600c60205260408120829055600182018355919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90155565b6000600161366f846111d6565b6136799190614c75565b6000838152600a60205260409020549091508082146136cc576001600160a01b03841660009081526009602090815260408083208584528252808320548484528184208190558352600a90915290208190555b506000918252600a602090815260408084208490556001600160a01b039094168352600981528383209183525290812055565b600b5460009061371190600190614c75565b6000838152600c6020526040812054600b805493945090928490811061374757634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080600b838154811061377657634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255828152600c9091526040808220849055858252812055600b8054806137bc57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006137e3836111d6565b6001600160a01b0390931660009081526009602090815260408083208684528252808320859055938252600a9052919091209190915550565b6000613827826111a1565b905061383581600084612ce9565b613840600083612310565b6001600160a01b0381166000908152600660205260408120805460019290613869908490614c75565b909155505060008281526005602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60405180606001604052806000815260200160008152602001600081525090565b8280546138f090614ccf565b90600052602060002090601f0160209004810192826139125760008555613958565b82601f1061392b57805160ff1916838001178555613958565b82800160010185558215613958579182015b8281111561395857825182559160200191906001019061393d565b506139649291506139a0565b5090565b50805461397490614ccf565b6000825580601f1061398657506120f0565b601f0160209004906000526020600020908101906120f091905b5b8082111561396457600081556001016139a1565b80356001600160a01b0381168114610b8957600080fd5b600082601f8301126139dc578081fd5b813567ffffffffffffffff808211156139f7576139f7614d65565b604051601f8301601f191681016020018281118282101715613a1b57613a1b614d65565b604052828152848301602001861015613a32578384fd5b82602086016020830137918201602001929092529392505050565b600060208284031215613a5e578081fd5b61229d826139b5565b60008060408385031215613a79578081fd5b613a82836139b5565b9150613a90602084016139b5565b90509250929050565b600080600060608486031215613aad578081fd5b613ab6846139b5565b9250613ac4602085016139b5565b9150604084013590509250925092565b60008060008060808587031215613ae9578081fd5b613af2856139b5565b9350613b00602086016139b5565b925060408501359150606085013567ffffffffffffffff811115613b22578182fd5b613b2e878288016139cc565b91505092959194509250565b60008060408385031215613b4c578182fd5b613b55836139b5565b91506020830135613b6581614d7b565b809150509250929050565b60008060408385031215613b82578182fd5b613b8b836139b5565b946020939093013593505050565b600080600060608486031215613bad578283fd5b613bb6846139b5565b95602085013595506040909401359392505050565b600060208284031215613bdc578081fd5b813561229d81614d7b565b600060208284031215613bf8578081fd5b815161229d81614d7b565b600060208284031215613c14578081fd5b5035919050565b600060208284031215613c2c578081fd5b5051919050565b60008060408385031215613c45578081fd5b82359150613a90602084016139b5565b600080600060608486031215613c69578081fd5b83359250613c79602085016139b5565b9150604084013567ffffffffffffffff811115613c94578182fd5b613ca0868287016139cc565b9150509250925092565b600060208284031215613cbb578081fd5b813561229d81614d89565b600060208284031215613cd7578081fd5b815161229d81614d89565b600060208284031215613cf3578081fd5b813567ffffffffffffffff811115613d09578182fd5b612555848285016139cc565b60008060408385031215613d27578182fd5b82359150602083013567ffffffffffffffff811115613d44578182fd5b613d50858286016139cc565b9150509250929050565b60008060408385031215613d6c578182fd5b50508035926020909101359150565b600080600060608486031215613d8f578081fd5b8335925060208401359150604084013567ffffffffffffffff811115613c94578182fd5b60008151808452613dcb816020860160208601614c8c565b601f01601f19169290920160200192915050565b60609390931b6bffffffffffffffffffffffff191683526014830191909152603482015260540190565b60008251613e1b818460208701614c8c565b9190910192915050565b8154600090819060028104600180831680613e4157607f831692505b6020808410821415613e6157634e487b7160e01b87526022600452602487fd5b818015613e755760018114613e8657613eb2565b60ff19861689528489019650613eb2565b613e8f8a614bf9565b885b86811015613eaa5781548b820152908501908301613e91565b505084890196505b509498975050505050505050565b60008351613ed2818460208801614c8c565b835190830190613ee6818360208801614c8c565b01949350505050565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b90565b60007f416363657373436f6e74726f6c3a206163636f756e742000000000000000000082528351613f5b816017850160208801614c8c565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351613f98816028840160208801614c8c565b01602801949350505050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60006001600160a01b0380871683528086166020840152508360408301526080606083015261400e6080830184613db3565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561405057835183529284019291840191600101614034565b50909695505050505050565b901515815260200190565b90815260200190565b93845260ff9290921660208401526040830152606082015260800190565b60006020825261229d6020830184613db3565b60208082526018908201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604082015260600190565b6020808252818101527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604082015260600190565b6020808252601f908201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604082015260600190565b6020808252601f908201527f4552433732313a2063616c6c6572206973206e6f7420746865206f776e657200604082015260600190565b6020808252602b908201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201527f74206f6620626f756e6473000000000000000000000000000000000000000000606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527f63656976657220696d706c656d656e7465720000000000000000000000000000606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526016908201527f7369676e6174757265206e6f7420766572696669656400000000000000000000604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b60208082526010908201527f5769746864726177206661696c75726500000000000000000000000000000000604082015260600190565b6020808252601a908201527f63616e6e6f742073657420746f207a65726f2061646472657373000000000000604082015260600190565b60208082526022908201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604082015261756560f01b606082015260800190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252601c908201527f73656e646572206973206e6f74206f776e6572206f6620746f6b656e00000000604082015260600190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560408201527f726f206164647265737300000000000000000000000000000000000000000000606082015260800190565b60208082526029908201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460408201527f656e7420746f6b656e0000000000000000000000000000000000000000000000606082015260800190565b60208082526022908201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604082015261756560f01b606082015260800190565b60208082526017908201527f7175616e746974792063616e6e6f74206265207a65726f000000000000000000604082015260600190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b60208082526015908201527f4e616d6520616c72656164792072657365727665640000000000000000000000604082015260600190565b60208082526031908201527f45524337323155524953746f726167653a2055524920717565727920666f722060408201527f6e6f6e6578697374656e7420746f6b656e000000000000000000000000000000606082015260800190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526015908201527f63616e6e6f7420736574207072696365207a65726f0000000000000000000000604082015260600190565b60208082526016908201527f4578636565647320617661696c61626c6520626f747300000000000000000000604082015260600190565b60208082526022908201527f6465666c6174696e6174696f6e206f6620746f6b656e73206172652070617573604082015261195960f21b606082015260800190565b6020808252601a908201527f45786365656473206d6178696d756d206d696e74206c696d6974000000000000604082015260600190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201527f73206e6f74206f776e0000000000000000000000000000000000000000000000606082015260800190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000606082015260800190565b60208082526023908201527f4e6577206e616d652069732073616d65206173207468652063757272656e74206040820152626f6e6560e81b606082015260800190565b60208082526012908201527f63616e6e6f7420636c61696d20616761696e0000000000000000000000000000604082015260600190565b60208082526021908201527f556e61626c6520746f207472616e7366657220496e646f72736520746f6b656e6040820152607360f81b606082015260800190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60408201527f776e6572206e6f7220617070726f766564000000000000000000000000000000606082015260800190565b6020808252602c908201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60408201527f7574206f6620626f756e64730000000000000000000000000000000000000000606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601a908201527f616464726573732063616e6e6f742073657420746f207a65726f000000000000604082015260600190565b60208082526014908201527f4e6f7420612076616c6964206e6577206e616d65000000000000000000000000604082015260600190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201527f20726f6c657320666f722073656c660000000000000000000000000000000000606082015260800190565b81518152602080830151908201526040918201519181019190915260600190565b918252602082015260400190565b60009081526020902090565b60008219821115614c1857614c18614d39565b500190565b600060ff821660ff84168060ff03821115614c3a57614c3a614d39565b019392505050565b600082614c5157614c51614d4f565b500490565b6000816000190483118215151615614c7057614c70614d39565b500290565b600082821015614c8757614c87614d39565b500390565b60005b83811015614ca7578181015183820152602001614c8f565b83811115611c1a5750506000910152565b600081614cc757614cc7614d39565b506000190190565b600281046001821680614ce357607f821691505b60208210811415614d0457634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415614d1e57614d1e614d39565b5060010190565b600082614d3457614d34614d4f565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146120f057600080fd5b6001600160e01b0319811681146120f057600080fdfea2646970667358221220040225074223ecf8c266dc0e0634415a92382f19007af7f28c5a61882963a35d64736f6c63430008000033dbe1f638ff655f202dd9bfd93eac2cb9178070f9e7ea6af4d6eee532495f9c68526cc681c766655377276210dc2bb3de075795eb17ad3a4ad288c6b7d7cc4da1000000000000000000000000727a4286a3b501eb90a6a8246c99188cf59ab023000000000000000000000000c4838ee142d9dd515ed0eb25efa9dad2dc5de3e4000000000000000000000000f8e386eda857484f5a12e4b5daa9984e06e737050000000000000000000000002429eb38cb9b456160937e11aefc80879a2d27120000000000000000000000002d1fc49838e9ac6e6bdbf5f784b15d028e5d19c70000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000001f68747470733a2f2f6170692e626c6f636b626f74732e67672f746f6b656e2f00
Deployed Bytecode
0x6080604052600436106103f95760003560e01c80638febba2a1161020d578063be11a25911610128578063d5fee1c7116100bb578063e985e9c51161008a578063f2fde38b1161006f578063f2fde38b14610b0c578063f5cf2ce114610b2c578063fa54080114610b4c576103f9565b8063e985e9c514610ad7578063ee095c0e14610af7576103f9565b8063d5fee1c714610a6d578063d7ca901814610a82578063e650f73614610a97578063e838f2a214610ab7576103f9565b8063c87b56dd116100f7578063c87b56dd14610a03578063caa0f92a14610a23578063cdde0a5a14610a38578063d547741f14610a4d576103f9565b8063be11a25914610983578063bedb86fb146109a3578063bee99537146109c3578063c39cbef1146109e3576103f9565b8063a217fddf116101a0578063aff01bd31161016f578063aff01bd314610924578063b542f47c14610939578063b7d578c11461094e578063b88d4fde14610963576103f9565b8063a217fddf146108af578063a22cb465146108c4578063a2af0419146108e4578063a90f08a614610904576103f9565b8063994569c0116101dc578063994569c01461082f5780639b0b92ef1461084f5780639bd0cebe1461086f5780639ffdb65a1461088f576103f9565b80638febba2a146107c557806391d14854146107da5780639416b423146107fa57806395d89b411461081a576103f9565b80633ccfd60b116103185780636352211e116102ab5780637d8c72121161027a57806384a1b9021161025f57806384a1b9021461077b578063896e7b091461079b5780638da5cb5b146107b0576103f9565b80637d8c7212146107515780637f59230f14610766576103f9565b80636352211e146106e757806370a0823114610707578063715018a614610727578063733ad1851461073c576103f9565b80634acc17b3116102e75780634acc17b3146106885780634bcab8981461069d5780634f6ccce7146106b25780635db30bb1146106d2576103f9565b80633ccfd60b1461061e57806342842e0e14610626578063438b63001461064657806345ca773814610673576103f9565b806318160ddd116103905780632f2ff15d1161035f5780632f2ff15d1461059e5780632f745c59146105be57806330d3cfe2146105de57806336568abe146105fe576103f9565b806318160ddd1461052757806323b872dd14610549578063248a9ca31461056957806329a6864e14610589576103f9565b8063095ea7b3116103cc578063095ea7b3146104b05780631157b834146104d2578063145783b8146104e757806315b56d1014610507576103f9565b806301ffc9a7146103fe57806306a4bcba1461043457806306fdde0314610461578063081812fc14610483575b600080fd5b34801561040a57600080fd5b5061041e610419366004613caa565b610b6c565b60405161042b919061405c565b60405180910390f35b34801561044057600080fd5b5061045461044f366004613c03565b610b8e565b60405161042b9190614bca565b34801561046d57600080fd5b50610476610bf1565b60405161042b919061408e565b34801561048f57600080fd5b506104a361049e366004613c03565b610c83565b60405161042b9190613fa4565b3480156104bc57600080fd5b506104d06104cb366004613b70565b610ccf565b005b3480156104de57600080fd5b506104a3610d67565b3480156104f357600080fd5b506104d0610502366004613d7b565b610d76565b34801561051357600080fd5b5061041e610522366004613ce2565b610e19565b34801561053357600080fd5b5061053c610e4d565b60405161042b9190614067565b34801561055557600080fd5b506104d0610564366004613a99565b610e53565b34801561057557600080fd5b5061053c610584366004613c03565b610e8b565b34801561059557600080fd5b5061053c610ea0565b3480156105aa57600080fd5b506104d06105b9366004613c33565b610ea6565b3480156105ca57600080fd5b5061053c6105d9366004613b70565b610eca565b3480156105ea57600080fd5b5061053c6105f9366004613d5a565b610f1f565b34801561060a57600080fd5b506104d0610619366004613c33565b610f6a565b6104d0610fb0565b34801561063257600080fd5b506104d0610641366004613a99565b61102e565b34801561065257600080fd5b50610666610661366004613a4d565b611049565b60405161042b9190614018565b34801561067f57600080fd5b5061053c611107565b34801561069457600080fd5b5061053c61110d565b3480156106a957600080fd5b506104a3611131565b3480156106be57600080fd5b5061053c6106cd366004613c03565b611140565b3480156106de57600080fd5b5061053c61119b565b3480156106f357600080fd5b506104a3610702366004613c03565b6111a1565b34801561071357600080fd5b5061053c610722366004613a4d565b6111d6565b34801561073357600080fd5b506104d061121a565b34801561074857600080fd5b5061053c611265565b34801561075d57600080fd5b506104a361126b565b34801561077257600080fd5b5061053c61128f565b34801561078757600080fd5b506104d0610796366004613c03565b611294565b3480156107a757600080fd5b5061053c6112ff565b3480156107bc57600080fd5b506104a3611323565b3480156107d157600080fd5b5061053c611332565b3480156107e657600080fd5b5061041e6107f5366004613c33565b6113ed565b34801561080657600080fd5b50610476610815366004613ce2565b611418565b34801561082657600080fd5b506104766115d5565b34801561083b57600080fd5b5061047661084a366004613c03565b6115e4565b34801561085b57600080fd5b5061041e61086a366004613c03565b61167e565b34801561087b57600080fd5b506104d061088a366004613d5a565b611689565b34801561089b57600080fd5b5061041e6108aa366004613ce2565b611777565b3480156108bb57600080fd5b5061053c6119c4565b3480156108d057600080fd5b506104d06108df366004613b3a565b6119c9565b3480156108f057600080fd5b506104d06108ff366004613a4d565b611a97565b34801561091057600080fd5b506104d061091f366004613a4d565b611b1e565b34801561093057600080fd5b5061041e611ba7565b34801561094557600080fd5b5061053c611bb7565b34801561095a57600080fd5b506104a3611bbd565b34801561096f57600080fd5b506104d061097e366004613ad4565b611be1565b34801561098f57600080fd5b5061053c61099e366004613b99565b611c20565b3480156109af57600080fd5b506104d06109be366004613bcb565b611c56565b3480156109cf57600080fd5b506104d06109de366004613b70565b611d02565b3480156109ef57600080fd5b506104d06109fe366004613d15565b611d61565b348015610a0f57600080fd5b50610476610a1e366004613c03565b612066565b348015610a2f57600080fd5b5061053c612071565b348015610a4457600080fd5b506104d0612082565b348015610a5957600080fd5b506104d0610a68366004613c33565b6120f3565b348015610a7957600080fd5b5061053c612112565b348015610a8e57600080fd5b5061053c612128565b348015610aa357600080fd5b5061041e610ab2366004613c03565b612139565b348015610ac357600080fd5b506104d0610ad2366004613b70565b61214e565b348015610ae357600080fd5b5061041e610af2366004613a67565b61217b565b348015610b0357600080fd5b506104d06121a9565b348015610b1857600080fd5b506104d0610b27366004613a4d565b6121f0565b348015610b3857600080fd5b5061041e610b47366004613c55565b61225e565b348015610b5857600080fd5b5061053c610b67366004613c03565b612286565b6000610b77826122a4565b80610b865750610b86826122c9565b90505b919050565b610b966138c3565b6000828152601b60209081526040918290208251606081018452815481526001808301549382019390935260029091015492810192909252610be090610bda61119b565b906122e3565b831015610b86576001815292915050565b606060038054610c0090614ccf565b80601f0160208091040260200160405190810160405280929190818152602001828054610c2c90614ccf565b8015610c795780601f10610c4e57610100808354040283529160200191610c79565b820191906000526020600020905b815481529060010190602001808311610c5c57829003601f168201915b5050505050905090565b6000610c8e826122ef565b610cb35760405162461bcd60e51b8152600401610caa906146f0565b60405180910390fd5b506000908152600760205260409020546001600160a01b031690565b6000610cda826111a1565b9050806001600160a01b0316836001600160a01b03161415610d0e5760405162461bcd60e51b8152600401610caa906149cd565b806001600160a01b0316610d2061230c565b6001600160a01b03161480610d3c5750610d3c81610af261230c565b610d585760405162461bcd60e51b8152600401610caa90614497565b610d628383612310565b505050565b6014546001600160a01b031681565b60026001541415610d995760405162461bcd60e51b8152600401610caa90614ac8565b600260015582610dbb5760405162461bcd60e51b8152600401610caa906145f0565b601154601354610dcb90856122e3565b1115610dd657600080fd5b601354610de390846122e3565b601355610e06610df4338585611c20565b6014546001600160a01b03168361237e565b610e1033846123f0565b50506001805550565b6000600e610e2683611418565b604051610e339190613e09565b9081526040519081900360200190205460ff169050919050565b600b5490565b610e64610e5e61230c565b826124d8565b610e805760405162461bcd60e51b8152600401610caa90614a0e565b610d6283838361255d565b60009081526002602052604090206001015490565b60115481565b610eaf82610e8b565b610ec081610ebb61230c565b61268a565b610d6283836126ee565b6000610ed5836111d6565b8210610ef35760405162461bcd60e51b8152600401610caa9061417b565b506001600160a01b03821660009081526009602090815260408083208484529091529020545b92915050565b600080610f2b84612775565b90506000610f3884612775565b905080821115610f5657610f4d8260016122e3565b92505050610f19565b610f618160016122e3565b95945050505050565b610f7261230c565b6001600160a01b0316816001600160a01b031614610fa25760405162461bcd60e51b8152600401610caa90614b6d565b610fac82826127e9565b5050565b610fb861230c565b6001600160a01b0316610fc9611323565b6001600160a01b031614610fef5760405162461bcd60e51b8152600401610caa9061473c565b600260015414156110125760405162461bcd60e51b8152600401610caa90614ac8565b6002600155611028611022611323565b4761286e565b60018055565b610d6283838360405180602001604052806000815250611be1565b60606000611056836111d6565b905060008167ffffffffffffffff81111561108157634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156110aa578160200160208202803683370190505b50905060005b828110156110ff576110c28582610eca565b8282815181106110e257634e487b7160e01b600052603260045260246000fd5b60209081029190910101526110f88160016122e3565b90506110b0565b509392505050565b60155481565b7f526cc681c766655377276210dc2bb3de075795eb17ad3a4ad288c6b7d7cc4da181565b6016546001600160a01b031681565b600061114a610e4d565b82106111685760405162461bcd60e51b8152600401610caa90614a6b565b600b828154811061118957634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b60105490565b6000818152600560205260408120546001600160a01b031680610b865760405162461bcd60e51b8152600401610caa90614551565b60006001600160a01b0382166111fe5760405162461bcd60e51b8152600401610caa906144f4565b506001600160a01b031660009081526006602052604090205490565b61122261230c565b6001600160a01b0316611233611323565b6001600160a01b0316146112595760405162461bcd60e51b8152600401610caa9061473c565b61126360006128ea565b565b60125481565b7f000000000000000000000000f8e386eda857484f5a12e4b5daa9984e06e7370581565b603281565b61129c61230c565b6001600160a01b03166112ad611323565b6001600160a01b0316146112d35760405162461bcd60e51b8152600401610caa9061473c565b806112f05760405162461bcd60e51b8152600401610caa90614771565b6112f98161293a565b60155550565b7fdbe1f638ff655f202dd9bfd93eac2cb9178070f9e7ea6af4d6eee532495f9c6881565b6000546001600160a01b031690565b60006113e87f000000000000000000000000727a4286a3b501eb90a6a8246c99188cf59ab0236001600160a01b031663bd85b03960016040518263ffffffff1660e01b81526004016113849190614067565b60206040518083038186803b15801561139c57600080fd5b505afa1580156113b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d49190613c1b565b6113e26012546113e261119b565b90612947565b905090565b60009182526002602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060008290506000815167ffffffffffffffff81111561144957634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611473576020820181803683370190505b50905060005b82518110156110ff5760418382815181106114a457634e487b7160e01b600052603260045260246000fd5b016020015160f81c108015906114e25750605a8382815181106114d757634e487b7160e01b600052603260045260246000fd5b016020015160f81c11155b156115605782818151811061150757634e487b7160e01b600052603260045260246000fd5b602001015160f81c60f81b60f81c60206115219190614c1d565b60f81b82828151811061154457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506115c3565b82818151811061158057634e487b7160e01b600052603260045260246000fd5b602001015160f81c60f81b8282815181106115ab57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053505b6115ce8160016122e3565b9050611479565b606060048054610c0090614ccf565b601a60205260009081526040902080546115fd90614ccf565b80601f016020809104026020016040519081016040528092919081815260200182805461162990614ccf565b80156116765780601f1061164b57610100808354040283529160200191611676565b820191906000526020600020905b81548152906001019060200180831161165957829003601f168201915b505050505081565b6000610b86826122ef565b600260015414156116ac5760405162461bcd60e51b8152600401610caa90614ac8565b6002600155601654600160a01b900460ff16156116db5760405162461bcd60e51b8152600401610caa906147df565b60006116e5612128565b6000818152601b60205260409020600181018590556002810184905590915061170e8484610f1f565b8155611718612953565b61172184612966565b61172a83612966565b611734338361299f565b82847f21c0232e7d26add049e6ee748e7965695c08264b89aa4aec89d17b4c27bc1fd6846040516117659190614067565b60405180910390a35050600180555050565b600080829050600181511015611791576000915050610b89565b6019815111156117a5576000915050610b89565b806000815181106117c657634e487b7160e01b600052603260045260246000fd5b6020910101516001600160f81b031916600160fd1b14156117eb576000915050610b89565b805181906117fa906001612947565b8151811061181857634e487b7160e01b600052603260045260246000fd5b6020910101516001600160f81b031916600160fd1b141561183d576000915050610b89565b60008160008151811061186057634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b031916905060005b82518110156119b957600083828151811061189f57634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b0319169050600160fd1b811480156118d05750600160fd1b6001600160f81b03198416145b156118e2576000945050505050610b89565b600360fc1b6001600160f81b031982161080159061190e5750603960f81b6001600160f81b0319821611155b1580156119445750604160f81b6001600160f81b03198216108015906119425750602d60f91b6001600160f81b0319821611155b155b80156119795750606160f81b6001600160f81b03198216108015906119775750603d60f91b6001600160f81b0319821611155b155b80156119935750600160fd1b6001600160f81b0319821614155b156119a5576000945050505050610b89565b91506119b28160016122e3565b9050611874565b506001949350505050565b600081565b6119d161230c565b6001600160a01b0316826001600160a01b03161415611a025760405162461bcd60e51b8152600401610caa9061432d565b8060086000611a0f61230c565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155611a5361230c565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611a8b919061405c565b60405180910390a35050565b611a9f61230c565b6001600160a01b0316611ab0611323565b6001600160a01b031614611ad65760405162461bcd60e51b8152600401610caa9061473c565b6001600160a01b038116611afc5760405162461bcd60e51b8152600401610caa90614aff565b601480546001600160a01b0319166001600160a01b0392909216919091179055565b611b2661230c565b6001600160a01b0316611b37611323565b6001600160a01b031614611b5d5760405162461bcd60e51b8152600401610caa9061473c565b6016546001600160a01b0316611b855760405162461bcd60e51b8152600401610caa9061439b565b601680546001600160a01b0319166001600160a01b0392909216919091179055565b601654600160a01b900460ff1681565b60135481565b7f000000000000000000000000727a4286a3b501eb90a6a8246c99188cf59ab02381565b611bf2611bec61230c565b836124d8565b611c0e5760405162461bcd60e51b8152600401610caa90614a0e565b611c1a848484846129b9565b50505050565b6000838383604051602001611c3793929190613ddf565b6040516020818303038152906040528051906020012090509392505050565b611c5e61230c565b6001600160a01b0316611c6f611323565b6001600160a01b031614611c955760405162461bcd60e51b8152600401610caa9061473c565b601680547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b831515021790556040517f9422424b175dda897495a07b091ef74a3ef715cf6d866fc972954c1c7f45930490611cf790839061405c565b60405180910390a150565b7fdbe1f638ff655f202dd9bfd93eac2cb9178070f9e7ea6af4d6eee532495f9c68611d2f81610ebb61230c565b60026001541415611d525760405162461bcd60e51b8152600401610caa90614ac8565b6002600155610e1083836123f0565b60026001541415611d845760405162461bcd60e51b8152600401610caa90614ac8565b6002600155611d92826111a1565b6001600160a01b0316336001600160a01b031614611dc25760405162461bcd60e51b8152600401610caa90614144565b611dcb81611777565b1515600114611dec5760405162461bcd60e51b8152600401610caa90614b36565b6000828152601a6020526040908190209051600291611e0a91613e25565b602060405180830381855afa158015611e27573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190611e4a9190613c1b565b600282604051611e5a9190613e09565b602060405180830381855afa158015611e77573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190611e9a9190613c1b565b1415611eb85760405162461bcd60e51b8152600401610caa90614912565b611ec181610e19565b15611ede5760405162461bcd60e51b8152600401610caa9061465c565b6000828152601a602052604081208054611ef790614ccf565b90501115611fa2576000828152601a602052604090208054611fa29190611f1d90614ccf565b80601f0160208091040260200160405190810160405280929190818152602001828054611f4990614ccf565b8015611f965780601f10611f6b57610100808354040283529160200191611f96565b820191906000526020600020905b815481529060010190602001808311611f7957829003601f168201915b505050505060006129ec565b611fad8160016129ec565b6000828152601a602090815260409091208251611fcc928401906138e4565b506000611ff06064611fea601e60155461229190919063ffffffff16565b90612a29565b9050611ffe33600083612a35565b6016546015546120259133916001600160a01b03909116906120209085612947565b612a35565b827f7e632a301794d8d4a81ea7e20f37d1947158d36e66403af04ba85dd194b66f1b83604051612055919061408e565b60405180910390a250506001805550565b6060610b8682612af3565b6017546000906113e89060016122e3565b61208a61230c565b6001600160a01b031661209b611323565b6001600160a01b0316146120c15760405162461bcd60e51b8152600401610caa9061473c565b60006120cb611332565b905060328111156120e6576120e13360326123f0565b6120f0565b6120f033826123f0565b50565b6120fc82610e8b565b61210881610ebb61230c565b610d6283836127e9565b60006113e86011546113e2601354610bda611332565b6018546000906113e89060016122e3565b6000908152600f602052604090205460ff1690565b7f526cc681c766655377276210dc2bb3de075795eb17ad3a4ad288c6b7d7cc4da1611d2f81610ebb61230c565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b6121b161230c565b6001600160a01b03166121c2611323565b6001600160a01b0316146121e85760405162461bcd60e51b8152600401610caa9061473c565b601354601155565b6121f861230c565b6001600160a01b0316612209611323565b6001600160a01b03161461222f5760405162461bcd60e51b8152600401610caa9061473c565b6001600160a01b0381166122555760405162461bcd60e51b8152600401610caa90614235565b6120f0816128ea565b60006001600160a01b0383166122748584612c0c565b6001600160a01b031614949350505050565b6000610b8682612c28565b600061229d8284614c56565b9392505050565b60006001600160e01b03198216637965db0b60e01b1480610b865750610b8682612c58565b60006122d482612c71565b80610b865750610b8682612cb1565b600061229d8284614c05565b6000908152600560205260409020546001600160a01b0316151590565b3390565b600081815260076020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612345826111a1565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b61238783612139565b156123a45760405162461bcd60e51b8152600401610caa90614955565b6123b76123b084612286565b838361225e565b6123d35760405162461bcd60e51b8152600401610caa906142b2565b50506000908152600f60205260409020805460ff19166001179055565b60328111156124115760405162461bcd60e51b8152600401610caa90614821565b612419611332565b8111156124385760405162461bcd60e51b8152600401610caa906147a8565b60125461244590826122e3565b601255600080612453612071565b905060005b8381101561248e57612468612071565b9250612472612cd6565b61247c858461299f565b6124878160016122e3565b9050612458565b50836001600160a01b03167f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f82856040516124ca929190614beb565b60405180910390a250505050565b60006124e3826122ef565b6124ff5760405162461bcd60e51b8152600401610caa90614414565b600061250a836111a1565b9050806001600160a01b0316846001600160a01b031614806125455750836001600160a01b031661253a84610c83565b6001600160a01b0316145b806125555750612555818561217b565b949350505050565b826001600160a01b0316612570826111a1565b6001600160a01b0316146125965760405162461bcd60e51b8152600401610caa90614858565b6001600160a01b0382166125bc5760405162461bcd60e51b8152600401610caa906142e9565b6125c7838383612ce9565b6125d2600082612310565b6001600160a01b03831660009081526006602052604081208054600192906125fb908490614c75565b90915550506001600160a01b0382166000908152600660205260408120805460019290612629908490614c05565b909155505060008181526005602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b61269482826113ed565b610fac576126ac816001600160a01b03166014612cf4565b6126b7836020612cf4565b6040516020016126c8929190613f23565b60408051601f198184030181529082905262461bcd60e51b8252610caa9160040161408e565b6126f882826113ed565b610fac5760008281526002602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561273161230c565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006127808261167e565b61279c5760405162461bcd60e51b8152600401610caa90614414565b6000828152601b602090815260409182902082516060810184528154808252600183015493820193909352600290910154928101929092526127e2576001915050610b89565b5192915050565b6127f382826113ed565b15610fac5760008281526002602090815260408083206001600160a01b03851684529091529020805460ff1916905561282a61230c565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6000826001600160a01b03168260405161288790613f20565b60006040518083038185875af1925050503d80600081146128c4576040519150601f19603f3d011682016040523d82523d6000602084013e6128c9565b606091505b5050905080610d625760405162461bcd60e51b8152600401610caa90614364565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610b86826001612291565b600061229d8284614c75565b6018546129619060016122e3565b601855565b33612970826111a1565b6001600160a01b0316146129965760405162461bcd60e51b8152600401610caa90614460565b6120f081612eb3565b610fac828260405180602001604052806000815250612ebc565b6129c484848461255d565b6129d084848484612eef565b611c1a5760405162461bcd60e51b8152600401610caa906141d8565b80600e6129f884611418565b604051612a059190613e09565b908152604051908190036020019020805491151560ff199092169190911790555050565b600061229d8284614c42565b6040516323b872dd60e01b81526001600160a01b037f000000000000000000000000f8e386eda857484f5a12e4b5daa9984e06e7370516906323b872dd90612a8590869086908690600401613fb8565b602060405180830381600087803b158015612a9f57600080fd5b505af1158015612ab3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ad79190613be7565b610d625760405162461bcd60e51b8152600401610caa9061498c565b6060612afe826122ef565b612b1a5760405162461bcd60e51b8152600401610caa90614693565b6000828152600d602052604081208054612b3390614ccf565b80601f0160208091040260200160405190810160405280929190818152602001828054612b5f90614ccf565b8015612bac5780601f10612b8157610100808354040283529160200191612bac565b820191906000526020600020905b815481529060010190602001808311612b8f57829003601f168201915b505050505090506000612bbd612fff565b9050805160001415612bd157509050610b89565b815115612c03578082604051602001612beb929190613ec0565b60405160208183030381529060405292505050610b89565b6125558461300e565b6000806000612c1b8585613090565b915091506110ff81613100565b600081604051602001612c3b9190613eef565b604051602081830303815290604052805190602001209050919050565b6001600160e01b031981166301ffc9a760e01b14919050565b60006001600160e01b031982166380ac58cd60e01b1480612ca257506001600160e01b03198216635b5e139f60e01b145b80610b865750610b86826122a4565b60006001600160e01b0319821663780e9d6360e01b1480610b865750610b8682612c71565b601754612ce49060016122e3565b601755565b610d6283838361322d565b60606000612d03836002614c56565b612d0e906002614c05565b67ffffffffffffffff811115612d3457634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612d5e576020820181803683370190505b509050600360fc1b81600081518110612d8757634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612dc457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000612de8846002614c56565b612df3906001614c05565b90505b6001811115612e94577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612e4257634e487b7160e01b600052603260045260246000fd5b1a60f81b828281518110612e6657634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c93612e8d81614cb8565b9050612df6565b50831561229d5760405162461bcd60e51b8152600401610caa906140d8565b6120f0816132b6565b612ec683836132f6565b612ed36000848484612eef565b610d625760405162461bcd60e51b8152600401610caa906141d8565b6000612f03846001600160a01b03166133d5565b156119b957836001600160a01b031663150b7a02612f1f61230c565b8786866040518563ffffffff1660e01b8152600401612f419493929190613fdc565b602060405180830381600087803b158015612f5b57600080fd5b505af1925050508015612f8b575060408051601f3d908101601f19168201909252612f8891810190613cc6565b60015b612fe5573d808015612fb9576040519150601f19603f3d011682016040523d82523d6000602084013e612fbe565b606091505b508051612fdd5760405162461bcd60e51b8152600401610caa906141d8565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612555565b606060198054610c0090614ccf565b6060613019826122ef565b6130355760405162461bcd60e51b8152600401610caa906148b5565b600061303f612fff565b9050600081511161305f576040518060200160405280600081525061229d565b80613069846133db565b60405160200161307a929190613ec0565b6040516020818303038152906040529392505050565b6000808251604114156130c75760208301516040840151606085015160001a6130bb878285856134f6565b945094505050506130f9565b8251604014156130f157602083015160408401516130e68683836135d6565b9350935050506130f9565b506000905060025b9250929050565b600081600481111561312257634e487b7160e01b600052602160045260246000fd5b141561312d576120f0565b600181600481111561314f57634e487b7160e01b600052602160045260246000fd5b141561316d5760405162461bcd60e51b8152600401610caa906140a1565b600281600481111561318f57634e487b7160e01b600052602160045260246000fd5b14156131ad5760405162461bcd60e51b8152600401610caa9061410d565b60038160048111156131cf57634e487b7160e01b600052602160045260246000fd5b14156131ed5760405162461bcd60e51b8152600401610caa906143d2565b600481600481111561320f57634e487b7160e01b600052602160045260246000fd5b14156120f05760405162461bcd60e51b8152600401610caa906145ae565b613238838383610d62565b6001600160a01b0383166132545761324f8161361e565b613277565b816001600160a01b0316836001600160a01b031614613277576132778382613662565b6001600160a01b0382166132935761328e816136ff565b610d62565b826001600160a01b0316826001600160a01b031614610d6257610d6282826137d8565b6132bf8161381c565b6000818152600d6020526040902080546132d890614ccf565b1590506120f0576000818152600d602052604081206120f091613968565b6001600160a01b03821661331c5760405162461bcd60e51b8152600401610caa90614627565b613325816122ef565b156133425760405162461bcd60e51b8152600401610caa9061427b565b61334e60008383612ce9565b6001600160a01b0382166000908152600660205260408120805460019290613377908490614c05565b909155505060008181526005602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b3b151590565b60608161340057506040805180820190915260018152600360fc1b6020820152610b89565b8160005b811561342a578061341481614d0a565b91506134239050600a83614c42565b9150613404565b60008167ffffffffffffffff81111561345357634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561347d576020820181803683370190505b5090505b841561255557613492600183614c75565b915061349f600a86614d25565b6134aa906030614c05565b60f81b8183815181106134cd57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506134ef600a86614c42565b9450613481565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561352d57506000905060036135cd565b8460ff16601b1415801561354557508460ff16601c14155b1561355657506000905060046135cd565b60006001878787876040516000815260200160405260405161357b9493929190614070565b6020604051602081039080840390855afa15801561359d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166135c6576000600192509250506135cd565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831660ff84901c601b01613610878288856134f6565b935093505050935093915050565b600b80546000838152600c60205260408120829055600182018355919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90155565b6000600161366f846111d6565b6136799190614c75565b6000838152600a60205260409020549091508082146136cc576001600160a01b03841660009081526009602090815260408083208584528252808320548484528184208190558352600a90915290208190555b506000918252600a602090815260408084208490556001600160a01b039094168352600981528383209183525290812055565b600b5460009061371190600190614c75565b6000838152600c6020526040812054600b805493945090928490811061374757634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080600b838154811061377657634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255828152600c9091526040808220849055858252812055600b8054806137bc57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006137e3836111d6565b6001600160a01b0390931660009081526009602090815260408083208684528252808320859055938252600a9052919091209190915550565b6000613827826111a1565b905061383581600084612ce9565b613840600083612310565b6001600160a01b0381166000908152600660205260408120805460019290613869908490614c75565b909155505060008281526005602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60405180606001604052806000815260200160008152602001600081525090565b8280546138f090614ccf565b90600052602060002090601f0160209004810192826139125760008555613958565b82601f1061392b57805160ff1916838001178555613958565b82800160010185558215613958579182015b8281111561395857825182559160200191906001019061393d565b506139649291506139a0565b5090565b50805461397490614ccf565b6000825580601f1061398657506120f0565b601f0160209004906000526020600020908101906120f091905b5b8082111561396457600081556001016139a1565b80356001600160a01b0381168114610b8957600080fd5b600082601f8301126139dc578081fd5b813567ffffffffffffffff808211156139f7576139f7614d65565b604051601f8301601f191681016020018281118282101715613a1b57613a1b614d65565b604052828152848301602001861015613a32578384fd5b82602086016020830137918201602001929092529392505050565b600060208284031215613a5e578081fd5b61229d826139b5565b60008060408385031215613a79578081fd5b613a82836139b5565b9150613a90602084016139b5565b90509250929050565b600080600060608486031215613aad578081fd5b613ab6846139b5565b9250613ac4602085016139b5565b9150604084013590509250925092565b60008060008060808587031215613ae9578081fd5b613af2856139b5565b9350613b00602086016139b5565b925060408501359150606085013567ffffffffffffffff811115613b22578182fd5b613b2e878288016139cc565b91505092959194509250565b60008060408385031215613b4c578182fd5b613b55836139b5565b91506020830135613b6581614d7b565b809150509250929050565b60008060408385031215613b82578182fd5b613b8b836139b5565b946020939093013593505050565b600080600060608486031215613bad578283fd5b613bb6846139b5565b95602085013595506040909401359392505050565b600060208284031215613bdc578081fd5b813561229d81614d7b565b600060208284031215613bf8578081fd5b815161229d81614d7b565b600060208284031215613c14578081fd5b5035919050565b600060208284031215613c2c578081fd5b5051919050565b60008060408385031215613c45578081fd5b82359150613a90602084016139b5565b600080600060608486031215613c69578081fd5b83359250613c79602085016139b5565b9150604084013567ffffffffffffffff811115613c94578182fd5b613ca0868287016139cc565b9150509250925092565b600060208284031215613cbb578081fd5b813561229d81614d89565b600060208284031215613cd7578081fd5b815161229d81614d89565b600060208284031215613cf3578081fd5b813567ffffffffffffffff811115613d09578182fd5b612555848285016139cc565b60008060408385031215613d27578182fd5b82359150602083013567ffffffffffffffff811115613d44578182fd5b613d50858286016139cc565b9150509250929050565b60008060408385031215613d6c578182fd5b50508035926020909101359150565b600080600060608486031215613d8f578081fd5b8335925060208401359150604084013567ffffffffffffffff811115613c94578182fd5b60008151808452613dcb816020860160208601614c8c565b601f01601f19169290920160200192915050565b60609390931b6bffffffffffffffffffffffff191683526014830191909152603482015260540190565b60008251613e1b818460208701614c8c565b9190910192915050565b8154600090819060028104600180831680613e4157607f831692505b6020808410821415613e6157634e487b7160e01b87526022600452602487fd5b818015613e755760018114613e8657613eb2565b60ff19861689528489019650613eb2565b613e8f8a614bf9565b885b86811015613eaa5781548b820152908501908301613e91565b505084890196505b509498975050505050505050565b60008351613ed2818460208801614c8c565b835190830190613ee6818360208801614c8c565b01949350505050565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b90565b60007f416363657373436f6e74726f6c3a206163636f756e742000000000000000000082528351613f5b816017850160208801614c8c565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351613f98816028840160208801614c8c565b01602801949350505050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60006001600160a01b0380871683528086166020840152508360408301526080606083015261400e6080830184613db3565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561405057835183529284019291840191600101614034565b50909695505050505050565b901515815260200190565b90815260200190565b93845260ff9290921660208401526040830152606082015260800190565b60006020825261229d6020830184613db3565b60208082526018908201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604082015260600190565b6020808252818101527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604082015260600190565b6020808252601f908201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604082015260600190565b6020808252601f908201527f4552433732313a2063616c6c6572206973206e6f7420746865206f776e657200604082015260600190565b6020808252602b908201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201527f74206f6620626f756e6473000000000000000000000000000000000000000000606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527f63656976657220696d706c656d656e7465720000000000000000000000000000606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526016908201527f7369676e6174757265206e6f7420766572696669656400000000000000000000604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b60208082526010908201527f5769746864726177206661696c75726500000000000000000000000000000000604082015260600190565b6020808252601a908201527f63616e6e6f742073657420746f207a65726f2061646472657373000000000000604082015260600190565b60208082526022908201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604082015261756560f01b606082015260800190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252601c908201527f73656e646572206973206e6f74206f776e6572206f6620746f6b656e00000000604082015260600190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560408201527f726f206164647265737300000000000000000000000000000000000000000000606082015260800190565b60208082526029908201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460408201527f656e7420746f6b656e0000000000000000000000000000000000000000000000606082015260800190565b60208082526022908201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604082015261756560f01b606082015260800190565b60208082526017908201527f7175616e746974792063616e6e6f74206265207a65726f000000000000000000604082015260600190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b60208082526015908201527f4e616d6520616c72656164792072657365727665640000000000000000000000604082015260600190565b60208082526031908201527f45524337323155524953746f726167653a2055524920717565727920666f722060408201527f6e6f6e6578697374656e7420746f6b656e000000000000000000000000000000606082015260800190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526015908201527f63616e6e6f7420736574207072696365207a65726f0000000000000000000000604082015260600190565b60208082526016908201527f4578636565647320617661696c61626c6520626f747300000000000000000000604082015260600190565b60208082526022908201527f6465666c6174696e6174696f6e206f6620746f6b656e73206172652070617573604082015261195960f21b606082015260800190565b6020808252601a908201527f45786365656473206d6178696d756d206d696e74206c696d6974000000000000604082015260600190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201527f73206e6f74206f776e0000000000000000000000000000000000000000000000606082015260800190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000606082015260800190565b60208082526023908201527f4e6577206e616d652069732073616d65206173207468652063757272656e74206040820152626f6e6560e81b606082015260800190565b60208082526012908201527f63616e6e6f7420636c61696d20616761696e0000000000000000000000000000604082015260600190565b60208082526021908201527f556e61626c6520746f207472616e7366657220496e646f72736520746f6b656e6040820152607360f81b606082015260800190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60408201527f776e6572206e6f7220617070726f766564000000000000000000000000000000606082015260800190565b6020808252602c908201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60408201527f7574206f6620626f756e64730000000000000000000000000000000000000000606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601a908201527f616464726573732063616e6e6f742073657420746f207a65726f000000000000604082015260600190565b60208082526014908201527f4e6f7420612076616c6964206e6577206e616d65000000000000000000000000604082015260600190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201527f20726f6c657320666f722073656c660000000000000000000000000000000000606082015260800190565b81518152602080830151908201526040918201519181019190915260600190565b918252602082015260400190565b60009081526020902090565b60008219821115614c1857614c18614d39565b500190565b600060ff821660ff84168060ff03821115614c3a57614c3a614d39565b019392505050565b600082614c5157614c51614d4f565b500490565b6000816000190483118215151615614c7057614c70614d39565b500290565b600082821015614c8757614c87614d39565b500390565b60005b83811015614ca7578181015183820152602001614c8f565b83811115611c1a5750506000910152565b600081614cc757614cc7614d39565b506000190190565b600281046001821680614ce357607f821691505b60208210811415614d0457634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415614d1e57614d1e614d39565b5060010190565b600082614d3457614d34614d4f565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146120f057600080fd5b6001600160e01b0319811681146120f057600080fdfea2646970667358221220040225074223ecf8c266dc0e0634415a92382f19007af7f28c5a61882963a35d64736f6c63430008000033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000727a4286a3b501eb90a6a8246c99188cf59ab023000000000000000000000000c4838ee142d9dd515ed0eb25efa9dad2dc5de3e4000000000000000000000000f8e386eda857484f5a12e4b5daa9984e06e737050000000000000000000000002429eb38cb9b456160937e11aefc80879a2d27120000000000000000000000002d1fc49838e9ac6e6bdbf5f784b15d028e5d19c70000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000001f68747470733a2f2f6170692e626c6f636b626f74732e67672f746f6b656e2f00
-----Decoded View---------------
Arg [0] : _mintPassAddress (address): 0x727a4286a3B501eB90A6A8246C99188cF59Ab023
Arg [1] : _changeNameProtocolFeeAddress (address): 0xC4838EE142d9dd515ed0eb25efa9dad2dC5de3e4
Arg [2] : _indorseTokenAddress (address): 0xf8e386EDa857484f5a12e4B5DAa9984E06E73705
Arg [3] : _redeemerAddress (address): 0x2429EB38cB9b456160937e11aefc80879a2d2712
Arg [4] : _bundleAddress (address): 0x2d1Fc49838e9AC6e6Bdbf5F784B15D028E5d19c7
Arg [5] : _nameChangePrice (uint256): 100000000000000000000
Arg [6] : _baseUri (string): https://api.blockbots.gg/token/
-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 000000000000000000000000727a4286a3b501eb90a6a8246c99188cf59ab023
Arg [1] : 000000000000000000000000c4838ee142d9dd515ed0eb25efa9dad2dc5de3e4
Arg [2] : 000000000000000000000000f8e386eda857484f5a12e4b5daa9984e06e73705
Arg [3] : 0000000000000000000000002429eb38cb9b456160937e11aefc80879a2d2712
Arg [4] : 0000000000000000000000002d1fc49838e9ac6e6bdbf5f784b15d028e5d19c7
Arg [5] : 0000000000000000000000000000000000000000000000056bc75e2d63100000
Arg [6] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [7] : 000000000000000000000000000000000000000000000000000000000000001f
Arg [8] : 68747470733a2f2f6170692e626c6f636b626f74732e67672f746f6b656e2f00
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.