ERC-721
Overview
Max Total Supply
198 1337ACH
Holders
197
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 1337ACHLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
Achievements
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 1337 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import "@0xsequence/sstore2/contracts/SSTORE2.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "solady/src/utils/LibString.sol"; import "solady/src/utils/Base64.sol"; import "./LeetCollectiveGuarded.sol"; import "./LeetERC721.sol"; /** * @title Claim your achievements within 1337 ecosystem * @author hoanh.eth * @author snjolfur.eth */ contract Achievements is ERC721L, LeetCollectiveGuarded { bool public isOpen; bool public useExternalURI; string public externalURI; using ECDSA for bytes32; address private _offchainSigner; mapping(bytes32 => bool) private _claimed; Achievement[] private _achievements; uint256[] private _tokens; error AlreadyClaimed(); error ClaimClosed(); error InvalidExternalURI(); error InvalidPayload(); error InvalidOffchainSigner(); error TraitsMustBePairs(); struct Achievement { address image; string name; string description; string[] traits; } constructor(string memory name, string memory symbol, address collective) ERC721L(name, symbol, "Achievements within the 1337 ecosystem") LeetCollectiveGuarded(collective) {} function toggleClaim() external serOrOwner { isOpen = !isOpen; } function toggleExternalURI() external serOrOwner { useExternalURI = !useExternalURI; } function setOffchainSigner(address addr) external serOrOwner { _offchainSigner = addr; } function setExternalURI(string memory url) external serOrOwner { externalURI = url; } function hasClaim(address addr, uint256 achievementID) public view returns (bool) { bytes32 msgHash = keccak256(abi.encodePacked(addr, achievementID)); return _claimed[msgHash]; } function add(bytes memory image, string memory name, string memory description, string[] calldata traits) public serOrOwner { if (traits.length % 2 != 0) revert TraitsMustBePairs(); Achievement memory achievement; achievement.image = SSTORE2.write(image); achievement.name = name; achievement.description = description; achievement.traits = traits; _achievements.push(achievement); } function change( uint256 achievementID, bytes calldata image, string calldata name, string calldata description, string[] calldata traits ) external serOrOwner { if (traits.length % 2 != 0) revert TraitsMustBePairs(); Achievement memory old = _achievements[achievementID]; bytes memory existing = SSTORE2.read(old.image); if (_isDifferent(existing, image)) { _achievements[achievementID].image = SSTORE2.write(image); } if (_isDifferent(bytes(old.name), bytes(name))) { _achievements[achievementID].name = name; } if (_isDifferent(bytes(old.description), bytes(description))) { _achievements[achievementID].description = description; } while (_achievements[achievementID].traits.length > traits.length) { // Remove traits from existing list if the new trait list is shorter _achievements[achievementID].traits.pop(); } uint256 i = 0; while (i < _achievements[achievementID].traits.length) { // Set the new keys and values if they changed of slots that already exist if (_isDifferent(bytes(_achievements[achievementID].traits[i]), bytes(traits[i]))) { _achievements[achievementID].traits[i] = traits[i]; } if (_isDifferent(bytes(_achievements[achievementID].traits[i + 1]), bytes(traits[i + 1]))) { _achievements[achievementID].traits[i + 1] = traits[i + 1]; } i = i + 2; } while (i < traits.length) { // Add new traits if the new trait list is longer _achievements[achievementID].traits.push(traits[i]); _achievements[achievementID].traits.push(traits[i + 1]); i = i + 2; } } function _isDifferent(bytes memory a, bytes memory b) internal pure returns (bool) { return a.length != b.length || keccak256(a) != keccak256(b); } function achievementsCount() external view returns (uint256) { return _achievements.length; } function getAchievements(uint256 offset, uint256 count) external view returns (string memory) { if (offset >= _achievements.length) revert IndexOutOfBounds(); if (offset + count > _achievements.length) revert IndexOutOfBounds(); string memory json = "["; string memory image; string memory attributes; uint256 j; uint256 i = offset; unchecked { uint256 end = offset + count; while (i < end) { Achievement memory achievement = _achievements[i]; image = _getImage(achievement.image); attributes = ""; j = 0; while (j < achievement.traits.length) { if (keccak256(abi.encodePacked(achievement.traits[j])) != keccak256(abi.encodePacked(""))) { attributes = string.concat( attributes, _buildMetadata(achievement.traits[j], achievement.traits[j + 1]), "," ); } j = j + 2; } attributes = string.concat(attributes, _buildMetadata("name", achievement.name)); string memory achievementJson = string.concat( '{"name": "', achievement.name, '", "id":', LibString.toString(i), ', "description":"', achievement.description, '","image":"data:image/svg+xml;base64,', image, '","attributes": [', attributes, "]}" ); json = string.concat(json, achievementJson); if (i != end - 1) { json = string.concat(json, ","); } ++i; } } json = string.concat(json, "]"); return json; } function claim(uint256 achievementID, bytes memory signature) public { if (!isOpen) revert ClaimClosed(); if (!_isValidPayload(achievementID, signature)) revert InvalidPayload(); if (_achievements.length <= achievementID) revert IndexOutOfBounds(); bytes32 msgHash = keccak256(abi.encodePacked(msg.sender, achievementID)); if (_claimed[msgHash]) revert AlreadyClaimed(); _claimed[msgHash] = true; _tokens.push(achievementID); _mint(msg.sender); } function tokenURI(uint256 tokenID) public view virtual override(IERC721Metadata) returns (string memory) { if (!_exists(tokenID)) revert TokenDoesNotExist(); Achievement memory achievement = _achievements[_tokens[tokenID]]; string memory image = _getImage(achievement.image); string memory animationURL = string.concat('"data:image/svg+xml;base64,', image, '",'); if (useExternalURI) { if (bytes(externalURI).length == 0) revert InvalidExternalURI(); animationURL = string.concat('"', externalURI, LibString.toString(tokenID), '",'); } string memory attributes = ""; uint256 i = 0; while (i < achievement.traits.length) { if (keccak256(abi.encodePacked(achievement.traits[i])) != keccak256(abi.encodePacked(""))) { attributes = string.concat(attributes, _buildMetadata(achievement.traits[i], achievement.traits[i + 1]), ","); } i = i + 2; } attributes = string.concat(attributes, _buildMetadata("name", achievement.name)); bytes memory json = abi.encodePacked( '{"name": "', achievement.name, '", "description":"', achievement.description, '","image":"data:image/svg+xml;base64,', image, '","animation_url":', animationURL, '"attributes": [', attributes, "]}" ); return string(abi.encodePacked("data:application/json,", json)); } function _getImage(address image) internal view returns (string memory) { return Base64.encode( abi.encodePacked( '<svg width="100%" height="100%" viewBox="0 0 20000 20000" xmlns="http://www.w3.org/2000/svg">', "<style>svg{background-color:transparent;background-image:url(data:image/png;base64,", Base64.encode(SSTORE2.read(image)), ");background-repeat:no-repeat;background-size:contain;background-position:center;image-rendering:-webkit-optimize-contrast;-ms-interpolation-mode:nearest-neighbor;image-rendering:-moz-crisp-edges;image-rendering:pixelated;}</style></svg>" ) ); } function _isValidPayload(uint256 tokenID, bytes memory signature) internal view returns (bool) { if (_offchainSigner == address(0)) { revert InvalidOffchainSigner(); } bytes32 msgHash = keccak256(abi.encodePacked(msg.sender, tokenID)); bytes32 signedHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", msgHash)); return signedHash.recover(signature) == _offchainSigner; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./utils/Bytecode.sol"; /** @title A key-value storage with auto-generated keys for storing chunks of data with a lower write & read cost. @author Agustin Aguilar <[email protected]> Readme: https://github.com/0xsequence/sstore2#readme */ library SSTORE2 { error WriteError(); /** @notice Stores `_data` and returns `pointer` as key for later retrieval @dev The pointer is a contract address with `_data` as code @param _data to be written @return pointer Pointer to the written `_data` */ function write(bytes memory _data) internal returns (address pointer) { // Append 00 to _data so contract can't be called // Build init code bytes memory code = Bytecode.creationCodeFor( abi.encodePacked( hex'00', _data ) ); // Deploy contract using create assembly { pointer := create(0, add(code, 32), mload(code)) } // Address MUST be non-zero if (pointer == address(0)) revert WriteError(); } /** @notice Reads the contents of the `_pointer` code as data, skips the first byte @dev The function is intended for reading pointers generated by `write` @param _pointer to be read @return data read from `_pointer` contract */ function read(address _pointer) internal view returns (bytes memory) { return Bytecode.codeAt(_pointer, 1, type(uint256).max); } /** @notice Reads the contents of the `_pointer` code as data, skips the first byte @dev The function is intended for reading pointers generated by `write` @param _pointer to be read @param _start number of bytes to skip @return data read from `_pointer` contract */ function read(address _pointer, uint256 _start) internal view returns (bytes memory) { return Bytecode.codeAt(_pointer, _start + 1, type(uint256).max); } /** @notice Reads the contents of the `_pointer` code as data, skips the first byte @dev The function is intended for reading pointers generated by `write` @param _pointer to be read @param _start number of bytes to skip @param _end index before which to end extraction @return data read from `_pointer` contract */ function read(address _pointer, uint256 _start, uint256 _end) internal view returns (bytes memory) { return Bytecode.codeAt(_pointer, _start + 1, _end + 1); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library Bytecode { error InvalidCodeAtRange(uint256 _size, uint256 _start, uint256 _end); /** @notice Generate a creation code that results on a contract with `_code` as bytecode @param _code The returning value of the resulting `creationCode` @return creationCode (constructor) for new contract */ function creationCodeFor(bytes memory _code) internal pure returns (bytes memory) { /* 0x00 0x63 0x63XXXXXX PUSH4 _code.length size 0x01 0x80 0x80 DUP1 size size 0x02 0x60 0x600e PUSH1 14 14 size size 0x03 0x60 0x6000 PUSH1 00 0 14 size size 0x04 0x39 0x39 CODECOPY size 0x05 0x60 0x6000 PUSH1 00 0 size 0x06 0xf3 0xf3 RETURN <CODE> */ return abi.encodePacked( hex"63", uint32(_code.length), hex"80_60_0E_60_00_39_60_00_F3", _code ); } /** @notice Returns the size of the code on a given address @param _addr Address that may or may not contain code @return size of the code on the given `_addr` */ function codeSize(address _addr) internal view returns (uint256 size) { assembly { size := extcodesize(_addr) } } /** @notice Returns the code of a given address @dev It will fail if `_end < _start` @param _addr Address that may or may not contain code @param _start number of bytes of code to skip on read @param _end index before which to end extraction @return oCode read from `_addr` deployed bytecode Forked from: https://gist.github.com/KardanovIR/fe98661df9338c842b4a30306d507fbd */ function codeAt(address _addr, uint256 _start, uint256 _end) internal view returns (bytes memory oCode) { uint256 csize = codeSize(_addr); if (csize == 0) return bytes(""); if (_start > csize) return bytes(""); if (_end < _start) revert InvalidCodeAtRange(csize, _start, _end); unchecked { uint256 reqSize = _end - _start; uint256 maxSize = csize - _start; uint256 size = maxSize < reqSize ? maxSize : reqSize; assembly { // allocate output byte array - this could also be done without assembly // by using o_code = new bytes(size) oCode := mload(0x40) // new "memory end" including padding mstore(0x40, add(oCode, and(add(add(size, 0x20), 0x1f), not(0x1f)))) // store length in memory mstore(oCode, size) // actually retrieve the code, this needs assembly extcodecopy(_addr, add(oCode, 0x20), _start, size) } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) 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); /** * @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 // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @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 // Deprecated in v4.8 } 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"); } } /** * @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) { 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. /// @solidity memory-safe-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 { 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 = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 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 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 message) { // 32 is the length in bytes of hash, // enforced by the type signature above /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") mstore(0x1c, hash) message := keccak256(0x00, 0x3c) } } /** * @dev Returns an Ethereum Signed Message, created from `s`. 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(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @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 data) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, "\x19\x01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) data := keccak256(ptr, 0x42) } } /** * @dev Returns an Ethereum Signed Data with intended validator, created from a * `validator` and `data` according to the version 0 of EIP-191. * * See {recover}. */ function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x00", validator, data)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.20; interface ILeetCollective { function nameOf(address member) external view returns (string memory); function roleOf(address member) external view returns (uint16); function roleNameOf(address member) external view returns (string memory); }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.20; import {ILeetCollective} from "./ILeetCollective.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; abstract contract LeetCollectiveGuarded is Ownable { ILeetCollective internal _collective; error Unauthorized(); constructor(address collective) { _collective = ILeetCollective(collective); } function leetCollectiveAddress() public view returns (address) { return address(_collective); } function setLeetCollective(address collective) external serOrOwner { _collective = ILeetCollective(collective); } modifier serOrOwner() { uint16 role = _collective.roleOf(msg.sender); if (role != 532 && owner() != msg.sender) revert Unauthorized(); _; } modifier onlySer() { uint16 role = _collective.roleOf(msg.sender); if (role != 532) revert Unauthorized(); _; } modifier serOrForce() { uint16 role = _collective.roleOf(msg.sender); if (role != 532 && role != 1337) revert Unauthorized(); _; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import {IERC721Metadata} from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import {IERC721Enumerable} from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; import {IERC165, ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol"; abstract contract ERC721L is ERC165, IERC721, IERC721Metadata, IERC721Enumerable { // ============================================================= // Fields // ============================================================= string private _name; string private _description; string private _symbol; // Mapping from token ID to owner address address[] internal _owners; mapping(uint256 => address) private _tokenApprovals; mapping(address => mapping(address => bool)) private _operatorApprovals; // ============================================================= // Errors // ============================================================= error TokenDoesNotExist(); error TokenAlreadyMinted(); error NotAllowedToMint(); error NotTokenOwnerNorApproved(); error NotTokenOwner(); error TokenOwner(); error ZeroAddressInvalidArgument(); error NotAllowedToApprove(); error IndexOutOfBounds(); error TransferToNonERC721Receiver(); constructor(string memory name_, string memory symbol_, string memory description_) { _name = name_; _description = description_; _symbol = symbol_; } // ============================================================= // Opensea // ============================================================= function contractURI() public view returns (string memory) { string memory json = string.concat('{"name": "', _name, '","description":"', _description, '"}'); return string.concat("data:application/json;utf8,", json); } // ============================================================= // IERC721 // ============================================================= function balanceOf(address owner) public view virtual override returns (uint256) { if (owner == address(0)) revert ZeroAddressInvalidArgument(); uint256 count; uint256 i; do { if (owner == _owners[i]) ++count; ++i; } while (i < _owners.length); return count; } function ownerOf(uint256 tokenId) public view virtual override returns (address) { if (_owners.length <= tokenId) revert TokenDoesNotExist(); address owner = _owners[tokenId]; if (owner == address(0)) revert TokenDoesNotExist(); return owner; } function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override { _checkApprovedOrOwner(tokenId); ERC721L.transferFrom(from, to, tokenId); // Check that `to` is an ERC721Receiver if it is a contract uint256 size; assembly { // This opcode returns the size of the code on an address. // It is 0 for external accounts (non-contracts) size := extcodesize(to) } if (size > 0) { try IERC721Receiver(to).onERC721Received(msg.sender, from, tokenId, _data) returns (bytes4 retval) { if (retval != IERC721Receiver.onERC721Received.selector) { revert TransferToNonERC721Receiver(); } } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721Receiver(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } } function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override { safeTransferFrom(from, to, tokenId, ""); } function transferFrom(address from, address to, uint256 tokenId) public virtual override { _checkApprovedOrOwner(tokenId); if (_owners[tokenId] != from) revert NotTokenOwner(); if (to == address(0)) revert ZeroAddressInvalidArgument(); // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } function approve(address to, uint256 tokenId) public virtual override { address owner = _owners[tokenId]; if (owner == to) revert TokenOwner(); if (msg.sender != owner && !isApprovedForAll(owner, msg.sender)) { revert NotTokenOwnerNorApproved(); } _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); } function setApprovalForAll(address operator, bool approved) public virtual override { if (operator == msg.sender) revert NotAllowedToApprove(); _operatorApprovals[msg.sender][operator] = approved; emit ApprovalForAll(msg.sender, operator, approved); } function getApproved(uint256 tokenId) public view virtual override returns (address) { if (_owners[tokenId] == address(0)) revert TokenDoesNotExist(); return _tokenApprovals[tokenId]; } function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } // ============================================================= // IERC165 // ============================================================= function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } // ============================================================= // IERC721Metadata // ============================================================= function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } // ============================================================= // IERC721Enumerable // ============================================================= function totalSupply() public view virtual override returns (uint256) { return _owners.length; } function tokenByIndex(uint256 index) public view virtual override returns (uint256) { if (index >= _owners.length) revert IndexOutOfBounds(); return index; } function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256 tokenId) { if (index >= _owners.length) revert IndexOutOfBounds(); uint256 count; uint256 i; do { if (owner == _owners[i]) { if (count == index) return i; ++count; } ++i; } while (i < _owners.length); revert IndexOutOfBounds(); } // ============================================================= // Internal // ============================================================= function _exists(uint256 tokenId) internal view virtual returns (bool) { return tokenId < _owners.length && _owners[tokenId] != address(0); } function _checkApprovedOrOwner(uint256 tokenId) internal view virtual { address owner = ERC721L.ownerOf(tokenId); if (!(msg.sender == owner || getApproved(tokenId) == msg.sender || isApprovedForAll(owner, msg.sender))) { revert NotTokenOwnerNorApproved(); } } /* * @notice Add a new token without minting it */ function _add() internal virtual { _owners.push(); } function _mint(address to) internal virtual returns (uint256 tokenId) { if (to == address(0)) revert ZeroAddressInvalidArgument(); tokenId = _owners.length; _owners.push(to); emit Transfer(address(0), to, tokenId); } function _mintToken(address to, uint256 tokenId) internal virtual { if (to == address(0)) revert ZeroAddressInvalidArgument(); if (_owners.length <= tokenId) revert TokenDoesNotExist(); if (_owners[tokenId] != address(0)) revert TokenAlreadyMinted(); _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } function _burn(uint256 tokenId) internal virtual { address owner = _owners[tokenId]; delete _tokenApprovals[tokenId]; _owners[tokenId] = address(0); emit Transfer(owner, address(0), tokenId); } function _buildMetadata(string memory key, string memory value) internal pure returns (string memory trait) { return string.concat('{"trait_type":"', key, '","value": "', value, '"}'); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Library to encode strings in Base64. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/Base64.sol) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/Base64.sol) /// @author Modified from (https://github.com/Brechtpd/base64/blob/main/base64.sol) by Brecht Devos - <[email protected]>. library Base64 { /// @dev Encodes `data` using the base64 encoding described in RFC 4648. /// See: https://datatracker.ietf.org/doc/html/rfc4648 /// @param fileSafe Whether to replace '+' with '-' and '/' with '_'. /// @param noPadding Whether to strip away the padding. function encode(bytes memory data, bool fileSafe, bool noPadding) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let dataLength := mload(data) if dataLength { // Multiply by 4/3 rounded up. // The `shl(2, ...)` is equivalent to multiplying by 4. let encodedLength := shl(2, div(add(dataLength, 2), 3)) // Set `result` to point to the start of the free memory. result := mload(0x40) // Store the table into the scratch space. // Offsetted by -1 byte so that the `mload` will load the character. // We will rewrite the free memory pointer at `0x40` later with // the allocated size. // The magic constant 0x0670 will turn "-_" into "+/". mstore(0x1f, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef") mstore(0x3f, xor("ghijklmnopqrstuvwxyz0123456789-_", mul(iszero(fileSafe), 0x0670))) // Skip the first slot, which stores the length. let ptr := add(result, 0x20) let end := add(ptr, encodedLength) // Run over the input, 3 bytes at a time. for {} 1 {} { data := add(data, 3) // Advance 3 bytes. let input := mload(data) // Write 4 bytes. Optimized for fewer stack operations. mstore8(0, mload(and(shr(18, input), 0x3F))) mstore8(1, mload(and(shr(12, input), 0x3F))) mstore8(2, mload(and(shr(6, input), 0x3F))) mstore8(3, mload(and(input, 0x3F))) mstore(ptr, mload(0x00)) ptr := add(ptr, 4) // Advance 4 bytes. if iszero(lt(ptr, end)) { break } } mstore(0x40, add(end, 0x20)) // Allocate the memory. // Equivalent to `o = [0, 2, 1][dataLength % 3]`. let o := div(2, mod(dataLength, 3)) // Offset `ptr` and pad with '='. We can simply write over the end. mstore(sub(ptr, o), shl(240, 0x3d3d)) // Set `o` to zero if there is padding. o := mul(iszero(iszero(noPadding)), o) mstore(sub(ptr, o), 0) // Zeroize the slot after the string. mstore(result, sub(encodedLength, o)) // Store the length. } } } /// @dev Encodes `data` using the base64 encoding described in RFC 4648. /// Equivalent to `encode(data, false, false)`. function encode(bytes memory data) internal pure returns (string memory result) { result = encode(data, false, false); } /// @dev Encodes `data` using the base64 encoding described in RFC 4648. /// Equivalent to `encode(data, fileSafe, false)`. function encode(bytes memory data, bool fileSafe) internal pure returns (string memory result) { result = encode(data, fileSafe, false); } /// @dev Decodes base64 encoded `data`. /// /// Supports: /// - RFC 4648 (both standard and file-safe mode). /// - RFC 3501 (63: ','). /// /// Does not support: /// - Line breaks. /// /// Note: For performance reasons, /// this function will NOT revert on invalid `data` inputs. /// Outputs for invalid inputs will simply be undefined behaviour. /// It is the user's responsibility to ensure that the `data` /// is a valid base64 encoded string. function decode(string memory data) internal pure returns (bytes memory result) { /// @solidity memory-safe-assembly assembly { let dataLength := mload(data) if dataLength { let decodedLength := mul(shr(2, dataLength), 3) for {} 1 {} { // If padded. if iszero(and(dataLength, 3)) { let t := xor(mload(add(data, dataLength)), 0x3d3d) // forgefmt: disable-next-item decodedLength := sub( decodedLength, add(iszero(byte(30, t)), iszero(byte(31, t))) ) break } // If non-padded. decodedLength := add(decodedLength, sub(and(dataLength, 3), 1)) break } result := mload(0x40) // Write the length of the bytes. mstore(result, decodedLength) // Skip the first slot, which stores the length. let ptr := add(result, 0x20) let end := add(ptr, decodedLength) // Load the table into the scratch space. // Constants are optimized for smaller bytecode with zero gas overhead. // `m` also doubles as the mask of the upper 6 bits. let m := 0xfc000000fc00686c7074787c8084888c9094989ca0a4a8acb0b4b8bcc0c4c8cc mstore(0x5b, m) mstore(0x3b, 0x04080c1014181c2024282c3034383c4044484c5054585c6064) mstore(0x1a, 0xf8fcf800fcd0d4d8dce0e4e8ecf0f4) for {} 1 {} { // Read 4 bytes. data := add(data, 4) let input := mload(data) // Write 3 bytes. // forgefmt: disable-next-item mstore(ptr, or( and(m, mload(byte(28, input))), shr(6, or( and(m, mload(byte(29, input))), shr(6, or( and(m, mload(byte(30, input))), shr(6, mload(byte(31, input))) )) )) )) ptr := add(ptr, 3) if iszero(lt(ptr, end)) { break } } mstore(0x40, add(end, 0x20)) // Allocate the memory. mstore(end, 0) // Zeroize the slot after the bytes. mstore(0x60, 0) // Restore the zero slot. } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Library for converting numbers into strings and other string operations. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibString.sol) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/LibString.sol) library LibString { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The `length` of the output is too small to contain all the hex digits. error HexLengthInsufficient(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CONSTANTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The constant returned when the `search` is not found in the string. uint256 internal constant NOT_FOUND = type(uint256).max; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* DECIMAL OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the base 10 decimal representation of `value`. function toString(uint256 value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. str := add(mload(0x40), 0x80) // Update the free memory pointer to allocate. mstore(0x40, add(str, 0x20)) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str let w := not(0) // Tsk. // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let temp := value } 1 {} { str := add(str, w) // `sub(str, 1)`. // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } /// @dev Returns the base 10 decimal representation of `value`. function toString(int256 value) internal pure returns (string memory str) { if (value >= 0) { return toString(uint256(value)); } unchecked { str = toString(uint256(-value)); } /// @solidity memory-safe-assembly assembly { // We still have some spare memory space on the left, // as we have allocated 3 words (96 bytes) for up to 78 digits. let length := mload(str) // Load the string length. mstore(str, 0x2d) // Store the '-' character. str := sub(str, 1) // Move back the string pointer by a byte. mstore(str, add(length, 1)) // Update the string length. } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* HEXADECIMAL OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the hexadecimal representation of `value`, /// left-padded to an input length of `length` bytes. /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte, /// giving a total length of `length * 2 + 2` bytes. /// Reverts if `length` is too small for the output to contain all the digits. function toHexString(uint256 value, uint256 length) internal pure returns (string memory str) { str = toHexStringNoPrefix(value, length); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`, /// left-padded to an input length of `length` bytes. /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte, /// giving a total length of `length * 2` bytes. /// Reverts if `length` is too small for the output to contain all the digits. function toHexStringNoPrefix(uint256 value, uint256 length) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { // We need 0x20 bytes for the trailing zeros padding, `length * 2` bytes // for the digits, 0x02 bytes for the prefix, and 0x20 bytes for the length. // We add 0x20 to the total and round down to a multiple of 0x20. // (0x20 + 0x20 + 0x02 + 0x20) = 0x62. str := add(mload(0x40), and(add(shl(1, length), 0x42), not(0x1f))) // Allocate the memory. mstore(0x40, add(str, 0x20)) // Zeroize the slot after the string. mstore(str, 0) // Cache the end to calculate the length later. let end := str // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let start := sub(str, add(length, length)) let w := not(1) // Tsk. let temp := value // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for {} 1 {} { str := add(str, w) // `sub(str, 2)`. mstore8(add(str, 1), mload(and(temp, 15))) mstore8(str, mload(and(shr(4, temp), 15))) temp := shr(8, temp) if iszero(xor(str, start)) { break } } if temp { // Store the function selector of `HexLengthInsufficient()`. mstore(0x00, 0x2194895a) // Revert with (offset, size). revert(0x1c, 0x04) } // Compute the string's length. let strLength := sub(end, str) // Move the pointer and write the length. str := sub(str, 0x20) mstore(str, strLength) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte. /// As address are 20 bytes long, the output will left-padded to have /// a length of `20 * 2 + 2` bytes. function toHexString(uint256 value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x". /// The output excludes leading "0" from the `toHexString` output. /// `0x00: "0x0", 0x01: "0x1", 0x12: "0x12", 0x123: "0x123"`. function toMinimalHexString(uint256 value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let o := eq(byte(0, mload(add(str, 0x20))), 0x30) // Whether leading zero is present. let strLength := add(mload(str), 2) // Compute the length. mstore(add(str, o), 0x3078) // Write the "0x" prefix, accounting for leading zero. str := sub(add(str, o), 2) // Move the pointer, accounting for leading zero. mstore(str, sub(strLength, o)) // Write the length, accounting for leading zero. } } /// @dev Returns the hexadecimal representation of `value`. /// The output excludes leading "0" from the `toHexStringNoPrefix` output. /// `0x00: "0", 0x01: "1", 0x12: "12", 0x123: "123"`. function toMinimalHexStringNoPrefix(uint256 value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let o := eq(byte(0, mload(add(str, 0x20))), 0x30) // Whether leading zero is present. let strLength := mload(str) // Get the length. str := add(str, o) // Move the pointer, accounting for leading zero. mstore(str, sub(strLength, o)) // Write the length, accounting for leading zero. } } /// @dev Returns the hexadecimal representation of `value`. /// The output is encoded using 2 hexadecimal digits per byte. /// As address are 20 bytes long, the output will left-padded to have /// a length of `20 * 2` bytes. function toHexStringNoPrefix(uint256 value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length, // 0x02 bytes for the prefix, and 0x40 bytes for the digits. // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x40) is 0xa0. str := add(mload(0x40), 0x80) // Allocate the memory. mstore(0x40, add(str, 0x20)) // Zeroize the slot after the string. mstore(str, 0) // Cache the end to calculate the length later. let end := str // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let w := not(1) // Tsk. // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let temp := value } 1 {} { str := add(str, w) // `sub(str, 2)`. mstore8(add(str, 1), mload(and(temp, 15))) mstore8(str, mload(and(shr(4, temp), 15))) temp := shr(8, temp) if iszero(temp) { break } } // Compute the string's length. let strLength := sub(end, str) // Move the pointer and write the length. str := sub(str, 0x20) mstore(str, strLength) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x", encoded using 2 hexadecimal digits per byte, /// and the alphabets are capitalized conditionally according to /// https://eips.ethereum.org/EIPS/eip-55 function toHexStringChecksummed(address value) internal pure returns (string memory str) { str = toHexString(value); /// @solidity memory-safe-assembly assembly { let mask := shl(6, div(not(0), 255)) // `0b010000000100000000 ...` let o := add(str, 0x22) let hashed := and(keccak256(o, 40), mul(34, mask)) // `0b10001000 ... ` let t := shl(240, 136) // `0b10001000 << 240` for { let i := 0 } 1 {} { mstore(add(i, i), mul(t, byte(i, hashed))) i := add(i, 1) if eq(i, 20) { break } } mstore(o, xor(mload(o), shr(1, and(mload(0x00), and(mload(o), mask))))) o := add(o, 0x20) mstore(o, xor(mload(o), shr(1, and(mload(0x20), and(mload(o), mask))))) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte. function toHexString(address value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`. /// The output is encoded using 2 hexadecimal digits per byte. function toHexStringNoPrefix(address value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { str := mload(0x40) // Allocate the memory. // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length, // 0x02 bytes for the prefix, and 0x28 bytes for the digits. // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x28) is 0x80. mstore(0x40, add(str, 0x80)) // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) str := add(str, 2) mstore(str, 40) let o := add(str, 0x20) mstore(add(o, 40), 0) value := shl(96, value) // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let i := 0 } 1 {} { let p := add(o, add(i, i)) let temp := byte(i, value) mstore8(add(p, 1), mload(and(temp, 15))) mstore8(p, mload(shr(4, temp))) i := add(i, 1) if eq(i, 20) { break } } } } /// @dev Returns the hex encoded string from the raw bytes. /// The output is encoded using 2 hexadecimal digits per byte. function toHexString(bytes memory raw) internal pure returns (string memory str) { str = toHexStringNoPrefix(raw); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hex encoded string from the raw bytes. /// The output is encoded using 2 hexadecimal digits per byte. function toHexStringNoPrefix(bytes memory raw) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { let length := mload(raw) str := add(mload(0x40), 2) // Skip 2 bytes for the optional prefix. mstore(str, add(length, length)) // Store the length of the output. // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let o := add(str, 0x20) let end := add(raw, length) for {} iszero(eq(raw, end)) {} { raw := add(raw, 1) mstore8(add(o, 1), mload(and(mload(raw), 15))) mstore8(o, mload(and(shr(4, mload(raw)), 15))) o := add(o, 2) } mstore(o, 0) // Zeroize the slot after the string. mstore(0x40, add(o, 0x20)) // Allocate the memory. } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* RUNE STRING OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the number of UTF characters in the string. function runeCount(string memory s) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { if mload(s) { mstore(0x00, div(not(0), 255)) mstore(0x20, 0x0202020202020202020202020202020202020202020202020303030304040506) let o := add(s, 0x20) let end := add(o, mload(s)) for { result := 1 } 1 { result := add(result, 1) } { o := add(o, byte(0, mload(shr(250, mload(o))))) if iszero(lt(o, end)) { break } } } } } /// @dev Returns if this string is a 7-bit ASCII string. /// (i.e. all characters codes are in [0..127]) function is7BitASCII(string memory s) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { let mask := shl(7, div(not(0), 255)) result := 1 let n := mload(s) if n { let o := add(s, 0x20) let end := add(o, n) let last := mload(end) mstore(end, 0) for {} 1 {} { if and(mask, mload(o)) { result := 0 break } o := add(o, 0x20) if iszero(lt(o, end)) { break } } mstore(end, last) } } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* BYTE STRING OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ // For performance and bytecode compactness, all indices of the following operations // are byte (ASCII) offsets, not UTF character offsets. /// @dev Returns `subject` all occurrences of `search` replaced with `replacement`. function replace(string memory subject, string memory search, string memory replacement) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) let searchLength := mload(search) let replacementLength := mload(replacement) subject := add(subject, 0x20) search := add(search, 0x20) replacement := add(replacement, 0x20) result := add(mload(0x40), 0x20) let subjectEnd := add(subject, subjectLength) if iszero(gt(searchLength, subjectLength)) { let subjectSearchEnd := add(sub(subjectEnd, searchLength), 1) let h := 0 if iszero(lt(searchLength, 0x20)) { h := keccak256(search, searchLength) } let m := shl(3, sub(0x20, and(searchLength, 0x1f))) let s := mload(search) for {} 1 {} { let t := mload(subject) // Whether the first `searchLength % 32` bytes of // `subject` and `search` matches. if iszero(shr(m, xor(t, s))) { if h { if iszero(eq(keccak256(subject, searchLength), h)) { mstore(result, t) result := add(result, 1) subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } continue } } // Copy the `replacement` one word at a time. for { let o := 0 } 1 {} { mstore(add(result, o), mload(add(replacement, o))) o := add(o, 0x20) if iszero(lt(o, replacementLength)) { break } } result := add(result, replacementLength) subject := add(subject, searchLength) if searchLength { if iszero(lt(subject, subjectSearchEnd)) { break } continue } } mstore(result, t) result := add(result, 1) subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } } } let resultRemainder := result result := add(mload(0x40), 0x20) let k := add(sub(resultRemainder, result), sub(subjectEnd, subject)) // Copy the rest of the string one word at a time. for {} lt(subject, subjectEnd) {} { mstore(resultRemainder, mload(subject)) resultRemainder := add(resultRemainder, 0x20) subject := add(subject, 0x20) } result := sub(result, 0x20) let last := add(add(result, 0x20), k) // Zeroize the slot after the string. mstore(last, 0) mstore(0x40, add(last, 0x20)) // Allocate the memory. mstore(result, k) // Store the length. } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from left to right, starting from `from`. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function indexOf(string memory subject, string memory search, uint256 from) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { for { let subjectLength := mload(subject) } 1 {} { if iszero(mload(search)) { if iszero(gt(from, subjectLength)) { result := from break } result := subjectLength break } let searchLength := mload(search) let subjectStart := add(subject, 0x20) result := not(0) // Initialize to `NOT_FOUND`. subject := add(subjectStart, from) let end := add(sub(add(subjectStart, subjectLength), searchLength), 1) let m := shl(3, sub(0x20, and(searchLength, 0x1f))) let s := mload(add(search, 0x20)) if iszero(and(lt(subject, end), lt(from, subjectLength))) { break } if iszero(lt(searchLength, 0x20)) { for { let h := keccak256(add(search, 0x20), searchLength) } 1 {} { if iszero(shr(m, xor(mload(subject), s))) { if eq(keccak256(subject, searchLength), h) { result := sub(subject, subjectStart) break } } subject := add(subject, 1) if iszero(lt(subject, end)) { break } } break } for {} 1 {} { if iszero(shr(m, xor(mload(subject), s))) { result := sub(subject, subjectStart) break } subject := add(subject, 1) if iszero(lt(subject, end)) { break } } break } } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from left to right. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function indexOf(string memory subject, string memory search) internal pure returns (uint256 result) { result = indexOf(subject, search, 0); } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from right to left, starting from `from`. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function lastIndexOf(string memory subject, string memory search, uint256 from) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { for {} 1 {} { result := not(0) // Initialize to `NOT_FOUND`. let searchLength := mload(search) if gt(searchLength, mload(subject)) { break } let w := result let fromMax := sub(mload(subject), searchLength) if iszero(gt(fromMax, from)) { from := fromMax } let end := add(add(subject, 0x20), w) subject := add(add(subject, 0x20), from) if iszero(gt(subject, end)) { break } // As this function is not too often used, // we shall simply use keccak256 for smaller bytecode size. for { let h := keccak256(add(search, 0x20), searchLength) } 1 {} { if eq(keccak256(subject, searchLength), h) { result := sub(subject, add(end, 1)) break } subject := add(subject, w) // `sub(subject, 1)`. if iszero(gt(subject, end)) { break } } break } } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from right to left. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function lastIndexOf(string memory subject, string memory search) internal pure returns (uint256 result) { result = lastIndexOf(subject, search, uint256(int256(-1))); } /// @dev Returns whether `subject` starts with `search`. function startsWith(string memory subject, string memory search) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { let searchLength := mload(search) // Just using keccak256 directly is actually cheaper. // forgefmt: disable-next-item result := and( iszero(gt(searchLength, mload(subject))), eq( keccak256(add(subject, 0x20), searchLength), keccak256(add(search, 0x20), searchLength) ) ) } } /// @dev Returns whether `subject` ends with `search`. function endsWith(string memory subject, string memory search) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { let searchLength := mload(search) let subjectLength := mload(subject) // Whether `search` is not longer than `subject`. let withinRange := iszero(gt(searchLength, subjectLength)) // Just using keccak256 directly is actually cheaper. // forgefmt: disable-next-item result := and( withinRange, eq( keccak256( // `subject + 0x20 + max(subjectLength - searchLength, 0)`. add(add(subject, 0x20), mul(withinRange, sub(subjectLength, searchLength))), searchLength ), keccak256(add(search, 0x20), searchLength) ) ) } } /// @dev Returns `subject` repeated `times`. function repeat(string memory subject, uint256 times) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) if iszero(or(iszero(times), iszero(subjectLength))) { subject := add(subject, 0x20) result := mload(0x40) let output := add(result, 0x20) for {} 1 {} { // Copy the `subject` one word at a time. for { let o := 0 } 1 {} { mstore(add(output, o), mload(add(subject, o))) o := add(o, 0x20) if iszero(lt(o, subjectLength)) { break } } output := add(output, subjectLength) times := sub(times, 1) if iszero(times) { break } } mstore(output, 0) // Zeroize the slot after the string. let resultLength := sub(output, add(result, 0x20)) mstore(result, resultLength) // Store the length. // Allocate the memory. mstore(0x40, add(result, add(resultLength, 0x20))) } } } /// @dev Returns a copy of `subject` sliced from `start` to `end` (exclusive). /// `start` and `end` are byte offsets. function slice(string memory subject, uint256 start, uint256 end) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) if iszero(gt(subjectLength, end)) { end := subjectLength } if iszero(gt(subjectLength, start)) { start := subjectLength } if lt(start, end) { result := mload(0x40) let resultLength := sub(end, start) mstore(result, resultLength) subject := add(subject, start) let w := not(0x1f) // Copy the `subject` one word at a time, backwards. for { let o := and(add(resultLength, 0x1f), w) } 1 {} { mstore(add(result, o), mload(add(subject, o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } // Zeroize the slot after the string. mstore(add(add(result, 0x20), resultLength), 0) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, add(result, and(add(resultLength, 0x3f), w))) } } } /// @dev Returns a copy of `subject` sliced from `start` to the end of the string. /// `start` is a byte offset. function slice(string memory subject, uint256 start) internal pure returns (string memory result) { result = slice(subject, start, uint256(int256(-1))); } /// @dev Returns all the indices of `search` in `subject`. /// The indices are byte offsets. function indicesOf(string memory subject, string memory search) internal pure returns (uint256[] memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) let searchLength := mload(search) if iszero(gt(searchLength, subjectLength)) { subject := add(subject, 0x20) search := add(search, 0x20) result := add(mload(0x40), 0x20) let subjectStart := subject let subjectSearchEnd := add(sub(add(subject, subjectLength), searchLength), 1) let h := 0 if iszero(lt(searchLength, 0x20)) { h := keccak256(search, searchLength) } let m := shl(3, sub(0x20, and(searchLength, 0x1f))) let s := mload(search) for {} 1 {} { let t := mload(subject) // Whether the first `searchLength % 32` bytes of // `subject` and `search` matches. if iszero(shr(m, xor(t, s))) { if h { if iszero(eq(keccak256(subject, searchLength), h)) { subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } continue } } // Append to `result`. mstore(result, sub(subject, subjectStart)) result := add(result, 0x20) // Advance `subject` by `searchLength`. subject := add(subject, searchLength) if searchLength { if iszero(lt(subject, subjectSearchEnd)) { break } continue } } subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } } let resultEnd := result // Assign `result` to the free memory pointer. result := mload(0x40) // Store the length of `result`. mstore(result, shr(5, sub(resultEnd, add(result, 0x20)))) // Allocate memory for result. // We allocate one more word, so this array can be recycled for {split}. mstore(0x40, add(resultEnd, 0x20)) } } } /// @dev Returns a arrays of strings based on the `delimiter` inside of the `subject` string. function split(string memory subject, string memory delimiter) internal pure returns (string[] memory result) { uint256[] memory indices = indicesOf(subject, delimiter); /// @solidity memory-safe-assembly assembly { let w := not(0x1f) let indexPtr := add(indices, 0x20) let indicesEnd := add(indexPtr, shl(5, add(mload(indices), 1))) mstore(add(indicesEnd, w), mload(subject)) mstore(indices, add(mload(indices), 1)) let prevIndex := 0 for {} 1 {} { let index := mload(indexPtr) mstore(indexPtr, 0x60) if iszero(eq(index, prevIndex)) { let element := mload(0x40) let elementLength := sub(index, prevIndex) mstore(element, elementLength) // Copy the `subject` one word at a time, backwards. for { let o := and(add(elementLength, 0x1f), w) } 1 {} { mstore(add(element, o), mload(add(add(subject, prevIndex), o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } // Zeroize the slot after the string. mstore(add(add(element, 0x20), elementLength), 0) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, add(element, and(add(elementLength, 0x3f), w))) // Store the `element` into the array. mstore(indexPtr, element) } prevIndex := add(index, mload(delimiter)) indexPtr := add(indexPtr, 0x20) if iszero(lt(indexPtr, indicesEnd)) { break } } result := indices if iszero(mload(delimiter)) { result := add(indices, 0x20) mstore(result, sub(mload(indices), 2)) } } } /// @dev Returns a concatenated string of `a` and `b`. /// Cheaper than `string.concat()` and does not de-align the free memory pointer. function concat(string memory a, string memory b) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let w := not(0x1f) result := mload(0x40) let aLength := mload(a) // Copy `a` one word at a time, backwards. for { let o := and(add(aLength, 0x20), w) } 1 {} { mstore(add(result, o), mload(add(a, o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } let bLength := mload(b) let output := add(result, aLength) // Copy `b` one word at a time, backwards. for { let o := and(add(bLength, 0x20), w) } 1 {} { mstore(add(output, o), mload(add(b, o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } let totalLength := add(aLength, bLength) let last := add(add(result, 0x20), totalLength) // Zeroize the slot after the string. mstore(last, 0) // Stores the length. mstore(result, totalLength) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, and(add(last, 0x1f), w)) } } /// @dev Returns a copy of the string in either lowercase or UPPERCASE. /// WARNING! This function is only compatible with 7-bit ASCII strings. function toCase(string memory subject, bool toUpper) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let length := mload(subject) if length { result := add(mload(0x40), 0x20) subject := add(subject, 1) let flags := shl(add(70, shl(5, toUpper)), 0x3ffffff) let w := not(0) for { let o := length } 1 {} { o := add(o, w) let b := and(0xff, mload(add(subject, o))) mstore8(add(result, o), xor(b, and(shr(b, flags), 0x20))) if iszero(o) { break } } result := mload(0x40) mstore(result, length) // Store the length. let last := add(add(result, 0x20), length) mstore(last, 0) // Zeroize the slot after the string. mstore(0x40, add(last, 0x20)) // Allocate the memory. } } } /// @dev Returns a lowercased copy of the string. /// WARNING! This function is only compatible with 7-bit ASCII strings. function lower(string memory subject) internal pure returns (string memory result) { result = toCase(subject, false); } /// @dev Returns an UPPERCASED copy of the string. /// WARNING! This function is only compatible with 7-bit ASCII strings. function upper(string memory subject) internal pure returns (string memory result) { result = toCase(subject, true); } /// @dev Escapes the string to be used within HTML tags. function escapeHTML(string memory s) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let end := add(s, mload(s)) result := add(mload(0x40), 0x20) // Store the bytes of the packed offsets and strides into the scratch space. // `packed = (stride << 5) | offset`. Max offset is 20. Max stride is 6. mstore(0x1f, 0x900094) mstore(0x08, 0xc0000000a6ab) // Store ""&'<>" into the scratch space. mstore(0x00, shl(64, 0x2671756f743b26616d703b262333393b266c743b2667743b)) for {} iszero(eq(s, end)) {} { s := add(s, 1) let c := and(mload(s), 0xff) // Not in `["\"","'","&","<",">"]`. if iszero(and(shl(c, 1), 0x500000c400000000)) { mstore8(result, c) result := add(result, 1) continue } let t := shr(248, mload(c)) mstore(result, mload(and(t, 0x1f))) result := add(result, shr(5, t)) } let last := result mstore(last, 0) // Zeroize the slot after the string. result := mload(0x40) mstore(result, sub(last, add(result, 0x20))) // Store the length. mstore(0x40, add(last, 0x20)) // Allocate the memory. } } /// @dev Escapes the string to be used within double-quotes in a JSON. /// If `addDoubleQuotes` is true, the result will be enclosed in double-quotes. function escapeJSON(string memory s, bool addDoubleQuotes) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let end := add(s, mload(s)) result := add(mload(0x40), 0x20) if addDoubleQuotes { mstore8(result, 34) result := add(1, result) } // Store "\\u0000" in scratch space. // Store "0123456789abcdef" in scratch space. // Also, store `{0x08:"b", 0x09:"t", 0x0a:"n", 0x0c:"f", 0x0d:"r"}`. // into the scratch space. mstore(0x15, 0x5c75303030303031323334353637383961626364656662746e006672) // Bitmask for detecting `["\"","\\"]`. let e := or(shl(0x22, 1), shl(0x5c, 1)) for {} iszero(eq(s, end)) {} { s := add(s, 1) let c := and(mload(s), 0xff) if iszero(lt(c, 0x20)) { if iszero(and(shl(c, 1), e)) { // Not in `["\"","\\"]`. mstore8(result, c) result := add(result, 1) continue } mstore8(result, 0x5c) // "\\". mstore8(add(result, 1), c) result := add(result, 2) continue } if iszero(and(shl(c, 1), 0x3700)) { // Not in `["\b","\t","\n","\f","\d"]`. mstore8(0x1d, mload(shr(4, c))) // Hex value. mstore8(0x1e, mload(and(c, 15))) // Hex value. mstore(result, mload(0x19)) // "\\u00XX". result := add(result, 6) continue } mstore8(result, 0x5c) // "\\". mstore8(add(result, 1), mload(add(c, 8))) result := add(result, 2) } if addDoubleQuotes { mstore8(result, 34) result := add(1, result) } let last := result mstore(last, 0) // Zeroize the slot after the string. result := mload(0x40) mstore(result, sub(last, add(result, 0x20))) // Store the length. mstore(0x40, add(last, 0x20)) // Allocate the memory. } } /// @dev Escapes the string to be used within double-quotes in a JSON. function escapeJSON(string memory s) internal pure returns (string memory result) { result = escapeJSON(s, false); } /// @dev Returns whether `a` equals `b`. function eq(string memory a, string memory b) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { result := eq(keccak256(add(a, 0x20), mload(a)), keccak256(add(b, 0x20), mload(b))) } } /// @dev Returns whether `a` equals `b`. For short strings up to 32 bytes. function eqs(string memory a, bytes32 b) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { // These should be evaluated on compile time, as far as possible. let x := and(b, add(not(b), 1)) let r := or(shl(8, iszero(b)), shl(7, iszero(iszero(shr(128, x))))) r := or(r, shl(6, iszero(iszero(shr(64, shr(r, x)))))) r := or(r, shl(5, lt(0xffffffff, shr(r, x)))) r := or(r, shl(4, lt(0xffff, shr(r, x)))) r := or(r, shl(3, lt(0xff, shr(r, x)))) result := gt(eq(mload(a), sub(32, shr(3, r))), shr(r, xor(b, mload(add(a, 0x20))))) } } /// @dev Packs a single string with its length into a single word. /// Returns `bytes32(0)` if the length is zero or greater than 31. function packOne(string memory a) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { // We don't need to zero right pad the string, // since this is our own custom non-standard packing scheme. result := mul( // Load the length and the bytes. mload(add(a, 0x1f)), // `length != 0 && length < 32`. Abuses underflow. // Assumes that the length is valid and within the block gas limit. lt(sub(mload(a), 1), 0x1f) ) } } /// @dev Unpacks a string packed using {packOne}. /// Returns the empty string if `packed` is `bytes32(0)`. /// If `packed` is not an output of {packOne}, the output behaviour is undefined. function unpackOne(bytes32 packed) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { // Grab the free memory pointer. result := mload(0x40) // Allocate 2 words (1 for the length, 1 for the bytes). mstore(0x40, add(result, 0x40)) // Zeroize the length slot. mstore(result, 0) // Store the length and bytes. mstore(add(result, 0x1f), packed) // Right pad with zeroes. mstore(add(add(result, 0x20), mload(result)), 0) } } /// @dev Packs two strings with their lengths into a single word. /// Returns `bytes32(0)` if combined length is zero or greater than 30. function packTwo(string memory a, string memory b) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { let aLength := mload(a) // We don't need to zero right pad the strings, // since this is our own custom non-standard packing scheme. result := mul( // Load the length and the bytes of `a` and `b`. or( shl(shl(3, sub(0x1f, aLength)), mload(add(a, aLength))), mload(sub(add(b, 0x1e), aLength)) ), // `totalLength != 0 && totalLength < 31`. Abuses underflow. // Assumes that the lengths are valid and within the block gas limit. lt(sub(add(aLength, mload(b)), 1), 0x1e) ) } } /// @dev Unpacks strings packed using {packTwo}. /// Returns the empty strings if `packed` is `bytes32(0)`. /// If `packed` is not an output of {packTwo}, the output behaviour is undefined. function unpackTwo(bytes32 packed) internal pure returns (string memory resultA, string memory resultB) { /// @solidity memory-safe-assembly assembly { // Grab the free memory pointer. resultA := mload(0x40) resultB := add(resultA, 0x40) // Allocate 2 words for each string (1 for the length, 1 for the byte). Total 4 words. mstore(0x40, add(resultB, 0x40)) // Zeroize the length slots. mstore(resultA, 0) mstore(resultB, 0) // Store the lengths and bytes. mstore(add(resultA, 0x1f), packed) mstore(add(resultB, 0x1f), mload(add(add(resultA, 0x20), mload(resultA)))) // Right pad with zeroes. mstore(add(add(resultA, 0x20), mload(resultA)), 0) mstore(add(add(resultB, 0x20), mload(resultB)), 0) } } /// @dev Directly returns `a` without copying. function directReturn(string memory a) internal pure { assembly { // Assumes that the string does not start from the scratch space. let retStart := sub(a, 0x20) let retSize := add(mload(a), 0x40) // Right pad with zeroes. Just in case the string is produced // by a method that doesn't zero right pad. mstore(add(retStart, retSize), 0) // Store the return offset. mstore(retStart, 0x20) // End the transaction, returning the string. return(retStart, retSize) } } }
{ "optimizer": { "enabled": true, "runs": 1337 }, "viaIR": true, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"collective","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyClaimed","type":"error"},{"inputs":[],"name":"ClaimClosed","type":"error"},{"inputs":[],"name":"IndexOutOfBounds","type":"error"},{"inputs":[{"internalType":"uint256","name":"_size","type":"uint256"},{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"}],"name":"InvalidCodeAtRange","type":"error"},{"inputs":[],"name":"InvalidExternalURI","type":"error"},{"inputs":[],"name":"InvalidOffchainSigner","type":"error"},{"inputs":[],"name":"InvalidPayload","type":"error"},{"inputs":[],"name":"NotAllowedToApprove","type":"error"},{"inputs":[],"name":"NotAllowedToMint","type":"error"},{"inputs":[],"name":"NotTokenOwner","type":"error"},{"inputs":[],"name":"NotTokenOwnerNorApproved","type":"error"},{"inputs":[],"name":"TokenAlreadyMinted","type":"error"},{"inputs":[],"name":"TokenDoesNotExist","type":"error"},{"inputs":[],"name":"TokenOwner","type":"error"},{"inputs":[],"name":"TraitsMustBePairs","type":"error"},{"inputs":[],"name":"TransferToNonERC721Receiver","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"WriteError","type":"error"},{"inputs":[],"name":"ZeroAddressInvalidArgument","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"achievementsCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"image","type":"bytes"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"string[]","name":"traits","type":"string[]"}],"name":"add","outputs":[],"stateMutability":"nonpayable","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":"achievementID","type":"uint256"},{"internalType":"bytes","name":"image","type":"bytes"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"string[]","name":"traits","type":"string[]"}],"name":"change","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"achievementID","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"externalURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"offset","type":"uint256"},{"internalType":"uint256","name":"count","type":"uint256"}],"name":"getAchievements","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"achievementID","type":"uint256"}],"name":"hasClaim","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":[],"name":"isOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"leetCollectiveAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"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":"string","name":"url","type":"string"}],"name":"setExternalURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collective","type":"address"}],"name":"setLeetCollective","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setOffchainSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleExternalURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"tokenId","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":"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":[],"name":"useExternalURI","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
604060808152346200050c576200445f803803806200001e8162000511565b9283398101916060828403126200050c5781516001600160401b0392908381116200050c57846200005191830162000537565b602094858301518581116200050c5784916200006f91850162000537565b9201516001600160a01b039586821695918690036200050c578451936060850185811084821117620004f6578652602685527f416368696576656d656e74732077697468696e2074686520313333372065636f828601526573797374656d60d01b86860152835191838311620004f6576000958654936001968786811c96168015620004eb575b84871014620003f5578190601f9687811162000498575b50849087831160011462000434578a9262000428575b5050600019600383901b1c191690871b1787555b805190858211620004145786548781811c9116801562000409575b84821014620003f557908186849311620003a2575b5083908683116001146200033e57899262000332575b5050600019600383901b1c191690861b1785555b81519384116200031e576002548581811c9116801562000313575b82821014620002ff57838111620002b6575b50809284116001146200024c5750928293918392869462000240575b50501b916000199060031b1c1916176002555b600654907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060018060a01b031993338585161760065551953393169180a36007541617600755613eb59081620005aa8239f35b015192503880620001da565b919083601f198116600288528488209488905b888383106200029b575050501062000281575b505050811b01600255620001ed565b015160001960f88460031b161c1916905538808062000272565b8587015188559096019594850194879350908101906200025f565b600287528187208480870160051c820192848810620002f5575b0160051c019086905b828110620002e9575050620001be565b888155018690620002d9565b92508192620002d0565b634e487b7160e01b87526022600452602487fd5b90607f1690620001ac565b634e487b7160e01b86526041600452602486fd5b0151905038806200017d565b888a52848a208994509190601f1984168b5b878282106200038b575050841162000371575b505050811b01855562000191565b015160001960f88460031b161c1916905538808062000363565b8385015186558c9790950194938401930162000350565b9091508789528389208680850160051c820192868610620003eb575b918a91869594930160051c01915b828110620003dc57505062000167565b8b81558594508a9101620003cc565b92508192620003be565b634e487b7160e01b89526022600452602489fd5b90607f169062000152565b634e487b7160e01b88526041600452602488fd5b01519050388062000123565b8a8052858b208a94509190601f1984168c5b8882821062000481575050841162000467575b505050811b01875562000137565b015160001960f88460031b161c1916905538808062000459565b8385015186558d9790950194938401930162000446565b909150898052848a208780850160051c820192878610620004e1575b918b91869594930160051c01915b828110620004d25750506200010d565b8c81558594508b9101620004c2565b92508192620004b4565b95607f1695620000f6565b634e487b7160e01b600052604160045260246000fd5b600080fd5b6040519190601f01601f191682016001600160401b03811183821017620004f657604052565b919080601f840112156200050c5782516001600160401b038111620004f6576020906200056d601f8201601f1916830162000511565b928184528282870101116200050c5760005b8181106200059557508260009394955001015290565b85810183015184820184015282016200057f56fe6080604052600436101561001257600080fd5b60003560e01c806301ffc9a71461024757806304f81b111461024257806306fdde031461023d578063081812fc14610238578063095ea7b31461023357806318160ddd1461022e57806323b872dd1461022957806326b043eb146102245780632937fe341461021f5780632f745c591461021a57806338926b6d1461021557806342842e0e1461021057806347535d7b1461020b5780634f6ccce7146102065780635ecf091f146102015780636352211e146101fc57806370a08231146101f7578063715018a6146101f25780638da5cb5b146101ed57806395d89b41146101e8578063a22cb465146101e3578063b2d2a1b9146101de578063b54f5b30146101d9578063b88d4fde146101d4578063c87b56dd146101cf578063cd287777146101ca578063d08b4add146101c5578063d1129745146101c0578063e8a3d485146101bb578063e985e9c5146101b6578063eae10136146101b1578063f2fde38b146101ac578063f30dadee146101a7578063fb055615146101a25763fcaf8a661461019d57600080fd5b611c6a565b611b6b565b611b4d565b611a75565b611a4f565b6119ed565b61191b565b61181a565b611744565b6116b7565b611321565b6112d2565b611264565b61123d565b611176565b6110cf565b6110a8565b61104c565b610f52565b610f34565b610e8d565b610d6d565b610d47565b610d1f565b610bb0565b610a82565b6108ac565b6107d7565b6107c0565b61076d565b610609565b6105da565b6104f7565b610379565b61027b565b7fffffffff0000000000000000000000000000000000000000000000000000000081160361027657565b600080fd5b346102765760203660031901126102765760207fffffffff000000000000000000000000000000000000000000000000000000006004356102bb8161024c565b167f80ac58cd000000000000000000000000000000000000000000000000000000008114908115610323575b81156102f9575b506040519015158152f35b7f01ffc9a700000000000000000000000000000000000000000000000000000000915014386102ee565b7f5b5e139f00000000000000000000000000000000000000000000000000000000811491506102e7565b600435906001600160a01b038216820361027657565b602435906001600160a01b038216820361027657565b346102765760203660031901126102765761039261034d565b6103b36103a76007546001600160a01b031690565b6001600160a01b031690565b6040516352ebc13f60e11b815233600482015290602090829060249082905afa908115610496576102149161ffff91600091610468575b5016141580610444575b61041a57610418906001600160a01b03166001600160a01b03196009541617600955565b005b60046040517f82b42900000000000000000000000000000000000000000000000000000000008152fd5b50336001600160a01b036104606006546001600160a01b031690565b1614156103f4565b610489915060203d811161048f575b6104818183610b20565b810190611d48565b386103ea565b503d610477565b611d62565b60005b8381106104ae5750506000910152565b818101518382015260200161049e565b906020916104d78151809281855285808601910161049b565b601f01601f1916010190565b9060206104f49281815201906104be565b90565b34610276576000806003193601126105d7576040519080805461051981610dbd565b808552916001918083169081156105ad5750600114610553575b61054f8561054381870382610b20565b604051918291826104e3565b0390f35b80809450527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b8284106105955750505081016020016105438261054f610533565b8054602085870181019190915290930192810161057a565b86955061054f9693506020925061054394915060ff191682840152151560051b8201019293610533565b80fd5b346102765760203660031901126102765760206105f8600435613a8b565b6001600160a01b0360405191168152f35b346102765760403660031901126102765761062261034d565b6024359061064561063283612781565b90546001600160a01b039160031b1c1690565b6001600160a01b039182811692821691838314610743578233141590816106f0575b506106c65761069f90610684856000526004602052604060002090565b906001600160a01b03166001600160a01b0319825416179055565b7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a4005b60046040517f589ad810000000000000000000000000000000000000000000000000000000008152fd5b61073d91506107326107399161071a33916001600160a01b03166000526005602052604060002090565b906001600160a01b0316600052602052604060002090565b5460ff1690565b1590565b38610667565b60046040517f2b141082000000000000000000000000000000000000000000000000000000008152fd5b34610276576000366003190112610276576020600354604051908152f35b6060906003190112610276576001600160a01b0390600435828116810361027657916024359081168103610276579060443590565b34610276576104186107d13661078b565b916139b4565b34610276576020366003190112610276576107f061034d565b6108056103a76007546001600160a01b031690565b6040516352ebc13f60e11b815233600482015290602090829060249082905afa908115610496576102149161ffff9160009161088e575b501614158061086a575b61041a57610418906001600160a01b03166001600160a01b03196007541617600755565b50336001600160a01b036108866006546001600160a01b031690565b161415610846565b6108a6915060203d811161048f576104818183610b20565b3861083c565b34610276576040806003193601126102765760043590602435600b5480841015610a72576108da8285612912565b11610a6257826108e8612cbc565b91810160001981015b8183106109105761054f8561090586612f62565b9051918291826104e3565b90919361092561091f866120b2565b50612601565b9461093f61093a87516001600160a01b031690565b613279565b90610948612c1c565b9360009560608901965b875180518210156109ee578161096791612cf5565b5186519060209161098d8161097f8582018095612422565b03601f198101835282610b20565b51902090875190600082526109a182610ae8565b8151910120036109b4575b600201610952565b956109e66002916109e06109c98a8c51612cf5565b516109d98c5160018d0190612cf5565b5190613ca4565b90612d09565b9690506109ac565b505097610a1b92965092610a37949793959195610a216020820193610a1b8551610a16612d59565b613ca4565b90612d92565b92519089610a2e8a613e40565b91015191612dd3565b91818103610a4e575b6001019390939192936108f1565b91610a5a600191612f2a565b929050610a40565b60048251634e23d03560e01b8152fd5b60048351634e23d03560e01b8152fd5b34610276576040366003190112610276576020610aa9610aa061034d565b60243590613ae0565b604051908152f35b634e487b7160e01b600052604160045260246000fd5b6080810190811067ffffffffffffffff821117610ae357604052565b610ab1565b6020810190811067ffffffffffffffff821117610ae357604052565b6040810190811067ffffffffffffffff821117610ae357604052565b90601f8019910116810190811067ffffffffffffffff821117610ae357604052565b67ffffffffffffffff8111610ae357601f01601f191660200190565b929192610b6a82610b42565b91610b786040519384610b20565b829481845281830111610276578281602093846000960137010152565b9080601f83011215610276578160206104f493359101610b5e565b346102765760408060031936011261027657600480359060243567ffffffffffffffff811161027657610be69036908301610b95565b600754610bf79060a01c60ff161590565b610cf757610739610c0891846134d7565b610cd05781600b541115610cc25782513360601b6bffffffffffffffffffffffff1916602082019081526034820184905290610c47816054810161097f565b51902092610c6261073285600052600a602052604060002090565b610c9c57610c9383610c8e610c8187600052600a602052604060002090565b805460ff19166001179055565b612fb6565b61041833613c40565b517f646cf558000000000000000000000000000000000000000000000000000000008152fd5b8251634e23d03560e01b8152fd5b82517f7c6953f9000000000000000000000000000000000000000000000000000000008152fd5b5082517ff6e85041000000000000000000000000000000000000000000000000000000008152fd5b3461027657610418610d303661078b565b9060405192610d3e84610ae8565b6000845261389d565b3461027657600036600319011261027657602060ff60075460a01c166040519015158152f35b3461027657602036600319011261027657600435600354811015610d9657602090604051908152f35b6004604051634e23d03560e01b8152fd5b634e487b7160e01b600052600060045260246000fd5b90600182811c92168015610ded575b6020831014610dd757565b634e487b7160e01b600052602260045260246000fd5b91607f1691610dcc565b9060009291805491610e0883610dbd565b918282526001938481169081600014610e6a5750600114610e2a575b50505050565b90919394506000526020928360002092846000945b838610610e56575050505001019038808080610e24565b805485870183015294019385908201610e3f565b9294505050602093945060ff191683830152151560051b01019038808080610e24565b34610276576000806003193601126105d7576040519080600854610eb081610dbd565b808552916001918083169081156105ad5750600114610ed95761054f8561054381870382610b20565b9250600883527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee35b828410610f1c5750505081016020016105438261054f610533565b80546020858701810191909152909301928101610f01565b346102765760203660031901126102765760206105f86004356137dd565b34610276576020366003190112610276576001600160a01b03610f7361034d565b168015611022576003805491600091600191908383805b610f9a575b604051868152602090f35b15611015575b6000908681101561101057828252610fe46103a7827fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01546001600160a01b031690565b8414610ffb575b610ff4906137ce565b9084610f8a565b94611008610ff4916137ce565b959050610feb565b61209c565b858110610fa05780610f8f565b60046040517f0eec9552000000000000000000000000000000000000000000000000000000008152fd5b34610276576000806003193601126105d757611066611cf0565b806001600160a01b036006546001600160a01b03198116600655167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b346102765760003660031901126102765760206001600160a01b0360065416604051908152f35b34610276576000806003193601126105d75760405190806002546110f281610dbd565b808552916001918083169081156105ad575060011461111b5761054f8561054381870382610b20565b9250600283527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace5b82841061115e5750505081016020016105438261054f610533565b80546020858701810191909152909301928101611143565b346102765760403660031901126102765761118f61034d565b602435801515809103610276576001600160a01b03821691338314611213576111d8903360005260056020526040600020906001600160a01b0316600052602052604060002090565b60ff1981541660ff83161790556040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b60046040517fb2c527b3000000000000000000000000000000000000000000000000000000008152fd5b346102765760003660031901126102765760206001600160a01b0360075416604051908152f35b346102765760403660031901126102765761127d61034d565b60405160609190911b6bffffffffffffffffffffffff1916602082019081526024356034830152906112b2816054810161097f565b519020600052600a602052602060ff604060002054166040519015158152f35b34610276576080366003190112610276576112eb61034d565b6112f3610363565b6064359167ffffffffffffffff831161027657611317610418933690600401610b95565b916044359161389d565b3461027657602080600319360112610276576004359061134361073983613b77565b61162e5761136861091f611363611359856127b8565b90549060031b1c90565b6120b2565b61137c61093a82516001600160a01b031690565b9161138683613003565b9361139760075460ff9060a81c1690565b6115d9575b506113a8929192612c1c565b906000809360608601945b8551805182101561143d57816113c891612cf5565b5160409081516113df8161097f8982018095612422565b51902090518481526113f081610ae8565b8581519101200361140a575b61140590612904565b6113b3565b93611435611405916109e0611420888a51612cf5565b516109d98a5161142f8b6128f1565b90612cf5565b9490506113fc565b828589888c838301918251611450612d59565b9061145a91613ca4565b61146391612d92565b915192604001519460405195869486860161148f90600a90693d913730b6b2911d101160b11b81520190565b61149891612422565b7f222c20226465736372697074696f6e223a22000000000000000000000000000081526012016114c791612422565b7f222c22696d616765223a22646174613a696d6167652f7376672b786d6c3b62618152641cd94d8d0b60da1b602082015260250161150491612422565b7f222c22616e696d6174696f6e5f75726c223a0000000000000000000000000000815260120161153391612422565b7f2261747472696275746573223a205b00000000000000000000000000000000008152600f0161156291612422565b615d7d60f01b81526002010390601f199182810184526115829084610b20565b6040517f646174613a6170706c69636174696f6e2f6a736f6e2c000000000000000000009181019182529283916016016115bb91612422565b0390810182526115cb9082610b20565b60405161054f8192826104e3565b9093506115e7600854610dbd565b15611604576115f86115fd91613e40565b61316d565b923861139c565b60046040517fe15399f7000000000000000000000000000000000000000000000000000000008152fd5b60046040517fceea21b6000000000000000000000000000000000000000000000000000000008152fd5b9181601f840112156102765782359167ffffffffffffffff8311610276576020838186019501011161027657565b9181601f840112156102765782359167ffffffffffffffff8311610276576020808501948460051b01011161027657565b346102765760a03660031901126102765767ffffffffffffffff602435818111610276576116e9903690600401611658565b9060443583811161027657611702903690600401611658565b906064358581116102765761171b903690600401611658565b92909160843596871161027657611739610418973690600401611686565b969095600435612554565b346102765760203660031901126102765760043567ffffffffffffffff811161027657611775903690600401610b95565b61178a6103a76007546001600160a01b031690565b6040516352ebc13f60e11b815233600482015290602090829060249082905afa908115610496576102149161ffff916000916117fc575b50161415806117d8575b61041a5761041890611ef1565b50336001600160a01b036117f46006546001600160a01b031690565b1614156117cb565b611814915060203d811161048f576104818183610b20565b386117c1565b34610276576000806003193601126105d7576118416103a76007546001600160a01b031690565b6040516352ebc13f60e11b815233600482015290602090829060249082905afa908115610496576102149161ffff9184916118fd575b50161415806118d9575b61041a576118d66007547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff74ff000000000000000000000000000000000000000060ff8360a01c161560a01b16911617600755565b80f35b50336001600160a01b036118f56006546001600160a01b031690565b161415611881565b611915915060203d811161048f576104818183610b20565b38611877565b346102765760003660031901126102765761054f6119dd610543603b60405160208101693d913730b6b2911d101160b11b81526119a560028361198e6011611965602a8401613063565b7f222c226465736372697074696f6e223a220000000000000000000000000000008152016130f2565b61227d60f01b815203601d19810185520183610b20565b6040519485927f646174613a6170706c69636174696f6e2f6a736f6e3b757466382c000000000060208501525180928585019061049b565b810103601b810184520182610b20565b3461027657604036600319011261027657602060ff611a43611a0d61034d565b6001600160a01b03611a1d610363565b9116600052600584526040600020906001600160a01b0316600052602052604060002090565b54166040519015158152f35b3461027657600036600319011261027657602060ff60075460a81c166040519015158152f35b3461027657602036600319011261027657611a8e61034d565b611a96611cf0565b6001600160a01b03809116908115611ae357600654826001600160a01b0319821617600655167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b608460405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b34610276576000366003190112610276576020600b54604051908152f35b34610276576000806003193601126105d757611b926103a76007546001600160a01b031690565b6040516352ebc13f60e11b815233600482015290602090829060249082905afa908115610496576102149161ffff918491611c4c575b5016141580611c28575b61041a576118d66007547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff75ff00000000000000000000000000000000000000000060ff8360a81c161560a81b16911617600755565b50336001600160a01b03611c446006546001600160a01b031690565b161415611bd2565b611c64915060203d811161048f576104818183610b20565b38611bc8565b346102765760803660031901126102765767ffffffffffffffff60043581811161027657611c9c903690600401610b95565b60243582811161027657611cb4903690600401610b95565b9060443583811161027657611ccd903690600401610b95565b60643593841161027657611ce8610418943690600401611686565b939092611fdb565b6001600160a01b03600654163303611d0457565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b90816020910312610276575161ffff811681036102765790565b6040513d6000823e3d90fd5b818110611d79575050565b60008155600101611d6e565b90601f8211611d92575050565b611ddc9160086000527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3906020601f840160051c83019310611dde575b601f0160051c0190611d6e565b565b9091508190611dcf565b9190601f8111611df757505050565b611ddc926000526020600020906020601f840160051c83019310611dde57601f0160051c0190611d6e565b919091825167ffffffffffffffff8111610ae357611e4a81611e448454610dbd565b84611de8565b602080601f8311600114611e86575081929394600092611e7b575b50508160011b916000199060031b1c1916179055565b015190503880611e65565b90601f19831695611e9c85600052602060002090565b926000905b888210611ed957505083600195969710611ec0575b505050811b019055565b015160001960f88460031b161c19169055388080611eb6565b80600185968294968601518155019501930190611ea1565b90815167ffffffffffffffff8111610ae357611f1781611f12600854610dbd565b611d85565b602080601f8311600114611f535750819293600092611f48575b50508160011b916000199060031b1c191617600855565b015190503880611f31565b90601f19831694611f8660086000527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee390565b926000905b878210611fc3575050836001959610611faa575b505050811b01600855565b015160001960f88460031b161c19169055388080611f9f565b80600185968294968601518155019501930190611f8b565b93929190611ff46103a76007546001600160a01b031690565b6040516352ebc13f60e11b815233600482015290602090829060249082905afa908115610496576102149161ffff91600091612066575b5016141580612042575b61041a57611ddc94612330565b50336001600160a01b0361205e6006546001600160a01b031690565b161415612035565b61207e915060203d811161048f576104818183610b20565b3861202b565b67ffffffffffffffff8111610ae35760051b60200190565b634e487b7160e01b600052603260045260246000fd5b600b5481101561101057600b60005260021b7f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90190600090565b634e487b7160e01b600052601160045260246000fd5b61210c8154610dbd565b9081612116575050565b81601f60009311600114612128575055565b908083918252612147601f60208420940160051c840160018501611d6e565b5555565b815191680100000000000000008311610ae35781548383558084106121ae575b50612180602080920192600052602060002090565b6000925b848410612192575050505050565b600183826121a283945186611e22565b01920193019290612184565b8260005283602060002091820191015b8181106121cb575061216b565b806121d7600192612102565b016121be565b600b549068010000000000000000821015610ae357612203600192838101600b556120b2565b91909161232b57805182546001600160a01b0319166001600160a01b03919091161782558282016020808301519485519167ffffffffffffffff8311610ae357612257836122518654610dbd565b86611de8565b80601f84116001146122b157509180806060959360039795611ddc9a6000946122a6575b50501b9160001990871b1c19161790555b61229d604082015160028601611e22565b0151910161214b565b01519250388061227b565b9193949596601f1984166122ca87600052602060002090565b936000905b82821061231457505092606095928592611ddc9a999660039996106122fc575b505050811b01905561228c565b015160001983891b60f8161c191690553880806122ef565b8088869782949787015181550196019401906122cf565b610da7565b9094939291600184166123f8576040519361234a85610ac7565b60009182865260209788870190606082526040880191606083526001600160a01b0361237d60608b019860608a52612439565b168952525261238b81612084565b936123996040519586610b20565b8185528785019160051b8101923684116105d75781925b8484106123c8575050505050611ddc939450526121dd565b833567ffffffffffffffff81116123f4578a916123e9839236908701610b95565b8152019301926123b0565b8280fd5b60046040517f91d77e6d000000000000000000000000000000000000000000000000000000008152fd5b906124356020928281519485920161049b565b0190565b612503612513602e604051612476602182602081019760008952612466815180926020868601910161049b565b8101036001810184520182610b20565b8051946040519485927fffffffff0000000000000000000000000000000000000000000000000000000060208501987f63000000000000000000000000000000000000000000000000000000000000008a5260e01b1660218501527f80600e6000396000f3000000000000000000000000000000000000000000000060258501525180928585019061049b565b810103600e810184520182610b20565b51906000f0906001600160a01b0382161561252a57565b60046040517f08d4abb6000000000000000000000000000000000000000000000000000000008152fd5b97969594939291906125716103a76007546001600160a01b031690565b6040516352ebc13f60e11b815233600482015290602090829060249082905afa908115610496576102149161ffff916000916125e3575b50161415806125bf575b61041a57611ddc98612954565b50336001600160a01b036125db6006546001600160a01b031690565b1614156125b2565b6125fb915060203d811161048f576104818183610b20565b386125a8565b906040805161260f81610ac7565b80936001600160a01b0381541682528251600360019261263c8361263581878501610df7565b0384610b20565b60209283860152855161265d816126568160028601610df7565b0382610b20565b868601520180549161266e83612084565b9561267b81519788610b20565b8387526000928352818320908288015b85851061269f575050505050505060600152565b8684819284516126b381612656818a610df7565b81520193019401939161268b565b90929167ffffffffffffffff8111610ae3576126e181611e448454610dbd565b6000601f821160011461271a578192939460009261270f5750508160011b916000199060031b1c1916179055565b013590503880611e65565b601f1982169461272f84600052602060002090565b91805b87811061276957508360019596971061274f57505050811b019055565b0135600019600384901b60f8161c19169055388080611eb6565b90926020600181928686013581550194019101612732565b6003548110156110105760036000527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0190600090565b600c5481101561101057600c6000527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c70190600090565b80548210156110105760005260206000200190600090565b8054801561286e57600019019061281e82826127ef565b61232b5761282c8154610dbd565b908161283757505055565b81601f6000931160011461284a57505555565b908083918252612869601f60208420940160051c840160018501611d6e565b555555565b634e487b7160e01b600052603160045260246000fd5b91908110156110105760051b81013590601e198136030182121561027657019081359167ffffffffffffffff8311610276576020018236038113610276579190565b90611ddc6128da9260405193848092610df7565b0383610b20565b92919061232b57611ddc926126c1565b90600182018092116128ff57565b6120ec565b90600282018092116128ff57565b919082018092116128ff57565b919091805468010000000000000000811015610ae357612944916001820181556127ef565b92909261232b57611ddc926126c1565b96949293909795916001988988166123f85789956129d79360409361297b61091f8d6120b2565b936129a961299861299387516001600160a01b031690565b612c2f565b6129a3368585610b5e565b90612c8c565b612bd9575b50506129c360208401516129a3368486610b5e565b612bc4575b505001516129a3368486610b5e565b612ba7575b505090935b612b6b575b806000915b612a59575b505b8181106129ff5750505050565b612a5490612a4f612a0f856120b2565b50612a29612a1e84878a612884565b90600380940161291f565b612a32866120b2565b50612a46612a3f856128f1565b878a612884565b9290910161291f565b612904565b6129f2565b9390612a64846120b2565b50600380910154821015612b63579081612ab1612aa96129a3612a9585612afc97612a8e8c6120b2565b50016127ef565b50612aa1868a8a612884565b9390916128c6565b923691610b5e565b612b41575b612af1612aa96129a3612add612acb8a6120b2565b5085612ad6886128f1565b91016127ef565b50612aa1612aea876128f1565b8a8a612884565b612b04575b50612904565b9093806129eb565b612b35612b3b91612b1e612b17856128f1565b8888612884565b929091612b2a8a6120b2565b5090612ad6876128f1565b906128e1565b38612af6565b612b5e612b4f838787612884565b90612b358585612a8e8c6120b2565b612ab6565b5090936129f0565b9283612b76846120b2565b50836003809201541115612b9f57612b9890612b91866120b2565b5001612807565b90936129e1565b5050926129e6565b612bbd916002612bb6886120b2565b50016126c1565b38806129dc565b612bd29188612bb68d6120b2565b38806129c8565b612beb612bf091612c15933691610b5e565b612439565b612bf98d6120b2565b50906001600160a01b03166001600160a01b0319825416179055565b38806129ae565b60405190612c2982610ae8565b60008252565b90813b8015612c765780600111612c76576000190160011980821015612c6f57505b600160405193601f19603f840116850160405282855260208501903c565b9050612c51565b509050604051612c8581610ae8565b6000815290565b90815181519081811493841594612ca5575b5050505090565b602092939450820120920120141538808080612c9e565b60405190612cc982610b04565b600182527f5b000000000000000000000000000000000000000000000000000000000000006020830152565b80518210156110105760209160051b010190565b6021611ddc919392936040519481612d2b87935180926020808701910161049b565b8201612d40825180936020808501910161049b565b01600b60fa1b6020820152036001810185520183610b20565b60405190612d6682610b04565b600482527f6e616d65000000000000000000000000000000000000000000000000000000006020830152565b6020611ddc919392936040519481612db3879351809286808701910161049b565b8201612dc78251809386808501910161049b565b01038085520183610b20565b929094939160405195869460208601693d913730b6b2911d101160b11b905280519081602a88019160200191612e089261049b565b8501602a81017f222c20226964223a000000000000000000000000000000000000000000000000905281519182603283019160200191612e479261049b565b01603281017f2c20226465736372697074696f6e223a22000000000000000000000000000000905281519182604383019160200191612e859261049b565b01604301612ec5906025907f222c22696d616765223a22646174613a696d6167652f7376672b786d6c3b62618152641cd94d8d0b60da1b60208201520190565b808251602081940191612ed79261049b565b01612f01817f222c2261747472696275746573223a205b0000000000000000000000000000009052565b601101612f0d91612422565b615d7d60f01b815203601d1981018352600201611ddc9083610b20565b90611ddc602160405184612f4882965180926020808601910161049b565b8101600b60fa1b6020820152036001810185520183610b20565b90611ddc602160405184612f8082965180926020808601910161049b565b81017f5d000000000000000000000000000000000000000000000000000000000000006020820152036001810185520183610b20565b600c5468010000000000000000811015610ae3576001810180600c5581101561101057600c6000527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c70155565b90611ddc603d60405180947f22646174613a696d6167652f7376672b786d6c3b6261736536342c00000000006020830152613048815180926020603b8601910161049b565b810161088b60f21b603b82015203601d810185520183610b20565b906000916000549061307482610dbd565b916001908181169081156130df575060011461308f57505050565b9091929350600080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563906000915b8483106130cc575050500190565b81816020925485870152019201916130be565b60ff191683525050811515909102019150565b9060009160019081549161310583610dbd565b928181169081156130df575060011461311d57505050565b8091929394506000527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6906000915b84831061315a575050500190565b818160209254858701520192019161314c565b9060405191826020917f2200000000000000000000000000000000000000000000000000000000000000838301526000906008546131aa81610dbd565b9060019081811690811561325257506001146131f3575b505092816131db8560029594611ddc97519485920161049b565b0161088b60f21b815203601d19810185520183610b20565b9091925060086000527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3906000915b83831061323b57505050820160210190806131db6131c1565b805489840160210152889550918601918101613222565b60ff1916602180880191909152831515909302860190920193508291506131db90506131c1565b61328d6132886104f492612c2f565b613d43565b6132886101bd60405180937f3c7376672077696474683d223130302522206865696768743d2231303025222060208301527f76696577426f783d223020302032303030302032303030302220786d6c6e733d60408301527f22687474703a2f2f7777772e77332e6f72672f323030302f737667223e00000060608301527f3c7374796c653e7376677b6261636b67726f756e642d636f6c6f723a7472616e607d8301527f73706172656e743b6261636b67726f756e642d696d6167653a75726c28646174609d8301527f613a696d6167652f706e673b6261736536342c0000000000000000000000000060bd83015261339081518092602060d08601910161049b565b81017f293b6261636b67726f756e642d7265706561743a6e6f2d7265706561743b626160d08201527f636b67726f756e642d73697a653a636f6e7461696e3b6261636b67726f756e6460f08201527f2d706f736974696f6e3a63656e7465723b696d6167652d72656e646572696e676101108201527f3a2d7765626b69742d6f7074696d697a652d636f6e74726173743b2d6d732d696101308201527f6e746572706f6c6174696f6e2d6d6f64653a6e6561726573742d6e65696768626101508201527f6f723b696d6167652d72656e646572696e673a2d6d6f7a2d63726973702d65646101708201527f6765733b696d6167652d72656e646572696e673a706978656c617465643b7d3c6101908201527f2f7374796c653e3c2f7376673e000000000000000000000000000000000000006101b08201520361019d810184520182610b20565b906001600160a01b0390816009541692831561358f576040513360601b6bffffffffffffffffffffffff191660208201908152603482019290925261351f816054810161097f565b5190206040519160208301917f19457468657265756d205369676e6564204d6573736167653a0a3332000000008352603c840152603c8352606083019183831067ffffffffffffffff841117610ae35761358a9361358293604052519020613714565b9190916135d9565b161490565b60046040517f74d3551f000000000000000000000000000000000000000000000000000000008152fd5b600511156135c357565b634e487b7160e01b600052602160045260246000fd5b6135e2816135b9565b806135ea5750565b6135f3816135b9565b600181036136405760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b613649816135b9565b600281036136965760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b806136a26003926135b9565b146136a957565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608490fd5b9060418151146000146137425761373e916020820151906060604084015193015160001a9061374c565b9091565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116137c25791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa156104965781516001600160a01b038116156137bc579190565b50600190565b50505050600090600390565b60001981146128ff5760010190565b6003548181111561162e578110156110105760036000527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01546001600160a01b0316801561162e5790565b9081602091031261027657516104f48161024c565b90926104f494936080936001600160a01b038092168452166020830152604082015281606082015201906104be565b3d15613898573d9061387e82610b42565b9161388c6040519384610b20565b82523d6000602084013e565b606090565b929190916138aa82613bc2565b6138b58284866139b4565b823b6138c15750505050565b61390a9260209260006001600160a01b036040518097819682957f150b7a02000000000000000000000000000000000000000000000000000000009b8c8552336004860161383e565b0393165af160009181613984575b506139435761392561386d565b8051908161393e57600460405163f5cd1f5d60e01b8152fd5b602001fd5b7fffffffff0000000000000000000000000000000000000000000000000000000016036139735738808080610e24565b600460405163f5cd1f5d60e01b8152fd5b6139a691925060203d81116139ad575b61399e8183610b20565b810190613829565b9038613918565b503d613994565b6139bd83613bc2565b6139c683612781565b90546001600160a01b03928316929160031b1c8116829003613a6157821691821561102257613a3a90613a03856000526004602052604060002090565b6001600160a01b03198154169055613a1a85612781565b90919082549060031b916001600160a01b03809116831b921b1916179055565b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4565b60046040517f59dc379f000000000000000000000000000000000000000000000000000000008152fd5b6003548110156110105760036000526001600160a01b039081817fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0154161561162e5760005260046020526040600020541690565b916003549182811015610d96576000936001938585805b613b0c576004604051634e23d03560e01b8152fd5b15613b6a575b600090613b246103a761063283612781565b6001600160a01b03851614613b44575b613b3d906137ce565b9086613af7565b96848114613b6057613b58613b3d916137ce565b979050613b34565b5093945050505050565b818110613b125780610d96565b60035481109081613b86575090565b90156110105760036000527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01546001600160a01b0316151590565b6001600160a01b039081613bd5826137dd565b1690813314928315613c28575b50508115613bf3575b50156106c657565b9050600052600560205260ff613c20336040600020906001600160a01b0316600052602052604060002090565b541638613beb565b90919250613c363392613a8b565b1614903880613be2565b906001600160a01b038216918215611022576003549268010000000000000000841015610ae357613c7c849260018401600355613a1a84612781565b60007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4565b603d611ddc919392936040519485917f7b2274726169745f74797065223a2200000000000000000000000000000000006020840152613ced815180926020602f8701910161049b565b82017f222c2276616c7565223a20220000000000000000000000000000000000000000602f820152613d29825180936020603b8501910161049b565b0161227d60f01b603b82015203601d810185520183610b20565b90606091805180613d52575050565b9092506003906002938285830104851b92604051957f4142434445464748494a4b4c4d4e4f505152535455565758595a616263646566601f52603f916106707f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392d5f188352602088018689019360048360208701975b0192835183808260121c16519160009283538181600c1c1651600153818160061c1651895316518653518152019186831015613e06576004908490613dc6565b5050935060009460407f3d3d0000000000000000000000000000000000000000000000000000000000009401604052069004820352528252565b90604051608081019260a0820160405260008452925b6000190192600a906030828206018553049283613e5657809350608091030191601f190191825256fea2646970667358221220481baeff644f64fc9ffef315de69d1c363230e259458b697ea65e18eab2400ea64736f6c63430008140033000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000018a1887d8f138bde097c502139078b2bddbb2ab900000000000000000000000000000000000000000000000000000000000000113133333720416368696576656d656e747300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000073133333741434800000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436101561001257600080fd5b60003560e01c806301ffc9a71461024757806304f81b111461024257806306fdde031461023d578063081812fc14610238578063095ea7b31461023357806318160ddd1461022e57806323b872dd1461022957806326b043eb146102245780632937fe341461021f5780632f745c591461021a57806338926b6d1461021557806342842e0e1461021057806347535d7b1461020b5780634f6ccce7146102065780635ecf091f146102015780636352211e146101fc57806370a08231146101f7578063715018a6146101f25780638da5cb5b146101ed57806395d89b41146101e8578063a22cb465146101e3578063b2d2a1b9146101de578063b54f5b30146101d9578063b88d4fde146101d4578063c87b56dd146101cf578063cd287777146101ca578063d08b4add146101c5578063d1129745146101c0578063e8a3d485146101bb578063e985e9c5146101b6578063eae10136146101b1578063f2fde38b146101ac578063f30dadee146101a7578063fb055615146101a25763fcaf8a661461019d57600080fd5b611c6a565b611b6b565b611b4d565b611a75565b611a4f565b6119ed565b61191b565b61181a565b611744565b6116b7565b611321565b6112d2565b611264565b61123d565b611176565b6110cf565b6110a8565b61104c565b610f52565b610f34565b610e8d565b610d6d565b610d47565b610d1f565b610bb0565b610a82565b6108ac565b6107d7565b6107c0565b61076d565b610609565b6105da565b6104f7565b610379565b61027b565b7fffffffff0000000000000000000000000000000000000000000000000000000081160361027657565b600080fd5b346102765760203660031901126102765760207fffffffff000000000000000000000000000000000000000000000000000000006004356102bb8161024c565b167f80ac58cd000000000000000000000000000000000000000000000000000000008114908115610323575b81156102f9575b506040519015158152f35b7f01ffc9a700000000000000000000000000000000000000000000000000000000915014386102ee565b7f5b5e139f00000000000000000000000000000000000000000000000000000000811491506102e7565b600435906001600160a01b038216820361027657565b602435906001600160a01b038216820361027657565b346102765760203660031901126102765761039261034d565b6103b36103a76007546001600160a01b031690565b6001600160a01b031690565b6040516352ebc13f60e11b815233600482015290602090829060249082905afa908115610496576102149161ffff91600091610468575b5016141580610444575b61041a57610418906001600160a01b03166001600160a01b03196009541617600955565b005b60046040517f82b42900000000000000000000000000000000000000000000000000000000008152fd5b50336001600160a01b036104606006546001600160a01b031690565b1614156103f4565b610489915060203d811161048f575b6104818183610b20565b810190611d48565b386103ea565b503d610477565b611d62565b60005b8381106104ae5750506000910152565b818101518382015260200161049e565b906020916104d78151809281855285808601910161049b565b601f01601f1916010190565b9060206104f49281815201906104be565b90565b34610276576000806003193601126105d7576040519080805461051981610dbd565b808552916001918083169081156105ad5750600114610553575b61054f8561054381870382610b20565b604051918291826104e3565b0390f35b80809450527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b8284106105955750505081016020016105438261054f610533565b8054602085870181019190915290930192810161057a565b86955061054f9693506020925061054394915060ff191682840152151560051b8201019293610533565b80fd5b346102765760203660031901126102765760206105f8600435613a8b565b6001600160a01b0360405191168152f35b346102765760403660031901126102765761062261034d565b6024359061064561063283612781565b90546001600160a01b039160031b1c1690565b6001600160a01b039182811692821691838314610743578233141590816106f0575b506106c65761069f90610684856000526004602052604060002090565b906001600160a01b03166001600160a01b0319825416179055565b7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a4005b60046040517f589ad810000000000000000000000000000000000000000000000000000000008152fd5b61073d91506107326107399161071a33916001600160a01b03166000526005602052604060002090565b906001600160a01b0316600052602052604060002090565b5460ff1690565b1590565b38610667565b60046040517f2b141082000000000000000000000000000000000000000000000000000000008152fd5b34610276576000366003190112610276576020600354604051908152f35b6060906003190112610276576001600160a01b0390600435828116810361027657916024359081168103610276579060443590565b34610276576104186107d13661078b565b916139b4565b34610276576020366003190112610276576107f061034d565b6108056103a76007546001600160a01b031690565b6040516352ebc13f60e11b815233600482015290602090829060249082905afa908115610496576102149161ffff9160009161088e575b501614158061086a575b61041a57610418906001600160a01b03166001600160a01b03196007541617600755565b50336001600160a01b036108866006546001600160a01b031690565b161415610846565b6108a6915060203d811161048f576104818183610b20565b3861083c565b34610276576040806003193601126102765760043590602435600b5480841015610a72576108da8285612912565b11610a6257826108e8612cbc565b91810160001981015b8183106109105761054f8561090586612f62565b9051918291826104e3565b90919361092561091f866120b2565b50612601565b9461093f61093a87516001600160a01b031690565b613279565b90610948612c1c565b9360009560608901965b875180518210156109ee578161096791612cf5565b5186519060209161098d8161097f8582018095612422565b03601f198101835282610b20565b51902090875190600082526109a182610ae8565b8151910120036109b4575b600201610952565b956109e66002916109e06109c98a8c51612cf5565b516109d98c5160018d0190612cf5565b5190613ca4565b90612d09565b9690506109ac565b505097610a1b92965092610a37949793959195610a216020820193610a1b8551610a16612d59565b613ca4565b90612d92565b92519089610a2e8a613e40565b91015191612dd3565b91818103610a4e575b6001019390939192936108f1565b91610a5a600191612f2a565b929050610a40565b60048251634e23d03560e01b8152fd5b60048351634e23d03560e01b8152fd5b34610276576040366003190112610276576020610aa9610aa061034d565b60243590613ae0565b604051908152f35b634e487b7160e01b600052604160045260246000fd5b6080810190811067ffffffffffffffff821117610ae357604052565b610ab1565b6020810190811067ffffffffffffffff821117610ae357604052565b6040810190811067ffffffffffffffff821117610ae357604052565b90601f8019910116810190811067ffffffffffffffff821117610ae357604052565b67ffffffffffffffff8111610ae357601f01601f191660200190565b929192610b6a82610b42565b91610b786040519384610b20565b829481845281830111610276578281602093846000960137010152565b9080601f83011215610276578160206104f493359101610b5e565b346102765760408060031936011261027657600480359060243567ffffffffffffffff811161027657610be69036908301610b95565b600754610bf79060a01c60ff161590565b610cf757610739610c0891846134d7565b610cd05781600b541115610cc25782513360601b6bffffffffffffffffffffffff1916602082019081526034820184905290610c47816054810161097f565b51902092610c6261073285600052600a602052604060002090565b610c9c57610c9383610c8e610c8187600052600a602052604060002090565b805460ff19166001179055565b612fb6565b61041833613c40565b517f646cf558000000000000000000000000000000000000000000000000000000008152fd5b8251634e23d03560e01b8152fd5b82517f7c6953f9000000000000000000000000000000000000000000000000000000008152fd5b5082517ff6e85041000000000000000000000000000000000000000000000000000000008152fd5b3461027657610418610d303661078b565b9060405192610d3e84610ae8565b6000845261389d565b3461027657600036600319011261027657602060ff60075460a01c166040519015158152f35b3461027657602036600319011261027657600435600354811015610d9657602090604051908152f35b6004604051634e23d03560e01b8152fd5b634e487b7160e01b600052600060045260246000fd5b90600182811c92168015610ded575b6020831014610dd757565b634e487b7160e01b600052602260045260246000fd5b91607f1691610dcc565b9060009291805491610e0883610dbd565b918282526001938481169081600014610e6a5750600114610e2a575b50505050565b90919394506000526020928360002092846000945b838610610e56575050505001019038808080610e24565b805485870183015294019385908201610e3f565b9294505050602093945060ff191683830152151560051b01019038808080610e24565b34610276576000806003193601126105d7576040519080600854610eb081610dbd565b808552916001918083169081156105ad5750600114610ed95761054f8561054381870382610b20565b9250600883527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee35b828410610f1c5750505081016020016105438261054f610533565b80546020858701810191909152909301928101610f01565b346102765760203660031901126102765760206105f86004356137dd565b34610276576020366003190112610276576001600160a01b03610f7361034d565b168015611022576003805491600091600191908383805b610f9a575b604051868152602090f35b15611015575b6000908681101561101057828252610fe46103a7827fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01546001600160a01b031690565b8414610ffb575b610ff4906137ce565b9084610f8a565b94611008610ff4916137ce565b959050610feb565b61209c565b858110610fa05780610f8f565b60046040517f0eec9552000000000000000000000000000000000000000000000000000000008152fd5b34610276576000806003193601126105d757611066611cf0565b806001600160a01b036006546001600160a01b03198116600655167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b346102765760003660031901126102765760206001600160a01b0360065416604051908152f35b34610276576000806003193601126105d75760405190806002546110f281610dbd565b808552916001918083169081156105ad575060011461111b5761054f8561054381870382610b20565b9250600283527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace5b82841061115e5750505081016020016105438261054f610533565b80546020858701810191909152909301928101611143565b346102765760403660031901126102765761118f61034d565b602435801515809103610276576001600160a01b03821691338314611213576111d8903360005260056020526040600020906001600160a01b0316600052602052604060002090565b60ff1981541660ff83161790556040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b60046040517fb2c527b3000000000000000000000000000000000000000000000000000000008152fd5b346102765760003660031901126102765760206001600160a01b0360075416604051908152f35b346102765760403660031901126102765761127d61034d565b60405160609190911b6bffffffffffffffffffffffff1916602082019081526024356034830152906112b2816054810161097f565b519020600052600a602052602060ff604060002054166040519015158152f35b34610276576080366003190112610276576112eb61034d565b6112f3610363565b6064359167ffffffffffffffff831161027657611317610418933690600401610b95565b916044359161389d565b3461027657602080600319360112610276576004359061134361073983613b77565b61162e5761136861091f611363611359856127b8565b90549060031b1c90565b6120b2565b61137c61093a82516001600160a01b031690565b9161138683613003565b9361139760075460ff9060a81c1690565b6115d9575b506113a8929192612c1c565b906000809360608601945b8551805182101561143d57816113c891612cf5565b5160409081516113df8161097f8982018095612422565b51902090518481526113f081610ae8565b8581519101200361140a575b61140590612904565b6113b3565b93611435611405916109e0611420888a51612cf5565b516109d98a5161142f8b6128f1565b90612cf5565b9490506113fc565b828589888c838301918251611450612d59565b9061145a91613ca4565b61146391612d92565b915192604001519460405195869486860161148f90600a90693d913730b6b2911d101160b11b81520190565b61149891612422565b7f222c20226465736372697074696f6e223a22000000000000000000000000000081526012016114c791612422565b7f222c22696d616765223a22646174613a696d6167652f7376672b786d6c3b62618152641cd94d8d0b60da1b602082015260250161150491612422565b7f222c22616e696d6174696f6e5f75726c223a0000000000000000000000000000815260120161153391612422565b7f2261747472696275746573223a205b00000000000000000000000000000000008152600f0161156291612422565b615d7d60f01b81526002010390601f199182810184526115829084610b20565b6040517f646174613a6170706c69636174696f6e2f6a736f6e2c000000000000000000009181019182529283916016016115bb91612422565b0390810182526115cb9082610b20565b60405161054f8192826104e3565b9093506115e7600854610dbd565b15611604576115f86115fd91613e40565b61316d565b923861139c565b60046040517fe15399f7000000000000000000000000000000000000000000000000000000008152fd5b60046040517fceea21b6000000000000000000000000000000000000000000000000000000008152fd5b9181601f840112156102765782359167ffffffffffffffff8311610276576020838186019501011161027657565b9181601f840112156102765782359167ffffffffffffffff8311610276576020808501948460051b01011161027657565b346102765760a03660031901126102765767ffffffffffffffff602435818111610276576116e9903690600401611658565b9060443583811161027657611702903690600401611658565b906064358581116102765761171b903690600401611658565b92909160843596871161027657611739610418973690600401611686565b969095600435612554565b346102765760203660031901126102765760043567ffffffffffffffff811161027657611775903690600401610b95565b61178a6103a76007546001600160a01b031690565b6040516352ebc13f60e11b815233600482015290602090829060249082905afa908115610496576102149161ffff916000916117fc575b50161415806117d8575b61041a5761041890611ef1565b50336001600160a01b036117f46006546001600160a01b031690565b1614156117cb565b611814915060203d811161048f576104818183610b20565b386117c1565b34610276576000806003193601126105d7576118416103a76007546001600160a01b031690565b6040516352ebc13f60e11b815233600482015290602090829060249082905afa908115610496576102149161ffff9184916118fd575b50161415806118d9575b61041a576118d66007547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff74ff000000000000000000000000000000000000000060ff8360a01c161560a01b16911617600755565b80f35b50336001600160a01b036118f56006546001600160a01b031690565b161415611881565b611915915060203d811161048f576104818183610b20565b38611877565b346102765760003660031901126102765761054f6119dd610543603b60405160208101693d913730b6b2911d101160b11b81526119a560028361198e6011611965602a8401613063565b7f222c226465736372697074696f6e223a220000000000000000000000000000008152016130f2565b61227d60f01b815203601d19810185520183610b20565b6040519485927f646174613a6170706c69636174696f6e2f6a736f6e3b757466382c000000000060208501525180928585019061049b565b810103601b810184520182610b20565b3461027657604036600319011261027657602060ff611a43611a0d61034d565b6001600160a01b03611a1d610363565b9116600052600584526040600020906001600160a01b0316600052602052604060002090565b54166040519015158152f35b3461027657600036600319011261027657602060ff60075460a81c166040519015158152f35b3461027657602036600319011261027657611a8e61034d565b611a96611cf0565b6001600160a01b03809116908115611ae357600654826001600160a01b0319821617600655167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b608460405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b34610276576000366003190112610276576020600b54604051908152f35b34610276576000806003193601126105d757611b926103a76007546001600160a01b031690565b6040516352ebc13f60e11b815233600482015290602090829060249082905afa908115610496576102149161ffff918491611c4c575b5016141580611c28575b61041a576118d66007547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff75ff00000000000000000000000000000000000000000060ff8360a81c161560a81b16911617600755565b50336001600160a01b03611c446006546001600160a01b031690565b161415611bd2565b611c64915060203d811161048f576104818183610b20565b38611bc8565b346102765760803660031901126102765767ffffffffffffffff60043581811161027657611c9c903690600401610b95565b60243582811161027657611cb4903690600401610b95565b9060443583811161027657611ccd903690600401610b95565b60643593841161027657611ce8610418943690600401611686565b939092611fdb565b6001600160a01b03600654163303611d0457565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b90816020910312610276575161ffff811681036102765790565b6040513d6000823e3d90fd5b818110611d79575050565b60008155600101611d6e565b90601f8211611d92575050565b611ddc9160086000527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3906020601f840160051c83019310611dde575b601f0160051c0190611d6e565b565b9091508190611dcf565b9190601f8111611df757505050565b611ddc926000526020600020906020601f840160051c83019310611dde57601f0160051c0190611d6e565b919091825167ffffffffffffffff8111610ae357611e4a81611e448454610dbd565b84611de8565b602080601f8311600114611e86575081929394600092611e7b575b50508160011b916000199060031b1c1916179055565b015190503880611e65565b90601f19831695611e9c85600052602060002090565b926000905b888210611ed957505083600195969710611ec0575b505050811b019055565b015160001960f88460031b161c19169055388080611eb6565b80600185968294968601518155019501930190611ea1565b90815167ffffffffffffffff8111610ae357611f1781611f12600854610dbd565b611d85565b602080601f8311600114611f535750819293600092611f48575b50508160011b916000199060031b1c191617600855565b015190503880611f31565b90601f19831694611f8660086000527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee390565b926000905b878210611fc3575050836001959610611faa575b505050811b01600855565b015160001960f88460031b161c19169055388080611f9f565b80600185968294968601518155019501930190611f8b565b93929190611ff46103a76007546001600160a01b031690565b6040516352ebc13f60e11b815233600482015290602090829060249082905afa908115610496576102149161ffff91600091612066575b5016141580612042575b61041a57611ddc94612330565b50336001600160a01b0361205e6006546001600160a01b031690565b161415612035565b61207e915060203d811161048f576104818183610b20565b3861202b565b67ffffffffffffffff8111610ae35760051b60200190565b634e487b7160e01b600052603260045260246000fd5b600b5481101561101057600b60005260021b7f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90190600090565b634e487b7160e01b600052601160045260246000fd5b61210c8154610dbd565b9081612116575050565b81601f60009311600114612128575055565b908083918252612147601f60208420940160051c840160018501611d6e565b5555565b815191680100000000000000008311610ae35781548383558084106121ae575b50612180602080920192600052602060002090565b6000925b848410612192575050505050565b600183826121a283945186611e22565b01920193019290612184565b8260005283602060002091820191015b8181106121cb575061216b565b806121d7600192612102565b016121be565b600b549068010000000000000000821015610ae357612203600192838101600b556120b2565b91909161232b57805182546001600160a01b0319166001600160a01b03919091161782558282016020808301519485519167ffffffffffffffff8311610ae357612257836122518654610dbd565b86611de8565b80601f84116001146122b157509180806060959360039795611ddc9a6000946122a6575b50501b9160001990871b1c19161790555b61229d604082015160028601611e22565b0151910161214b565b01519250388061227b565b9193949596601f1984166122ca87600052602060002090565b936000905b82821061231457505092606095928592611ddc9a999660039996106122fc575b505050811b01905561228c565b015160001983891b60f8161c191690553880806122ef565b8088869782949787015181550196019401906122cf565b610da7565b9094939291600184166123f8576040519361234a85610ac7565b60009182865260209788870190606082526040880191606083526001600160a01b0361237d60608b019860608a52612439565b168952525261238b81612084565b936123996040519586610b20565b8185528785019160051b8101923684116105d75781925b8484106123c8575050505050611ddc939450526121dd565b833567ffffffffffffffff81116123f4578a916123e9839236908701610b95565b8152019301926123b0565b8280fd5b60046040517f91d77e6d000000000000000000000000000000000000000000000000000000008152fd5b906124356020928281519485920161049b565b0190565b612503612513602e604051612476602182602081019760008952612466815180926020868601910161049b565b8101036001810184520182610b20565b8051946040519485927fffffffff0000000000000000000000000000000000000000000000000000000060208501987f63000000000000000000000000000000000000000000000000000000000000008a5260e01b1660218501527f80600e6000396000f3000000000000000000000000000000000000000000000060258501525180928585019061049b565b810103600e810184520182610b20565b51906000f0906001600160a01b0382161561252a57565b60046040517f08d4abb6000000000000000000000000000000000000000000000000000000008152fd5b97969594939291906125716103a76007546001600160a01b031690565b6040516352ebc13f60e11b815233600482015290602090829060249082905afa908115610496576102149161ffff916000916125e3575b50161415806125bf575b61041a57611ddc98612954565b50336001600160a01b036125db6006546001600160a01b031690565b1614156125b2565b6125fb915060203d811161048f576104818183610b20565b386125a8565b906040805161260f81610ac7565b80936001600160a01b0381541682528251600360019261263c8361263581878501610df7565b0384610b20565b60209283860152855161265d816126568160028601610df7565b0382610b20565b868601520180549161266e83612084565b9561267b81519788610b20565b8387526000928352818320908288015b85851061269f575050505050505060600152565b8684819284516126b381612656818a610df7565b81520193019401939161268b565b90929167ffffffffffffffff8111610ae3576126e181611e448454610dbd565b6000601f821160011461271a578192939460009261270f5750508160011b916000199060031b1c1916179055565b013590503880611e65565b601f1982169461272f84600052602060002090565b91805b87811061276957508360019596971061274f57505050811b019055565b0135600019600384901b60f8161c19169055388080611eb6565b90926020600181928686013581550194019101612732565b6003548110156110105760036000527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0190600090565b600c5481101561101057600c6000527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c70190600090565b80548210156110105760005260206000200190600090565b8054801561286e57600019019061281e82826127ef565b61232b5761282c8154610dbd565b908161283757505055565b81601f6000931160011461284a57505555565b908083918252612869601f60208420940160051c840160018501611d6e565b555555565b634e487b7160e01b600052603160045260246000fd5b91908110156110105760051b81013590601e198136030182121561027657019081359167ffffffffffffffff8311610276576020018236038113610276579190565b90611ddc6128da9260405193848092610df7565b0383610b20565b92919061232b57611ddc926126c1565b90600182018092116128ff57565b6120ec565b90600282018092116128ff57565b919082018092116128ff57565b919091805468010000000000000000811015610ae357612944916001820181556127ef565b92909261232b57611ddc926126c1565b96949293909795916001988988166123f85789956129d79360409361297b61091f8d6120b2565b936129a961299861299387516001600160a01b031690565b612c2f565b6129a3368585610b5e565b90612c8c565b612bd9575b50506129c360208401516129a3368486610b5e565b612bc4575b505001516129a3368486610b5e565b612ba7575b505090935b612b6b575b806000915b612a59575b505b8181106129ff5750505050565b612a5490612a4f612a0f856120b2565b50612a29612a1e84878a612884565b90600380940161291f565b612a32866120b2565b50612a46612a3f856128f1565b878a612884565b9290910161291f565b612904565b6129f2565b9390612a64846120b2565b50600380910154821015612b63579081612ab1612aa96129a3612a9585612afc97612a8e8c6120b2565b50016127ef565b50612aa1868a8a612884565b9390916128c6565b923691610b5e565b612b41575b612af1612aa96129a3612add612acb8a6120b2565b5085612ad6886128f1565b91016127ef565b50612aa1612aea876128f1565b8a8a612884565b612b04575b50612904565b9093806129eb565b612b35612b3b91612b1e612b17856128f1565b8888612884565b929091612b2a8a6120b2565b5090612ad6876128f1565b906128e1565b38612af6565b612b5e612b4f838787612884565b90612b358585612a8e8c6120b2565b612ab6565b5090936129f0565b9283612b76846120b2565b50836003809201541115612b9f57612b9890612b91866120b2565b5001612807565b90936129e1565b5050926129e6565b612bbd916002612bb6886120b2565b50016126c1565b38806129dc565b612bd29188612bb68d6120b2565b38806129c8565b612beb612bf091612c15933691610b5e565b612439565b612bf98d6120b2565b50906001600160a01b03166001600160a01b0319825416179055565b38806129ae565b60405190612c2982610ae8565b60008252565b90813b8015612c765780600111612c76576000190160011980821015612c6f57505b600160405193601f19603f840116850160405282855260208501903c565b9050612c51565b509050604051612c8581610ae8565b6000815290565b90815181519081811493841594612ca5575b5050505090565b602092939450820120920120141538808080612c9e565b60405190612cc982610b04565b600182527f5b000000000000000000000000000000000000000000000000000000000000006020830152565b80518210156110105760209160051b010190565b6021611ddc919392936040519481612d2b87935180926020808701910161049b565b8201612d40825180936020808501910161049b565b01600b60fa1b6020820152036001810185520183610b20565b60405190612d6682610b04565b600482527f6e616d65000000000000000000000000000000000000000000000000000000006020830152565b6020611ddc919392936040519481612db3879351809286808701910161049b565b8201612dc78251809386808501910161049b565b01038085520183610b20565b929094939160405195869460208601693d913730b6b2911d101160b11b905280519081602a88019160200191612e089261049b565b8501602a81017f222c20226964223a000000000000000000000000000000000000000000000000905281519182603283019160200191612e479261049b565b01603281017f2c20226465736372697074696f6e223a22000000000000000000000000000000905281519182604383019160200191612e859261049b565b01604301612ec5906025907f222c22696d616765223a22646174613a696d6167652f7376672b786d6c3b62618152641cd94d8d0b60da1b60208201520190565b808251602081940191612ed79261049b565b01612f01817f222c2261747472696275746573223a205b0000000000000000000000000000009052565b601101612f0d91612422565b615d7d60f01b815203601d1981018352600201611ddc9083610b20565b90611ddc602160405184612f4882965180926020808601910161049b565b8101600b60fa1b6020820152036001810185520183610b20565b90611ddc602160405184612f8082965180926020808601910161049b565b81017f5d000000000000000000000000000000000000000000000000000000000000006020820152036001810185520183610b20565b600c5468010000000000000000811015610ae3576001810180600c5581101561101057600c6000527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c70155565b90611ddc603d60405180947f22646174613a696d6167652f7376672b786d6c3b6261736536342c00000000006020830152613048815180926020603b8601910161049b565b810161088b60f21b603b82015203601d810185520183610b20565b906000916000549061307482610dbd565b916001908181169081156130df575060011461308f57505050565b9091929350600080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563906000915b8483106130cc575050500190565b81816020925485870152019201916130be565b60ff191683525050811515909102019150565b9060009160019081549161310583610dbd565b928181169081156130df575060011461311d57505050565b8091929394506000527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6906000915b84831061315a575050500190565b818160209254858701520192019161314c565b9060405191826020917f2200000000000000000000000000000000000000000000000000000000000000838301526000906008546131aa81610dbd565b9060019081811690811561325257506001146131f3575b505092816131db8560029594611ddc97519485920161049b565b0161088b60f21b815203601d19810185520183610b20565b9091925060086000527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3906000915b83831061323b57505050820160210190806131db6131c1565b805489840160210152889550918601918101613222565b60ff1916602180880191909152831515909302860190920193508291506131db90506131c1565b61328d6132886104f492612c2f565b613d43565b6132886101bd60405180937f3c7376672077696474683d223130302522206865696768743d2231303025222060208301527f76696577426f783d223020302032303030302032303030302220786d6c6e733d60408301527f22687474703a2f2f7777772e77332e6f72672f323030302f737667223e00000060608301527f3c7374796c653e7376677b6261636b67726f756e642d636f6c6f723a7472616e607d8301527f73706172656e743b6261636b67726f756e642d696d6167653a75726c28646174609d8301527f613a696d6167652f706e673b6261736536342c0000000000000000000000000060bd83015261339081518092602060d08601910161049b565b81017f293b6261636b67726f756e642d7265706561743a6e6f2d7265706561743b626160d08201527f636b67726f756e642d73697a653a636f6e7461696e3b6261636b67726f756e6460f08201527f2d706f736974696f6e3a63656e7465723b696d6167652d72656e646572696e676101108201527f3a2d7765626b69742d6f7074696d697a652d636f6e74726173743b2d6d732d696101308201527f6e746572706f6c6174696f6e2d6d6f64653a6e6561726573742d6e65696768626101508201527f6f723b696d6167652d72656e646572696e673a2d6d6f7a2d63726973702d65646101708201527f6765733b696d6167652d72656e646572696e673a706978656c617465643b7d3c6101908201527f2f7374796c653e3c2f7376673e000000000000000000000000000000000000006101b08201520361019d810184520182610b20565b906001600160a01b0390816009541692831561358f576040513360601b6bffffffffffffffffffffffff191660208201908152603482019290925261351f816054810161097f565b5190206040519160208301917f19457468657265756d205369676e6564204d6573736167653a0a3332000000008352603c840152603c8352606083019183831067ffffffffffffffff841117610ae35761358a9361358293604052519020613714565b9190916135d9565b161490565b60046040517f74d3551f000000000000000000000000000000000000000000000000000000008152fd5b600511156135c357565b634e487b7160e01b600052602160045260246000fd5b6135e2816135b9565b806135ea5750565b6135f3816135b9565b600181036136405760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b613649816135b9565b600281036136965760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b806136a26003926135b9565b146136a957565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608490fd5b9060418151146000146137425761373e916020820151906060604084015193015160001a9061374c565b9091565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116137c25791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa156104965781516001600160a01b038116156137bc579190565b50600190565b50505050600090600390565b60001981146128ff5760010190565b6003548181111561162e578110156110105760036000527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01546001600160a01b0316801561162e5790565b9081602091031261027657516104f48161024c565b90926104f494936080936001600160a01b038092168452166020830152604082015281606082015201906104be565b3d15613898573d9061387e82610b42565b9161388c6040519384610b20565b82523d6000602084013e565b606090565b929190916138aa82613bc2565b6138b58284866139b4565b823b6138c15750505050565b61390a9260209260006001600160a01b036040518097819682957f150b7a02000000000000000000000000000000000000000000000000000000009b8c8552336004860161383e565b0393165af160009181613984575b506139435761392561386d565b8051908161393e57600460405163f5cd1f5d60e01b8152fd5b602001fd5b7fffffffff0000000000000000000000000000000000000000000000000000000016036139735738808080610e24565b600460405163f5cd1f5d60e01b8152fd5b6139a691925060203d81116139ad575b61399e8183610b20565b810190613829565b9038613918565b503d613994565b6139bd83613bc2565b6139c683612781565b90546001600160a01b03928316929160031b1c8116829003613a6157821691821561102257613a3a90613a03856000526004602052604060002090565b6001600160a01b03198154169055613a1a85612781565b90919082549060031b916001600160a01b03809116831b921b1916179055565b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4565b60046040517f59dc379f000000000000000000000000000000000000000000000000000000008152fd5b6003548110156110105760036000526001600160a01b039081817fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0154161561162e5760005260046020526040600020541690565b916003549182811015610d96576000936001938585805b613b0c576004604051634e23d03560e01b8152fd5b15613b6a575b600090613b246103a761063283612781565b6001600160a01b03851614613b44575b613b3d906137ce565b9086613af7565b96848114613b6057613b58613b3d916137ce565b979050613b34565b5093945050505050565b818110613b125780610d96565b60035481109081613b86575090565b90156110105760036000527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01546001600160a01b0316151590565b6001600160a01b039081613bd5826137dd565b1690813314928315613c28575b50508115613bf3575b50156106c657565b9050600052600560205260ff613c20336040600020906001600160a01b0316600052602052604060002090565b541638613beb565b90919250613c363392613a8b565b1614903880613be2565b906001600160a01b038216918215611022576003549268010000000000000000841015610ae357613c7c849260018401600355613a1a84612781565b60007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4565b603d611ddc919392936040519485917f7b2274726169745f74797065223a2200000000000000000000000000000000006020840152613ced815180926020602f8701910161049b565b82017f222c2276616c7565223a20220000000000000000000000000000000000000000602f820152613d29825180936020603b8501910161049b565b0161227d60f01b603b82015203601d810185520183610b20565b90606091805180613d52575050565b9092506003906002938285830104851b92604051957f4142434445464748494a4b4c4d4e4f505152535455565758595a616263646566601f52603f916106707f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392d5f188352602088018689019360048360208701975b0192835183808260121c16519160009283538181600c1c1651600153818160061c1651895316518653518152019186831015613e06576004908490613dc6565b5050935060009460407f3d3d0000000000000000000000000000000000000000000000000000000000009401604052069004820352528252565b90604051608081019260a0820160405260008452925b6000190192600a906030828206018553049283613e5657809350608091030191601f190191825256fea2646970667358221220481baeff644f64fc9ffef315de69d1c363230e259458b697ea65e18eab2400ea64736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000018a1887d8f138bde097c502139078b2bddbb2ab900000000000000000000000000000000000000000000000000000000000000113133333720416368696576656d656e747300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000073133333741434800000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : name (string): 1337 Achievements
Arg [1] : symbol (string): 1337ACH
Arg [2] : collective (address): 0x18A1887d8f138bdE097c502139078B2bDDbB2aB9
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [2] : 00000000000000000000000018a1887d8f138bde097c502139078b2bddbb2ab9
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000011
Arg [4] : 3133333720416368696576656d656e7473000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [6] : 3133333741434800000000000000000000000000000000000000000000000000
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.