ERC-721
Overview
Max Total Supply
43 OSMPASS
Holders
42
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 OSMPASSLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
OSMPass
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 100 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Base64.sol) pragma solidity ^0.8.0; /** * @dev Provides a set of functions to operate with Base64 strings. * * _Available since v4.5._ */ library Base64 { /** * @dev Base64 Encoding/Decoding Table */ string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /** * @dev Converts a `bytes` to its Bytes64 `string` representation. */ function encode(bytes memory data) internal pure returns (string memory) { /** * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol */ if (data.length == 0) return ""; // Loads the table into memory string memory table = _TABLE; // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter // and split into 4 numbers of 6 bits. // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up // - `data.length + 2` -> Round up // - `/ 3` -> Number of 3-bytes chunks // - `4 *` -> 4 characters for each chunk string memory result = new string(4 * ((data.length + 2) / 3)); /// @solidity memory-safe-assembly assembly { // Prepare the lookup table (skip the first "length" byte) let tablePtr := add(table, 1) // Prepare result pointer, jump over length let resultPtr := add(result, 32) // Run over the input, 3 bytes at a time for { let dataPtr := data let endPtr := add(data, mload(data)) } lt(dataPtr, endPtr) { } { // Advance 3 bytes dataPtr := add(dataPtr, 3) let input := mload(dataPtr) // To write each character, shift the 3 bytes (18 bits) chunk // 4 times in blocks of 6 bits for each character (18, 12, 6, 0) // and apply logical AND with 0x3F which is the number of // the previous character in the ASCII table prior to the Base64 Table // The result is then added to the table to get the character to write, // and finally write it in the result pointer but with a left shift // of 256 (1 byte) - 8 (1 ASCII char) = 248 bits mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F)))) resultPtr := add(resultPtr, 1) // Advance } // When data `bytes` is not exactly 3 bytes long // it is padded with `=` characters at the end switch mod(mload(data), 3) case 1 { mstore8(sub(resultPtr, 1), 0x3d) mstore8(sub(resultPtr, 2), 0x3d) } case 2 { mstore8(sub(resultPtr, 1), 0x3d) } } return result; } }
// 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.8.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) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed 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) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "./EIP712Allowlisting.sol"; import "./Phaseable.sol"; import "./FlexibleMetadata.sol"; import "./Nameable.sol"; import { Phase, PhaseNotActiveYet, PhaseExhausted, WalletMintsFilled } from "./SetPhaseable.sol"; abstract contract Allowable is EIP712Allowlisting { constructor(string memory name, string memory symbol) FlexibleMetadata(name,symbol) { setSigningAddress(msg.sender); setDomainSeparator(name, symbol); initializePhases(); } function initializePhases() internal virtual; function canMint(uint64 phase, uint256 quantity) internal override virtual returns(bool) { uint64 activePhase = activePhase(); if (phase > activePhase) { revert PhaseNotActiveYet(); } uint256 requestedSupply = minted()+quantity; Phase memory requestedPhase = findPhase(phase); if (requestedSupply > requestedPhase.highestSupply) { revert PhaseExhausted(); } uint256 requestedMints = quantity+getAux16(msg.sender)[phase]; if (requestedPhase.maxPerWallet > 0 && requestedMints > requestedPhase.maxPerWallet) { revert WalletMintsFilled(requestedMints); } return true; } } /** * Ordo Signum Machina - 2023 */
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "./Ownable.sol"; import "./Nameable.sol"; import { TokenNonOwner } from "./SetOwnerEnumerable.sol"; import { OwnerEnumerable } from "./OwnerEnumerable.sol"; import { SetApprovable, ApprovableData, TokenNonExistent } from "./SetApprovable.sol"; import { PackableOwnership } from "./PackableOwnership.sol"; abstract contract Approvable is OwnerEnumerable { using SetApprovable for ApprovableData; ApprovableData approvable; function _checkTokenOwner(uint256 tokenId) internal view virtual { if (ownerOf(tokenId) != msg.sender) { revert TokenNonOwner(msg.sender, tokenId); } } function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return approvable.isApprovedForAll(owner,operator); } function approve(address to, uint256 tokenId) public virtual override { _checkTokenOwner(tokenId); approvable.approveForToken(to, tokenId); emit Approval(ownerOf(tokenId), to, tokenId); } function setApprovalForAll(address operator, bool approved) public virtual override { approved ? approvable.approveForContract(operator): approvable.revokeApprovalForContract(operator, msg.sender); } function validateApprovedOrOwner(address spender, uint256 tokenId) internal view { if (!(spender == ownerOf(tokenId) || isApprovedForAll(ownerOf(tokenId), spender) || approvable.getApproved(tokenId) == spender)) { revert TokenNonOwner(spender, tokenId); } } function getApproved(uint256 tokenId) public view virtual override returns (address) { requireMinted(tokenId); return approvable.tokens[tokenId].approval; } function revokeTokenApproval(uint256 tokenId) internal { approvable.revokeTokenApproval(tokenId); } function revokeApprovals(address holder) internal { approvable.revokeApprovals(holder,tokensOwnedBy(holder)); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function requireMinted(uint256 tokenId) internal view virtual { if (!exists(tokenId)) { revert TokenNonExistent(tokenId); } } function exists(uint256 tokenId) internal view virtual override returns (bool) { if (enumerationExists(tokenId)) { return approvable.tokens[tokenId].exists; } return PackableOwnership.exists(tokenId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import { SetAssignable, AssignableData, NotTokenOwner, NotAssigned } from "./SetAssignable.sol"; import { OwnerEnumerable } from "./OwnerEnumerable.sol"; import "./Phaseable.sol"; abstract contract Assignable is Phaseable { using SetAssignable for AssignableData; AssignableData assignables; function assignColdStorage(uint256 tokenId) external { if (msg.sender != ownerOf(tokenId)) { revert NotTokenOwner(); } assignables.addAssignment(msg.sender,tokenId); } function revokeColdStorage(uint256 tokenId) external { if (assignables.findAssignment(msg.sender) != tokenId) { revert NotAssigned(msg.sender); } assignables.removeAssignment(msg.sender); } function revokeAssignments(uint256 tokenId) external { if (msg.sender != ownerOf(tokenId)) { revert NotTokenOwner(); } assignables.revokeAll(tokenId); } function findAssignments(uint256 tokenId) external view returns (address[] memory){ return assignables.findAssignees(tokenId); } function balanceOf(address seekingContract, address owner) external view returns (uint256) { uint256 guardianBalance = balanceOf(owner); if (guardianBalance > 0) { uint256[] memory guardians = tokensOwnedBy(owner); return assignables.iterateGuardiansBalance(guardians, seekingContract, 0); } return 0; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "./EIP712Listable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; bytes32 constant ALLOW_MINT_TYPE = keccak256("Minter(address wallet)"); bytes32 constant BAG_MINT_TYPE = keccak256("Minter(string genesisBagAddress)"); bytes32 constant FREE_MINT_TYPE = keccak256("Minter(string genesisStakedAddress)"); abstract contract EIP712Allowlisting is EIP712Listable { using ECDSA for bytes32; using Strings for uint256; using Strings for uint160; using Strings for address; struct recovered { address receipient; bytes signature; address recovered; address signingKey; } uint256[] empty; function recoverAllowAddress(bytes calldata sig, address recip) public view returns (recovered memory) { // bytes32 digest = keccak256( // abi.encodePacked( // "\x19\x01", // DOM_SEP, // keccak256(abi.encode(ALLOW_MINT_TYPE, recip)) // ) // ); bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(ALLOW_MINT_TYPE, recip))); address recoveredAddress = digest.recover(sig); return recovered(recip, sig, recoveredAddress, sigKey); } modifier requiresAllowSig(bytes calldata sig, address recip) { require(sigKey != address(0), "allowlist not enabled"); bytes32 digest = keccak256( abi.encodePacked( "\x19\x01", DOM_SEP, keccak256(abi.encode(ALLOW_MINT_TYPE, recip)) ) ); address recovery = digest.recover(sig); require(recovery == sigKey, "invalid signature"); require(msg.sender == recip, "invalid signature"); _; } struct recoveredBag { address receipient; bytes signature; address recovered; address signingKey; string bagging; uint256 total; } function recoverClaimSig(bytes calldata sig, address recip, uint256[] memory bag) public view returns (recoveredBag memory) { return recoverClaimSig(sig, recip, bag, empty); } function recoverClaimSig(bytes calldata sig, address recip, uint256[] memory bag, uint256[] memory staked) public view returns (recoveredBag memory) { require(sigKey != address(0), "allowlist not enabled"); uint total = uint(uint160(recip)); for (uint i; i < bag.length; i++) { total += bag[i]; } for (uint i; i < staked.length; i++) { total += staked[i]; } string memory bagged = total.toString(); bytes32 digest = keccak256( abi.encodePacked( "\x19\x01", DOM_SEP, keccak256(abi.encode(FREE_MINT_TYPE,keccak256(abi.encodePacked(bagged)))) ) ); address recovery = digest.recover(sig); return recoveredBag(recip, sig, recovery, sigKey, bagged, total); } modifier requiresBagSig(bytes calldata sig, address recip, uint256[] memory bag) { require(sigKey != address(0), "allowlist not enabled"); uint total = uint(uint160(recip)); for (uint i; i < bag.length; i++) { total += bag[i]; } string memory bagged = total.toString(); bytes32 digest = keccak256( abi.encodePacked( "\x19\x01", DOM_SEP, keccak256(abi.encode(FREE_MINT_TYPE,keccak256(abi.encodePacked(bagged)))) ) ); address recovery = digest.recover(sig); require(recovery == sigKey, "invalid signature"); require(msg.sender == recip, "invalid signature"); _; } modifier requiresClaimSig(bytes calldata sig, address recip, uint256[] memory bag, uint256[] memory staked) { require(sigKey != address(0), "allowlist not enabled"); uint total = uint(uint160(recip)); for (uint i; i < bag.length; i++) { total += bag[i]; } for (uint i; i < staked.length; i++) { total += staked[i]; } string memory bagged = total.toString(); bytes32 digest = keccak256( abi.encodePacked( "\x19\x01", DOM_SEP, keccak256(abi.encode(FREE_MINT_TYPE,keccak256(abi.encodePacked(bagged)))) ) ); address recovery = digest.recover(sig); require(recovery == sigKey, "invalid signature"); require(msg.sender == recip, "invalid signature"); _; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "./Assignable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; abstract contract EIP712Listable is Assignable { using ECDSA for bytes32; address internal sigKey = address(0); bytes32 internal DOM_SEP; uint256 chainid = 420; function setDomainSeparator(string memory _name, string memory _version) internal { DOM_SEP = keccak256( abi.encode( keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ), keccak256(bytes(_name)), keccak256(bytes(_version)), chainid, address(this) ) ); } function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(DOM_SEP, structHash); } function getSigningAddress() public view returns (address) { return sigKey; } function setSigningAddress(address _sigKey) public onlyOwner { sigKey = _sigKey; } function isOwner() public view returns (bool) { return msg.sender == owner(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "./Ownable.sol"; import "./Nameable.sol"; import { DEFAULT, FLAG, PRE, Supplement, SetFlexibleMetadata, FlexibleMetadataData } from "./SetFlexibleMetadata.sol"; abstract contract FlexibleMetadata is Ownable, Context, ERC165, IERC721, Nameable { using SetFlexibleMetadata for FlexibleMetadataData; FlexibleMetadataData flexible; constructor(string memory _name, string memory _symbol) Nameable(_name,_symbol) { } function setContractUri(string memory uri) external onlyOwner { flexible.setContractMetadataURI(uri); } function reveal(bool _reveal) external onlyOwner { flexible.reveal(_reveal); } function setTokenUri(string memory uri, uint256 tokenType) external onlyOwner { tokenType == FLAG ? flexible.setFlaggedTokenMetadataURI(uri): (tokenType == PRE) ? flexible.setPrerevealTokenMetadataURI(uri): flexible.setDefaultTokenMetadataURI(uri); } function setSupplementalTokenUri(uint256 key, string memory uri) external onlyOwner { flexible.setSupplementalTokenMetadataURI(key,uri); } function flagToken(uint256 tokenId, bool isFlagged) external onlyOwner { flexible.flagToken(tokenId,isFlagged); } function setSupplemental(uint256 tokenId, bool isSupplemental, uint256 key) internal { if (isSupplemental) { flexible.supplemental[tokenId] = Supplement(key,true); } else { delete flexible.supplemental[tokenId]; } } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165,IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { return flexible.getTokenMetadata(tokenId); } function contractURI() external view returns (string memory) { return flexible.getContractMetadata(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "./Approvable.sol"; import { SetLockable, LockableStatus, LockableData, WalletLockedByOwner } from "./SetLockable.sol"; abstract contract Lockable is Approvable { using SetLockable for LockableData; LockableData lockable; bool soulBound = false; function custodianOf(uint256 id) public view returns (address) { return lockable.findCustodian(ownerOf(id)); } function lockWallet(uint256 id) public { revokeApprovals(ownerOf(id)); lockable.lockWallet(ownerOf(id)); } function unlockWallet(uint256 id) public { lockable.unlockWallet(ownerOf(id)); } function _forceUnlock(uint256 id) internal { lockable.forceUnlock(ownerOf(id)); } function setCustodian(uint256 id, address custodianAddress) public { lockable.setCustodian(custodianAddress,ownerOf(id)); } function isLocked(uint256 id) public view returns (bool) { if (enumerationExists(id)) { return lockable.lockableStatus[ownerOf(id)].isLocked; } return false; } function lockedSince(uint256 id) public view returns (uint256) { return lockable.lockableStatus[ownerOf(id)].lockedAt; } function validateLock(uint256 tokenId) internal view { if (isLocked(tokenId)) { revert WalletLockedByOwner(); } } function soulBind() internal { soulBound = true; } function releaseSoul() internal { soulBound = false; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "./Lockable.sol"; import { LockableStatus,InvalidTransferRecipient,ContractIsNot721Receiver } from "./SetLockable.sol"; abstract contract LockableTransferrable is Lockable { using Address for address; function approve(address to, uint256 tokenId) public virtual override { validateLock(tokenId); super.approve(to,tokenId); } function setApprovalForAll(address operator, bool approved) public virtual override { if (tokensOwnedBy(msg.sender).length > 0) { validateLock(tokensOwnedBy(msg.sender)[0]); } super.setApprovalForAll(operator,approved); } function transferFrom( address from, address to, uint256 tokenId ) public virtual override { validateApprovedOrOwner(msg.sender, tokenId); validateLock(tokenId); _transfer(from,to,tokenId); } function _transfer( address from, address to, uint256 tokenId ) internal { if(to == address(0)) { revert InvalidTransferRecipient(); } revokeTokenApproval(tokenId); if (enumerationExists(tokenId)) { swapOwner(from,to,tokenId); } packedTransferFrom(from, to, tokenId); completeTransfer(from,to,tokenId); } function completeTransfer( address from, address to, uint256 tokenId) internal { emit Transfer(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { validateApprovedOrOwner(msg.sender, tokenId); validateLock(tokenId); _safeTransfer(from, to, tokenId, data); } function _safeTransfer( address from, address to, uint256 tokenId, bytes memory data ) internal virtual { if (!_checkOnERC721Received(from, to, tokenId, data)) { revert ContractIsNot721Receiver(); } _transfer(from, to, tokenId); } function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(msg.sender, from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert InvalidTransferRecipient(); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "./LockableTransferrable.sol"; import { TokenOwnership } from "./SetOwnerEnumerable.sol"; error InvalidRecipient(address zero); error TokenAlreadyMinted(uint256 tokenId); error InvalidToken(uint256 tokenId); error MintIsNotLive(); abstract contract Mintable is LockableTransferrable { mapping(address => mapping(uint256 => bool)) claimed; bool isLive; function setMintLive(bool _isLive) public onlyOwner { isLive = _isLive; } function hasBeenClaimed(uint256 tokenId, address addressed) public view returns (bool) { return claimed[addressed][tokenId]; } function claim(uint256 tokenId, address addressed) internal { claimed[addressed][tokenId] = true; } function getSenderMints() internal view returns (uint256) { return numberMinted(msg.sender); } function _mint(address to, uint256 quantity, bool enumerate) internal virtual returns (uint256) { if (!isLive) { revert MintIsNotLive(); } if (to == address(0)) { revert InvalidRecipient(to); } return enumerate ? enumerateMint(to, quantity) : packedMint(to, quantity); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; abstract contract Nameable is IERC721Metadata { string named; string symbolic; constructor(string memory _name, string memory _symbol) { named = _name; symbolic = _symbol; } function name() public virtual override view returns (string memory) { return named; } function symbol() public virtual override view returns (string memory) { return symbolic; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "./Allowable.sol"; import "./PackableOwnership.sol"; import "@openzeppelin/contracts/utils/Base64.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import { SetMetadataRenderable, RenderableData } from "./SetMetadataRenderable.sol"; error Unphased(); /** ╓µ▄▄▓███████████████▓▄▄╓ ,╔▄██████████████████████████████▓▄, ,▄▓███████████████████████████████████████▄, ╓▄██████████████████████████████████████████████▄╓ ▄████████████████████████████████████████████████████▄ ,▄████████████████████████████████████████████████████████▓, ▄█████▀▀██████▀▀█████████████████████████████████████████████▓ ╔██████▌ ╟████▒ ¡███████████████████████████████████████████████▄ ,▓████████ "▀██▀ ▐█████████████████████████████████████████████████, ]██████████▄ ╣██████████████████████████████████████████████████ε ╔█████████████▓▄▄▄▄▓█████████████████████████████████████████████████████▄ ]█████████████▀╙╙╙╙╙╙▀████████▀╙╙╙╙╙╙╙╙▀██▌╙╙╙╙╠██╙╙╙╙▀███▀╙╙╙╙╚███████████▒ ,▓███████████╙ ╚████╩ ]██▌ ▐▒ ╚█` ╙███████████ ╟███████████⌐ , ╟██▒ ▐██▌ ╟███████████ ]███████████▌ ▓██▒ "██⌐ ╔▄▓▓▄▄╣██▌ .▄█▓, .▓█▓ ╟███████████▒ ║███████████▒ ]████ ╟█▒ ]█████████▌ ▐███▒ ╟███⌐ ╟███████████▌ ▓███████████░ ▐████ ╟█▌ ╟████████▌ ║███▒ ╟███⌐ ╟████████████ ████████████ ║████ ║██▒ ╚███████▌ ║███▒ ╟███⌐ ╟████████████ ████████████ ║████ ▐███▓ ╙██████▌ ║███▒ ╟███⌐ ╟████████████ ████████████ ║████ ▐█████▄ ╙████▌ ║███▒ ╟███⌐ ╟████████████ ╟███████████ ║████ ▐███████ ╙███▌ ║███▒ ╟███⌐ ╟████████████ ▐███████████░ ║████ ║████████ ▐██▌ ║███▒ ╟███⌐ ╟███████████▌ ╟██████████▒ ╚████ ╟████████▌ ╟█▌ ║███▒ ╟███⌐ ╟███████████ ╙██████████▌ ███▒ ,▓██▀█████" ╟█▌ ▐███▒ ╟███⌐ ╟██████████╩ ╚██████████ ╙▀╩ ║██▌ ╫█▌ ▐███▒ ╟███⌐ ╟█████████▌ ╟█████████▓ ;███▒ ▐██▌ ▐███▒ ╟███⌐ ╟████████▌ ╚██████████, .▄████µ ,▓███▒ ▐███░ ╟███⌐ ╟███████▌ ╙████████████▓▓▓█████████████▓▓██████████████████████████████████████╩ └╫█████████████████████████████████████████████████████████████████" ╙██████████████████████████████████████████████████████████████╩ ╙██████████████████████████████████████████████████████████▀ ╙██████████████████████████████████████████████████████╨ ╚████████████████████████████████████████████████▀" `╙██████████████████████████████████████████▀` ╙▀██████████████████████████████████▀╙ ╙╙▀██████████████████████▀▀╙ */ /// @title Horde OSM Pass /// @author @OsmOnomous https://osm.tools contract OSMPass is Allowable { using Strings for uint256; using SetMetadataRenderable for RenderableData; RenderableData renderings; // minting phases uint64 ALLOW_PHASE = 0; // supply and allowances uint64 MAX_SUPPLY = 1001; // allowed phase uint64 ALLOW_PER = 1; uint64 ALLOW_SUPPLY = 1001; uint64 ALLOW_PRICE = 0; /** * Initialization */ /// @notice contract is initialized as soul bound, no transfers or approvals allowed constructor() Allowable("Horde OSM Pass","OSMPASS") { soulBind(); initializePhases(); } /// @notice initialization of minting phases function initializePhases() internal virtual override { Phase[] storage phases = getPhases(); // Phase struct // name, maxPerWallet (0 indicates no limit), maxMint, price phases.push(Phase(ALLOW_PHASE, ALLOW_PER, ALLOW_SUPPLY, ALLOW_PRICE)); initialize(phases,MAX_SUPPLY); } /** * Minting & Burning */ /// @notice minting ALLOW_PHASE, requires trusted signature, maximum quantity 1 per wallet /// @param signature bytes trusted signature function allowlistMint(bytes calldata signature) external requiresAllowSig(signature,msg.sender) { phasedMint(ALLOW_PHASE, 1, false); uint16[4] memory aux = getAux16(msg.sender); aux[ALLOW_PHASE] = aux[ALLOW_PHASE]+1; setAux32(msg.sender, aux); } /// @notice burn function /// @param tokenId uint256 token id to burn function burn(uint256 tokenId) external { validateApprovedOrOwner(msg.sender, tokenId); validateLock(tokenId); if (enumerationExists(tokenId)) { enumerateBurn(msg.sender,tokenId); selfDestruct(tokenId); } packedBurn(tokenId); } /** * Owner Utility and Managment of TREASURY */ /// @notice empower function /// @param tokenId uint256 token id to empower function empower(uint256 tokenId) external { validateApprovedOrOwner(msg.sender, tokenId); if (!enumerationExists(tokenId)) { enumerateToken(msg.sender, tokenId); } } /// @notice max supply of tokens allowed function maxSupply() external view returns (uint256) { return getMaxSupply(); } function encodedTokenURI(uint256 tokenId) public view returns (string memory) { bytes memory dataURI = abi.encodePacked( '{', '"name": "Horde OSM Pass #', tokenId.toString(), '","description": "',string(renderings.getDescription()),'"', ',"image":"',string(renderings.getImage()),'"', ',"external_url":"https://osm.tools"', ',"attributes":', string(renderings.getAttributes()), '}' ); return string( abi.encodePacked( "data:application/json;base64,", Base64.encode(dataURI) ) ); } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { return encodedTokenURI(tokenId); } } /** * Ordo Signum Machina - 2023 */
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; /** * @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 { address private _owner; error CallerIsNotOwner(address caller); error OwnerCannotBeZeroAddress(); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(msg.sender); } /** * @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 { if (owner() != msg.sender) { revert CallerIsNotOwner(msg.sender); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if(newOwner == address(0)) { revert OwnerCannotBeZeroAddress(); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import { SetOwnerEnumerable, OwnerEnumerableData, TokenNonOwner, InvalidOwner, TokenOwnership } from "./SetOwnerEnumerable.sol"; import { PackableOwnership } from "./PackableOwnership.sol"; abstract contract OwnerEnumerable is PackableOwnership { using SetOwnerEnumerable for OwnerEnumerableData; OwnerEnumerableData enumerable; function tokensOwnedBy(address holder) public view returns (uint256[] memory) { uint256[] memory empty; if (enumerable.isOwnerEnumerated(holder)) { return enumerable.findTokensOwned(holder); } return empty; } function enumeratedBalanceOf(address owner) public view virtual returns (uint256) { validateNonZeroAddress(owner); return enumerable.ownedTokens[owner].length; } function validateNonZeroAddress(address owner) internal pure { if(owner == address(0)) { revert InvalidOwner(); } } function enumerateToken(address to, uint256 tokenId) internal { enumerable.addTokenToEnumeration(to, tokenId); } function enumerateMint(address to, uint256 quantity) internal returns (uint256) { uint256 start = minted()+1; uint256 end = packedMint(to,quantity); for (uint256 i = start; i <= end; i++) { enumerateToken(to, i); } return end; } function enumerateBurn(address from, uint256 tokenId) internal { enumerable.addBurnToEnumeration(from, tokenId); enumerable.removeTokenFromEnumeration(from, tokenId); } function swapOwner(address from, address to, uint256 tokenId) internal { enumerable.removeTokenFromEnumeration(from, tokenId); enumerable.addTokenToEnumeration(to, tokenId); } function enumerationExists(uint256 tokenId) internal view virtual returns (bool) { return enumerable.tokens[tokenId].exists; } function selfDestruct(uint256 tokenId) internal { delete enumerable.tokens[tokenId]; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import { FlexibleMetadata } from "./FlexibleMetadata.sol"; import { PackableData, SetPackable } from "./SetPackable.sol"; struct TokenApproval { address approval; bool exists; } abstract contract PackableOwnership is FlexibleMetadata { using SetPackable for PackableData; PackableData packable; constructor() { packable._currentIndex = packable._startTokenId(); } function numberMinted(address minter) public view returns (uint256) { return packable._numberMinted(minter); } function ownerOf(uint256 tokenId) public view returns (address) { return packable.ownerOf(tokenId); } function balanceOf(address owner) public view virtual override returns (uint256) { return packable.balanceOf(owner); } function totalSupply() public view virtual returns (uint256) { return packable.totalSupply(); } function minted() internal view virtual returns (uint256) { return packable._currentIndex; } function exists(uint256 tokenId) internal view virtual returns (bool) { return packable._exists(tokenId); } function packedTransferFrom( address from, address to, uint256 tokenId ) internal { packable.transferFrom(from,to,tokenId); } function packedMint(address to, uint256 quantity) internal returns (uint256) { return packable._mint(to,quantity); } function packedBurn(uint256 tokenId) internal { packable._burn(tokenId); } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ // function getAux(address owner) public view returns (uint32[2] memory) { // return packable.unpack64(packable._getAux(owner)); // } function getAux16(address owner) internal view returns (uint16[4] memory) { return packable.getAux16(owner); } // function getAux8(address owner) public view returns (uint8[8] memory) { // uint32[2] memory pack32 = packable.unpack64(packable._getAux(owner)); // uint16[2] memory pack16a = packable.unpack32(pack32[0]); // uint8[2] memory pack8a1 = packable.unpack16(pack16a[0]); // uint8[2] memory pack8a2 = packable.unpack16(pack16a[1]); // uint16[2] memory pack16b = packable.unpack32(pack32[1]); // uint8[2] memory pack8b1 = packable.unpack16(pack16b[0]); // uint8[2] memory pack8b2 = packable.unpack16(pack16b[1]); // return [pack8a1[0],pack8a1[1],pack8a2[0],pack8a2[1],pack8b1[0],pack8b1[1],pack8b2[0],pack8b2[1]]; // } /** * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ // function setAux(address owner, uint32[2] memory aux) internal { // packable._setAux(owner,packable.pack64(aux[0],aux[1])); // } function setAux32(address owner, uint16[4] memory aux) internal { packable._setAux(owner,packable.pack64(packable.pack32(aux[0],aux[1]),packable.pack32(aux[2],aux[3]))); } // function setAux16(address owner, uint8[8] memory aux) internal { // packable._setAux(owner,packable.pack64( // packable.pack32( // packable.pack16(aux[0],aux[1]), // packable.pack16(aux[2],aux[3]) // ), // packable.pack32( // packable.pack16(aux[4],aux[5]), // packable.pack16(aux[6],aux[7]) // ) // )); // } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import { SetPhaseable, PhaseableData, MintIsNotAllowedRightNow, ExceedsMaxSupply, Phase } from "./SetPhaseable.sol"; import { OwnerEnumerable } from "./OwnerEnumerable.sol"; import "./Mintable.sol"; abstract contract Phaseable is Mintable { using SetPhaseable for PhaseableData; PhaseableData phaseables; function canMint(uint64 phase, uint256 quantity) internal virtual returns(bool); function initialize(Phase[] storage phases, uint256 maxSupply) internal { phaseables.initialize(phases,maxSupply); } function phasedMint(uint64 phase, uint256 quantity, bool enumerate) internal returns (uint256) { if (!canMint(phase, quantity)) { revert MintIsNotAllowedRightNow(); } if (minted()+quantity > phaseables.getMaxSupply()) { revert ExceedsMaxSupply(); } return _mint(msg.sender,quantity,enumerate); } function airdrop(address recipient, uint256 quantity, bool enumerate) public onlyOwner { if (minted()+quantity > phaseables.getMaxSupply()) { revert ExceedsMaxSupply(); } _mint(recipient,quantity, enumerate); } function activePhase() internal view returns (uint64) { return phaseables.getActivePhase(); } function nextPhase() public onlyOwner { phaseables.startNextPhase(); } function previousPhase() public onlyOwner { phaseables.revertPhase(); } function getPhases() internal view returns (Phase[] storage) { return phaseables.getPhases(); } function findPhase(uint256 phaseId) internal view returns (Phase memory) { return phaseables.findPhase(phaseId); } function updatePhase(uint256 phaseId, Phase memory phase) internal { Phase[] storage existing = phaseables.getPhases(); existing[phaseId] = phase; } function getMaxSupply() internal view returns (uint256) { return phaseables.getMaxSupply(); } function setMaxSupply(uint256 newMax) internal { phaseables.setMaxSupply(newMax); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; struct ApprovableData { mapping(address => uint256) contractApprovals; mapping(address => address[]) approvedForAll; mapping(address => mapping(address => uint256)) approvedForAllIndex; mapping(uint256 => uint256) tokenApprovals; mapping(uint256 => TokenApproval[]) approvedForToken; mapping(uint256 => mapping(address => uint256)) approvedForTokenIndex; mapping(uint256 => TokenApproval) tokens; bool exists; } struct TokenApproval { address approval; bool exists; } error AlreadyApproved(address operator, uint256 tokenId); error AlreadyApprovedContract(address operator); error AlreadyRevoked(address operator, uint256 tokenId); error AlreadyRevokedContract(address operator); error TokenNonExistent(uint256 tokenId); library SetApprovable { /** * @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); function isApprovedForAll(ApprovableData storage self, address owner, address operator) public view returns (bool) { return self.approvedForAll[owner].length > self.approvedForAllIndex[owner][operator] ? (self.approvedForAll[owner][self.approvedForAllIndex[owner][operator]] != address(0)) : false; } function revokeApprovals(ApprovableData storage self, address owner, uint256[] memory ownedTokens) public { for (uint256 i = 0; i < ownedTokens.length; i++) { revokeTokenApproval(self,ownedTokens[i]); } address[] memory contractApprovals = self.approvedForAll[owner]; for (uint256 i = 0; i < contractApprovals.length; i++) { address approved = contractApprovals[i]; revokeApprovalForContract(self, approved, owner); } } function revokeTokenApproval(ApprovableData storage self, uint256 token) public { TokenApproval[] memory approvals = self.approvedForToken[token]; for (uint256 j = 0; j < approvals.length; j++) { revokeApprovalForToken(self, approvals[j].approval, token); } } function getApproved(ApprovableData storage self, uint256 tokenId) public view returns (address) { return self.approvedForToken[tokenId].length > 0 ? self.approvedForToken[tokenId][0].approval : address(0); } function approveForToken(ApprovableData storage self, address operator, uint256 tokenId) public { uint256 index = self.approvedForTokenIndex[tokenId][operator]; if (index < self.approvedForToken[tokenId].length) { if (self.approvedForToken[tokenId][index].exists) { revert AlreadyApproved(operator, tokenId); } } self.approvedForToken[tokenId].push(TokenApproval(operator,true)); self.approvedForTokenIndex[tokenId][operator] = self.approvedForToken[tokenId].length-1; self.tokenApprovals[tokenId]++; emit Approval(msg.sender, operator, tokenId); } function revokeApprovalForToken(ApprovableData storage self, address revoked, uint256 tokenId) public { uint256 index = self.approvedForTokenIndex[tokenId][revoked]; if (!self.approvedForToken[tokenId][index].exists) { revert AlreadyRevoked(revoked,tokenId); } // When the token to delete is not the last token, the swap operation is unnecessary if (index != self.approvedForToken[tokenId].length - 1) { TokenApproval storage tmp = self.approvedForToken[tokenId][self.approvedForToken[tokenId].length - 1]; self.approvedForToken[tokenId][self.approvedForToken[tokenId].length - 1] = self.approvedForToken[tokenId][index]; self.approvedForToken[tokenId][index] = tmp; self.approvedForTokenIndex[tokenId][tmp.approval] = index; } // This also deletes the contents at the last position of the array delete self.approvedForTokenIndex[tokenId][revoked]; self.approvedForToken[tokenId].pop(); self.tokenApprovals[tokenId]--; } function approveForContract(ApprovableData storage self, address operator) public { uint256 index = self.approvedForAllIndex[msg.sender][operator]; if (self.approvedForAll[msg.sender].length > index) { if (self.approvedForAll[msg.sender][index] != address(0)) { revert AlreadyApprovedContract(self.approvedForAll[msg.sender][index]); } } self.approvedForAll[msg.sender].push(operator); self.approvedForAllIndex[msg.sender][operator] = self.approvedForAll[msg.sender].length-1; self.contractApprovals[msg.sender]++; emit ApprovalForAll(msg.sender, operator, true); } function revokeApprovalForContract(ApprovableData storage self, address revoked, address owner) public { uint256 index = self.approvedForAllIndex[owner][revoked]; address revokee = self.approvedForAll[owner][index]; if (revokee != revoked) { revert AlreadyRevokedContract(revoked); } // When the token to delete is not the last token, the swap operation is unnecessary if (index != self.approvedForAll[owner].length - 1) { address tmp = self.approvedForAll[owner][self.approvedForAll[owner].length - 1]; self.approvedForAll[owner][self.approvedForAll[owner].length - 1] = self.approvedForAll[owner][index]; self.approvedForAll[owner][index] = tmp; self.approvedForAllIndex[owner][tmp] = index; } // This also deletes the contents at the last position of the array delete self.approvedForAllIndex[owner][revoked]; self.approvedForAll[owner].pop(); self.contractApprovals[owner]--; emit ApprovalForAll(owner, revoked, false); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; struct AssignableData { mapping(uint256 => address[]) assignments; mapping(address => mapping(uint256 => uint256)) assignmentIndex; mapping(address => uint256) assigned; } error AlreadyAssigned(uint256 tokenId); error NotAssigned(address to); error NotTokenOwner(); interface Supportable { function supportsInterface(bytes4 interfaceId) external view returns (bool); function balanceOf(address owner) external view returns (uint256); function ownerOf(uint256 tokenId) external view returns (address); function balanceOf(address owner, uint256 tokenId) external view returns (uint256); } library SetAssignable { function findAssignees(AssignableData storage self, uint256 tokenId) public view returns (address[] memory) { return self.assignments[tokenId]; } function revokeAll(AssignableData storage self, uint256 tokenId) public { for (uint256 iterator = 0; iterator < self.assignments[tokenId].length; iterator++) { address target = self.assignments[tokenId][iterator]; delete self.assignmentIndex[target][tokenId]; delete self.assigned[target]; } while ( self.assignments[tokenId].length > 0) { self.assignments[tokenId].pop(); } } function iterateGuardiansBalance(AssignableData storage self, uint256[] memory guardians, address seeking, uint256 tokenId) public view returns (uint256) { uint256 balance = 0; for (uint256 iterator = 0; iterator < guardians.length; iterator++) { uint256 guardian = guardians[iterator]; balance += iterateAssignmentsBalance(self,guardian,seeking,tokenId); } return balance; } function iterateAssignmentsBalance(AssignableData storage self, uint256 guardian, address seeking, uint256 tokenId) public view returns (uint256) { uint256 balance = 0; for (uint256 iterator = 0; iterator < self.assignments[guardian].length; iterator++) { address assignment =self.assignments[guardian][iterator]; Supportable supporting = Supportable(seeking); if (supporting.supportsInterface(type(IERC721).interfaceId)) { balance += supporting.balanceOf(assignment); } if (supporting.supportsInterface(type(IERC1155).interfaceId)) { balance += supporting.balanceOf(assignment, tokenId); } } return balance; } function addAssignment(AssignableData storage self, address to, uint256 tokenId) public { uint256 assigned = findAssignment(self, to); if (assigned > 0) { revert AlreadyAssigned(assigned); } self.assignments[tokenId].push(to); uint256 length = self.assignments[tokenId].length; self.assignmentIndex[to][tokenId] = length-1; self.assigned[to] = tokenId; } function removeAssignment(AssignableData storage self, address to) public { uint256 assigned = findAssignment(self, to); if (assigned > 0) { uint256 existingAddressIndex = self.assignmentIndex[to][assigned]; uint256 lastAssignmentIndex = self.assignments[assigned].length-1; if (existingAddressIndex != lastAssignmentIndex) { address lastAssignment = self.assignments[assigned][lastAssignmentIndex]; self.assignments[assigned][existingAddressIndex] = lastAssignment; self.assignmentIndex[lastAssignment][assigned] = existingAddressIndex; } delete self.assignmentIndex[to][assigned]; self.assignments[assigned].pop(); } else { revert NotAssigned(to); } } function findAssignment(AssignableData storage self, address to) public view returns (uint256) { return self.assigned[to]; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; struct FlexibleMetadataData { string defaultTokenMetadata; string prerevealTokenMetadata; string flaggedTokenMetadata; mapping(uint256 => string) supplementalTokenMetadata; string contractMetadata; mapping(uint256 => bool) tokenFlag; mapping(uint256 => Supplement) supplemental; bool tokenReveal; } struct Supplement { uint256 key; bool exists; } bytes16 constant _SYMBOLS = "0123456789abcdef"; uint256 constant DEFAULT = 1; uint256 constant FLAG = 2; uint256 constant PRE = 3; library SetFlexibleMetadata { function setDefaultTokenMetadataURI(FlexibleMetadataData storage self, string memory uri) public { self.defaultTokenMetadata = uri; } function setPrerevealTokenMetadataURI(FlexibleMetadataData storage self, string memory uri) public { self.prerevealTokenMetadata = uri; } function setFlaggedTokenMetadataURI(FlexibleMetadataData storage self, string memory uri) public { self.flaggedTokenMetadata = uri; } function setSupplementalTokenMetadataURI(FlexibleMetadataData storage self, uint256 key, string memory uri) public { self.supplementalTokenMetadata[key] = uri; } function setContractMetadataURI(FlexibleMetadataData storage self, string memory uri) public { self.contractMetadata = uri; } function reveal(FlexibleMetadataData storage self, bool revealed) public { self.tokenReveal = revealed; } function flagToken(FlexibleMetadataData storage self, uint256 tokenId, bool flagged) public { self.tokenFlag[tokenId] = flagged; } function getTokenMetadata(FlexibleMetadataData storage self, uint256 tokenId) public view returns (string memory) { if (self.tokenFlag[tokenId]) { return encodeURI(self.flaggedTokenMetadata,tokenId); } if (!self.tokenReveal) { return encodeURI(self.prerevealTokenMetadata,tokenId); } if (self.supplemental[tokenId].exists) { return encodeURI(self.supplementalTokenMetadata[self.supplemental[tokenId].key],tokenId); } return encodeURI(self.defaultTokenMetadata,tokenId); } function getContractMetadata(FlexibleMetadataData storage self) public view returns (string memory) { return self.contractMetadata; } function encodeURI(string storage uri, uint256 tokenId) public pure returns (string memory) { return string(abi.encodePacked(uri, "/", toString(tokenId))); } function toString(uint256 value) public pure returns (string memory) { unchecked { uint256 length = 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; } } function log10(uint256 value) public 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; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import { InvalidOwner } from "./SetOwnerEnumerable.sol"; struct LockableData { mapping(address => uint256) lockableStatusIndex; mapping(address => LockableStatus) lockableStatus; } struct LockableStatus { bool isLocked; uint256 lockedAt; address custodian; uint256 balance; address[] approvedAll; bool exists; } uint64 constant MAX_INT = 2**64 - 1; error OnlyCustodianCanLock(); error OnlyOwnerCanSetCustodian(); error WalletLockedByOwner(); error InvalidTransferRecipient(); error NotApprovedOrOwner(); error ContractIsNot721Receiver(); library SetLockable { function lockWallet(LockableData storage self, address holder) public { LockableStatus storage status = self.lockableStatus[holder]; if (msg.sender != status.custodian) { revert OnlyCustodianCanLock(); } status.isLocked = true; status.lockedAt = block.timestamp; } function unlockWallet(LockableData storage self, address holder) public { LockableStatus storage status = self.lockableStatus[holder]; if (msg.sender != status.custodian) { revert OnlyCustodianCanLock(); } status.isLocked = false; status.lockedAt = MAX_INT; } function setCustodian(LockableData storage self, address custodianAddress, address holder) public { if (msg.sender != holder) { revert OnlyOwnerCanSetCustodian(); } LockableStatus storage status = self.lockableStatus[holder]; status.custodian = custodianAddress; } function findCustodian(LockableData storage self, address wallet) public view returns (address) { return self.lockableStatus[wallet].custodian; } function forceUnlock(LockableData storage self, address owner) public { LockableStatus storage status = self.lockableStatus[owner]; status.isLocked = false; status.lockedAt = MAX_INT; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; bytes constant description = abi.encodePacked("The OSM Pass is your key to osm tools for web3, a soul bound token brought to you by Horde AI"); bytes constant attributes = abi.encodePacked('[{"value": "Horde of the Undead"},{"value": "OSM"},{"value": "Soulbound"}]'); bytes constant b64image = abi.encodePacked('ipfs://QmWs7stQWDjZpaAH3kr7ALviabd4UbhFSShELhFNHvkjjv'); struct RenderableData { bytes data; } library SetMetadataRenderable { function getDescription(RenderableData storage) public pure returns (bytes memory) { return description; } function getAttributes(RenderableData storage) public pure returns (bytes memory) { return attributes; } function getImage(RenderableData storage) public pure returns (bytes memory) { return b64image; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; struct OwnerEnumerableData { mapping(uint256 => TokenOwnership) tokens; mapping(address => bool) ownerEnumerated; mapping(address => uint256[]) ownedTokens; mapping(address => mapping(uint256 => uint256)) ownedTokensIndex; mapping(address => uint256[]) burnedTokens; mapping(address => mapping(uint256 => uint256)) burnedTokensIndex; } struct TokenOwnership { address ownedBy; bool exists; } error TokenNonOwner(address requester, uint256 tokenId); error InvalidOwner(); library SetOwnerEnumerable { function addTokenToEnumeration(OwnerEnumerableData storage self, address to, uint256 tokenId) public { self.ownedTokens[to].push(tokenId); uint256 length = self.ownedTokens[to].length; self.ownedTokensIndex[to][tokenId] = length-1; self.tokens[tokenId] = TokenOwnership(to,true); self.ownerEnumerated[to] = true; } function addBurnToEnumeration(OwnerEnumerableData storage self, address to, uint256 tokenId) public { self.burnedTokens[to].push(tokenId); uint256 length = self.burnedTokens[to].length; self.burnedTokensIndex[to][tokenId] = length-1; } function removeTokenFromEnumeration(OwnerEnumerableData storage self, address to, uint256 tokenId) public { uint256 length = self.ownedTokens[to].length; if (self.ownedTokensIndex[to][tokenId] > 0) { if (self.ownedTokensIndex[to][tokenId] != length - 1) { uint256 lastTokenId = self.ownedTokens[to][length - 1]; self.ownedTokens[to][self.ownedTokensIndex[to][tokenId]] = lastTokenId; self.ownedTokensIndex[to][lastTokenId] = self.ownedTokensIndex[to][tokenId]; } } delete self.ownedTokensIndex[to][tokenId]; if (self.ownedTokens[to].length > 0) { self.ownedTokens[to].pop(); } } function isOwnerEnumerated(OwnerEnumerableData storage self, address wallet) public view returns (bool) { return self.ownerEnumerated[wallet]; } function findTokensOwned(OwnerEnumerableData storage self, address wallet) public view returns (uint256[] storage) { return self.ownedTokens[wallet]; } function tokenIndex(OwnerEnumerableData storage self, address wallet, uint256 index) public view returns (uint256) { return self.ownedTokens[wallet][index]; } function ownerOf(OwnerEnumerableData storage self, uint256 tokenId) public view returns (address) { address owner = self.tokens[tokenId].ownedBy; if (owner == address(0)) { revert TokenNonOwner(owner,tokenId); } return owner; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * Cannot query the balance for the zero address. */ error BalanceQueryForZeroAddress(); /** * Cannot mint to the zero address. */ error MintToZeroAddress(); /** * The quantity of tokens minted must be more than zero. */ error MintZeroQuantity(); /** * The token does not exist. */ error OwnerQueryForNonexistentToken(); /** * The caller must own the token or be an approved operator. */ error TransferCallerNotOwnerNorApproved(); /** * The token must be owned by `from`. */ error TransferFromIncorrectOwner(); /** * Cannot safely transfer to a contract that does not implement the * ERC721Receiver interface. */ error TransferToNonERC721ReceiverImplementer(); /** * Cannot transfer to the zero address. */ error TransferToZeroAddress(); /** * The token does not exist. */ error URIQueryForNonexistentToken(); /** * The `quantity` minted with ERC2309 exceeds the safety limit. */ error MintERC2309QuantityExceedsLimit(); /** * The `extraData` cannot be set on an unintialized ownership slot. */ error OwnershipNotInitializedForExtraData(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. uint24 extraData; } struct DualAuxData { uint32 data1; uint32 data2; } struct QuadAuxData { uint16 data1; uint16 data2; uint16 data3; uint16 data4; } struct OctAuxData { uint8 data1; uint8 data2; uint8 data3; uint8 data4; uint8 data5; uint8 data6; uint8 data7; uint8 data8; } // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. // See {_packedOwnershipOf} implementation for details. // // Bits Layout: // - [0..159] `addr` // - [160..223] `startTimestamp` // - [224] `burned` // - [225] `nextInitialized` // - [232..255] `extraData` // Mapping owner address to address data. // // Bits Layout: // - [0..63] `balance` // - [64..127] `numberMinted` // - [128..191] `numberBurned` // - [192..255] `aux` struct PackableData { mapping(uint256 => uint256) _packedOwnerships; mapping(address => uint256) _packedAddressData; uint256 _currentIndex; uint256 _burnCounter; } library SetPackable { // ============================================================= // CONSTANTS // ============================================================= // Mask of an entry in packed address data. uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1; // The bit position of `numberMinted` in packed address data. uint256 private constant _BITPOS_NUMBER_MINTED = 64; // The bit position of `numberBurned` in packed address data. uint256 private constant _BITPOS_NUMBER_BURNED = 128; // The bit position of `aux` in packed address data. uint256 private constant _BITPOS_AUX = 192; // Mask of all 256 bits in packed address data except the 64 bits for `aux`. uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1; // The bit position of `startTimestamp` in packed ownership. uint256 private constant _BITPOS_START_TIMESTAMP = 160; // The bit mask of the `burned` bit in packed ownership. uint256 private constant _BITMASK_BURNED = 1 << 224; // The bit position of the `nextInitialized` bit in packed ownership. uint256 private constant _BITPOS_NEXT_INITIALIZED = 225; // The bit mask of the `nextInitialized` bit in packed ownership. uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225; // The bit position of `extraData` in packed ownership. uint256 private constant _BITPOS_EXTRA_DATA = 232; // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`. uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1; // The mask of the lower 160 bits for addresses. uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; // The maximum `quantity` that can be minted with {_mintERC2309}. // This limit is to prevent overflows on the address data entries. // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309} // is required to cause an overflow, which is unrealistic. uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000; // The `Transfer` event signature is given by: // `keccak256(bytes("Transfer(address,address,uint256)"))`. bytes32 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; // ============================================================= // ADDRESS DATA OPERATIONS // ============================================================= /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(PackableData storage self, address owner) public view returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return self._packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(PackableData storage self,address owner) public view returns (uint256) { return (self._packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(PackableData storage self,address owner) public view returns (uint256) { return (self._packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(PackableData storage self,address owner) public view returns (uint64 aux) { return uint64(self._packedAddressData[owner] >> _BITPOS_AUX); } /** * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(PackableData storage self, address owner, uint64 aux) public { uint256 packed = self._packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); self._packedAddressData[owner] = packed; } function getAux16(PackableData storage self, address owner) internal view returns (uint16[4] memory) { uint32[2] memory packed32 = unpack64(self,_getAux(self,owner)); uint16[2] memory pack16a = unpack32(self,packed32[0]); uint16[2] memory pack16b = unpack32(self,packed32[1]); return [pack16a[0],pack16a[1],pack16b[0],pack16b[1]]; } function pack16(PackableData storage, uint8 pack1, uint8 pack2) public pure returns (uint16) { return (uint16(pack2) << 8) | pack1; } function pack32(PackableData storage, uint16 pack1, uint16 pack2) public pure returns (uint32) { return (uint32(pack2) << 16) | pack1; } function pack64(PackableData storage, uint32 pack1, uint32 pack2) public pure returns (uint64) { return (uint64(pack2) << 32) | pack1; } function unpack64(PackableData storage, uint64 packed) public pure returns (uint32[2] memory unpacked){ uint32 pack2 = uint32(packed >> 32); uint32 pack1 = uint32(packed); return [pack1, pack2]; } function unpack32(PackableData storage, uint32 packed) public pure returns (uint16[2] memory unpacked){ uint16 pack2 = uint16(packed >> 16); uint16 pack1 = uint16(packed); return [pack1, pack2]; } function unpack16(PackableData storage, uint16 packed) public pure returns (uint8[2] memory unpacked){ uint8 pack2 = uint8(packed >> 8); uint8 pack1 = uint8(packed); return [pack1, pack2]; } // ============================================================= // OWNERSHIPS OPERATIONS // ============================================================= /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(PackableData storage self, uint256 tokenId) public view returns (address) { return address(uint160(_packedOwnershipOf(self,tokenId))); } /** * @dev Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around over time. */ function _ownershipOf(PackableData storage self, uint256 tokenId) internal view returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(self,tokenId)); } /** * @dev Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(PackableData storage self, uint256 index) internal view returns (TokenOwnership memory) { return _unpackedOwnership(self._packedOwnerships[index]); } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(PackableData storage self, uint256 index) internal { if (self._packedOwnerships[index] == 0) { self._packedOwnerships[index] = _packedOwnershipOf(self,index); } } /** * Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(PackableData storage self, uint256 tokenId) private view returns (uint256) { uint256 curr = tokenId; unchecked { if (_startTokenId(self) <= curr) if (curr < self._currentIndex) { uint256 packed = self._packedOwnerships[curr]; // If not burned. if (packed & _BITMASK_BURNED == 0) { // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `curr` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. while (packed == 0) { packed = self._packedOwnerships[--curr]; } return packed; } } } revert OwnerQueryForNonexistentToken(); } /** * @dev Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); ownership.burned = packed & _BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)) } } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } /** * @dev Returns the starting token ID. * To change the starting token ID, please override this function. */ function _startTokenId(PackableData storage) internal pure returns (uint256) { return 1; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId(PackableData storage self) public view returns (uint256) { return self._currentIndex; } /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply(PackableData storage self) public view returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than `_currentIndex - _startTokenId()` times. unchecked { return self._currentIndex - self._burnCounter; } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted(PackableData storage self) public view returns (uint256) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { return self._currentIndex; } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned(PackableData storage self) public view returns (uint256) { return self._burnCounter; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted. See {_mint}. */ function _exists(PackableData storage self, uint256 tokenId) public view returns (bool) { return _startTokenId(self) <= tokenId && tokenId < self._currentIndex && // If within bounds, self._packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned. } // ============================================================= // TRANSFER OPERATIONS // ============================================================= function transferFrom( PackableData storage self, address from, address to, uint256 tokenId ) public { uint256 prevOwnershipPacked = _packedOwnershipOf(self,tokenId); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); if (to == address(0)) revert TransferToZeroAddress(); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // We can directly increment and decrement the balances. --self._packedAddressData[from]; // Updates: `balance -= 1`. ++self._packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. self._packedOwnerships[tokenId] = _packOwnershipData( to, _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (self._packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != self._currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. self._packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } } // ============================================================= // MINT OPERATIONS // ============================================================= /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event for each mint. */ function _mint(PackableData storage self, address to, uint256 quantity) public returns (uint256) { uint256 startTokenId = self._currentIndex; if (quantity == 0) revert MintZeroQuantity(); // Overflows are incredibly unrealistic. // `balance` and `numberMinted` have a maximum limit of 2**64. // `tokenId` has a maximum limit of 2**256. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. self._packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. self._packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); uint256 toMasked; uint256 end = startTokenId + quantity; // Use assembly to loop and emit the `Transfer` event for gas savings. // The duplicated `log4` removes an extra check and reduces stack juggling. // The assembly, together with the surrounding Solidity code, have been // delicately arranged to nudge the compiler into producing optimized opcodes. assembly { // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. toMasked := and(to, _BITMASK_ADDRESS) // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. startTokenId // `tokenId`. ) // The `iszero(eq(,))` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. // The compiler will optimize the `iszero` away for performance. for { let tokenId := add(startTokenId, 1) } iszero(eq(tokenId, end)) { tokenId := add(tokenId, 1) } { // Emit the `Transfer` event. Similar to above. log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId) } } if (toMasked == 0) revert MintToZeroAddress(); self._currentIndex = end; } return self._currentIndex; } // ============================================================= // BURN OPERATIONS // ============================================================= function _burn(PackableData storage self, uint256 tokenId) public { uint256 prevOwnershipPacked = _packedOwnershipOf(self,tokenId); address from = address(uint160(prevOwnershipPacked)); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // Updates: // - `balance -= 1`. // - `numberBurned += 1`. // // We can directly decrement the balance, and increment the number burned. // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`. self._packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1; // Updates: // - `address` to the last owner. // - `startTimestamp` to the timestamp of burning. // - `burned` to `true`. // - `nextInitialized` to `true`. self._packedOwnerships[tokenId] = _packOwnershipData( from, (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (self._packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != self._currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. self._packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { self._burnCounter++; } } // ============================================================= // EXTRA DATA OPERATIONS // ============================================================= /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(PackableData storage self, uint256 index, uint24 extraData) public { uint256 packed = self._packedOwnerships[index]; if (packed == 0) revert OwnershipNotInitializedForExtraData(); uint256 extraDataCasted; // Cast `extraData` with assembly to avoid redundant masking. assembly { extraDataCasted := extraData } packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA); self._packedOwnerships[index] = packed; } /** * @dev Called during each token transfer to set the 24bit `extraData` field. * Intended to be overridden by the cosumer contract. * * `previousExtraData` - the value of `extraData` before transfer. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _extraData( address from, address to, uint24 previousExtraData ) public view returns (uint24) {} /** * @dev Returns the next extra data for the packed ownership data. * The returned result is shifted into position. */ function _nextExtraData( address from, address to, uint256 prevOwnershipPacked ) private view returns (uint256) { uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA); return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA; } // ============================================================= // OTHER OPERATIONS // ============================================================= /** * @dev Converts a uint256 to its ASCII string decimal representation. */ function _toString(uint256 value) public pure returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0. let m := add(mload(0x40), 0xa0) // Update the free memory pointer to allocate. mstore(0x40, m) // Assign the `str` to the end. str := sub(m, 0x20) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 1) // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) // prettier-ignore if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; struct PhaseableData { Phase[] phases; uint64 activePhase; uint256 maxSupply; } struct Phase { uint64 name; uint64 maxPerWallet; uint64 highestSupply; uint64 cost; } error MintIsNotAllowedRightNow(); error ExceedsMaxSupply(); error PhaseNotActiveYet(); error PhaseExhausted(); error WalletMintsFilled(uint256 requested); library SetPhaseable { function initialize(PhaseableData storage self, Phase[] storage phases, uint256 maxSupply) public { self.phases = phases; self.activePhase = 0; self.maxSupply = maxSupply; } function getMaxSupply(PhaseableData storage self) public view returns (uint256) { return self.maxSupply; } function setMaxSupply(PhaseableData storage self, uint256 newMax) public { self.maxSupply = newMax; } function getPhases(PhaseableData storage self) public view returns (Phase[] storage) { return self.phases; } function getActivePhase(PhaseableData storage self) public view returns (uint64) { return self.activePhase; } function findPhase(PhaseableData storage self, uint256 phaseId) public view returns (Phase memory) { return self.phases[phaseId]; } function startNextPhase(PhaseableData storage self) public { self.activePhase += 1; } function revertPhase(PhaseableData storage self) public { self.activePhase -= 1; } function addPhase(PhaseableData storage self,Phase calldata nextPhase) public { self.phases.push(nextPhase); } }
{ "optimizer": { "enabled": true, "runs": 100 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": { "contracts/OSM/SetApprovable.sol": { "SetApprovable": "0x8eaf680cd929e8798160e18e33b1753703dd1f14" }, "contracts/OSM/SetAssignable.sol": { "SetAssignable": "0x4b8874ef568caaa69e15ae3ced9b6d7987b2dad2" }, "contracts/OSM/SetFlexibleMetadata.sol": { "SetFlexibleMetadata": "0xe5cd560be0e0fab2850ef38a1b1b86e9d4fa0346" }, "contracts/OSM/SetLockable.sol": { "SetLockable": "0x6b0419e1420cb20a4118d13363c1f7c1578c5191" }, "contracts/OSM/SetMetadataRenderable.sol": { "SetMetadataRenderable": "0xa87f185bb1d76386498a16eb24f0257df781deb1" }, "contracts/OSM/SetOwnerEnumerable.sol": { "SetOwnerEnumerable": "0x16cc42f7b61853f2d2c5880c6a5402cf01960d42" }, "contracts/OSM/SetPackable.sol": { "SetPackable": "0xe408468a947828e1592d0d12657c6437d93d2cfe" }, "contracts/OSM/SetPhaseable.sol": { "SetPhaseable": "0x9cfe653040054af47692dfdf4c26f1ce9259b121" } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"CallerIsNotOwner","type":"error"},{"inputs":[],"name":"ContractIsNot721Receiver","type":"error"},{"inputs":[],"name":"ExceedsMaxSupply","type":"error"},{"inputs":[],"name":"InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"zero","type":"address"}],"name":"InvalidRecipient","type":"error"},{"inputs":[],"name":"InvalidTransferRecipient","type":"error"},{"inputs":[],"name":"MintIsNotAllowedRightNow","type":"error"},{"inputs":[],"name":"MintIsNotLive","type":"error"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"NotAssigned","type":"error"},{"inputs":[],"name":"NotTokenOwner","type":"error"},{"inputs":[],"name":"OwnerCannotBeZeroAddress","type":"error"},{"inputs":[],"name":"PhaseExhausted","type":"error"},{"inputs":[],"name":"PhaseNotActiveYet","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenNonExistent","type":"error"},{"inputs":[{"internalType":"address","name":"requester","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenNonOwner","type":"error"},{"inputs":[],"name":"WalletLockedByOwner","type":"error"},{"inputs":[{"internalType":"uint256","name":"requested","type":"uint256"}],"name":"WalletMintsFilled","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":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"bool","name":"enumerate","type":"bool"}],"name":"airdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"allowlistMint","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":"uint256","name":"tokenId","type":"uint256"}],"name":"assignColdStorage","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":"address","name":"seekingContract","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"custodianOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"empower","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"encodedTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"enumeratedBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"findAssignments","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bool","name":"isFlagged","type":"bool"}],"name":"flagToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSigningAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"addressed","type":"address"}],"name":"hasBeenClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"isLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"lockWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"lockedSince","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextPhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"numberMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"previousPhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"sig","type":"bytes"},{"internalType":"address","name":"recip","type":"address"}],"name":"recoverAllowAddress","outputs":[{"components":[{"internalType":"address","name":"receipient","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"address","name":"recovered","type":"address"},{"internalType":"address","name":"signingKey","type":"address"}],"internalType":"struct EIP712Allowlisting.recovered","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"sig","type":"bytes"},{"internalType":"address","name":"recip","type":"address"},{"internalType":"uint256[]","name":"bag","type":"uint256[]"}],"name":"recoverClaimSig","outputs":[{"components":[{"internalType":"address","name":"receipient","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"address","name":"recovered","type":"address"},{"internalType":"address","name":"signingKey","type":"address"},{"internalType":"string","name":"bagging","type":"string"},{"internalType":"uint256","name":"total","type":"uint256"}],"internalType":"struct EIP712Allowlisting.recoveredBag","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"sig","type":"bytes"},{"internalType":"address","name":"recip","type":"address"},{"internalType":"uint256[]","name":"bag","type":"uint256[]"},{"internalType":"uint256[]","name":"staked","type":"uint256[]"}],"name":"recoverClaimSig","outputs":[{"components":[{"internalType":"address","name":"receipient","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"address","name":"recovered","type":"address"},{"internalType":"address","name":"signingKey","type":"address"},{"internalType":"string","name":"bagging","type":"string"},{"internalType":"uint256","name":"total","type":"uint256"}],"internalType":"struct EIP712Allowlisting.recoveredBag","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_reveal","type":"bool"}],"name":"reveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"revokeAssignments","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"revokeColdStorage","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":"uri","type":"string"}],"name":"setContractUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"custodianAddress","type":"address"}],"name":"setCustodian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isLive","type":"bool"}],"name":"setMintLive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sigKey","type":"address"}],"name":"setSigningAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"key","type":"uint256"},{"internalType":"string","name":"uri","type":"string"}],"name":"setSupplementalTokenUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256","name":"tokenType","type":"uint256"}],"name":"setTokenUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"holder","type":"address"}],"name":"tokensOwnedBy","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"unlockWallet","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080604052601f805460ff19169055602880546001600160a01b03191690556101a4602a557903e9000000000000000100000000000003e90000000000000000602d55602e80546001600160401b03191690553480156200005f57600080fd5b506040518060400160405280600e81526020016d486f726465204f534d205061737360901b815250604051806040016040528060078152602001664f534d5041535360c81b81525081818181620000bc33620001b160201b60201c565b6001620000ca8382620004e5565b506002620000d98282620004e5565b5050505050620000f5600b6200020160201b62001de81760201c565b600d55620001033362000207565b6200018182828151602080840191909120825183830120602a54604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f95810195909552840192909252606083015260808201523060a082015260c00160408051601f1981840301815291905280516020909101206029555050565b6200018b62000233565b50620001a19050601f805460ff19166001179055565b620001ab62000233565b620005cb565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b50600190565b620002116200030a565b602880546001600160a01b0319166001600160a01b0392909216919091179055565b60006200023f6200034e565b60408051608081018252602d80546001600160401b038082168452600160801b80830482166020808701918252600160c01b948590048416978701978852602e548416606088019081528954600181018b5560008b81529290922097519790910180549251985191519785166001600160801b031990931692909217680100000000000000009885168902176001600160801b03169084169092026001600160c01b0316919091179482169092029390931790555492935062000307928492900416620003cd565b50565b336200031e6000546001600160a01b031690565b6001600160a01b0316146200034c5760405163d4ed9a1760e01b815233600482015260240160405180910390fd5b565b604051632d827d9160e11b815260226004820152600090739cfe653040054af47692dfdf4c26f1ce9259b12190635b04fb2290602401602060405180830381865af4158015620003a2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003c89190620005b1565b905090565b6040516347e5f1e960e01b8152602260048201526024810183905260448101829052739cfe653040054af47692dfdf4c26f1ce9259b121906347e5f1e99060640160006040518083038186803b1580156200042757600080fd5b505af41580156200043c573d6000803e3d6000fd5b505050505050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200046f57607f821691505b6020821081036200049057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004e057600081815260208120601f850160051c81016020861015620004bf5750805b601f850160051c820191505b818110156200043c57828155600101620004cb565b505050565b81516001600160401b0381111562000501576200050162000444565b62000519816200051284546200045a565b8462000496565b602080601f831160018114620005515760008415620005385750858301515b600019600386901b1c1916600185901b1785556200043c565b600085815260208120601f198616915b82811015620005825788860151825594840194600190910190840162000561565b5085821015620005a15787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215620005c457600080fd5b5051919050565b61440280620005db6000396000f3fe608060405234801561001057600080fd5b50600436106102d75760003560e01c8063911c987411610188578063d5abeb01116100e4578063e985e9c511610092578063e985e9c514610671578063ea66aeb314610684578063ea6ef371146106a4578063f2fde38b146106b7578063f5a2233c146106ca578063f6aacfb1146106dd578063f7888aec146106f057600080fd5b8063d5abeb01146105f7578063d855a579146105ff578063d97de9b614610610578063dc33e68114610623578063de3efc9114610636578063e8657ae514610649578063e8a3d4851461066957600080fd5b8063a22cb46511610141578063a22cb46514610572578063b88d4fde14610585578063c87b56dd14610598578063ccb4807b146105ab578063d068a181146105be578063d480924d146105d1578063d5688cdc146105e457600080fd5b8063911c98741461050b578063940cd05b1461051e57806395d89b411461053157806395fc164f1461053957806399f21cf51461054c578063a1a39af21461055f57600080fd5b806342966c68116102375780636352211e116101f05780636352211e146104725780636afc13341461048557806370a0823114610498578063715018a6146104ab57806386126853146104b35780638da5cb5b146104e75780638f32d59b146104f857600080fd5b806342966c68146103fe57806346dc94a114610411578063477e3c731461043157806349dfc1e41461043957806353ca912a1461044c57806356a3d7321461045f57600080fd5b806323b872dd1161029457806323b872dd1461037757806331beb6051461038a57806335ca1c791461039d5780633b9c3b4b146103b05780633be795f2146103d05780633eadb6db146103e357806342842e0e146103eb57600080fd5b806301ffc9a7146102dc57806306fdde0314610304578063081812fc14610319578063095ea7b31461033957806318160ddd1461034e5780631a29aacd14610364575b600080fd5b6102ef6102ea36600461348c565b610703565b60405190151581526020015b60405180910390f35b61030c610755565b6040516102fb91906134f9565b61032c61032736600461350c565b6107e7565b6040516102fb9190613525565b61034c61034736600461354e565b61080e565b005b610356610825565b6040519081526020016102fb565b61034c61037236600461350c565b6108a2565b61034c61038536600461357a565b6108c6565b61034c6103983660046135bb565b6108e9565b61034c6103ab36600461350c565b610913565b6103c36103be3660046136ed565b610988565b6040516102fb919061376a565b61034c6103de36600461350c565b6109f8565b61034c610a71565b61034c6103f936600461357a565b610adf565b61034c61040c36600461350c565b610afa565b61042461041f36600461350c565b610b4b565b6040516102fb91906137e7565b61034c610bcd565b61034c6104473660046138b4565b610c0d565b61034c61045a366004613908565b610c85565b61034c61046d366004613925565b610ca0565b61032c61048036600461350c565b610d5a565b61034c61049336600461350c565b610dd9565b6103566104a63660046135bb565b610e0f565b61034c610e8d565b6102ef6104c1366004613967565b6001600160a01b0316600090815260208080526040808320938352929052205460ff1690565b6000546001600160a01b031661032c565b6000546001600160a01b031633146102ef565b61034c610519366004613967565b610ea1565b61034c61052c366004613908565b610ee5565b61030c610f2d565b61034c610547366004613997565b610f3c565b61030c61055a36600461350c565b61111c565b61035661056d36600461350c565b6112e5565b61034c6105803660046139d8565b611316565b61034c610593366004613a06565b61135d565b61030c6105a636600461350c565b61137c565b61034c6105b9366004613a79565b611387565b61034c6105cc366004613aad565b6113c9565b61034c6105df366004613ad2565b611418565b61034c6105f236600461350c565b6114de565b610356611554565b6028546001600160a01b031661032c565b61035661061e3660046135bb565b61155e565b6103566106313660046135bb565b611585565b61032c61064436600461350c565b6115c2565b61065c610657366004613b16565b611606565b6040516102fb9190613b61565b61030c611743565b6102ef61067f366004613bb5565b6117be565b6106976106923660046135bb565b61183e565b6040516102fb9190613be3565b61034c6106b236600461350c565b611995565b61034c6106c53660046135bb565b611a6c565b6103c36106d8366004613c1b565b611aa4565b6102ef6106eb36600461350c565b611ceb565b6103566106fe366004613bb5565b611d33565b60006001600160e01b031982166380ac58cd60e01b148061073457506001600160e01b03198216635b5e139f60e01b145b8061074f57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606001805461076490613cbd565b80601f016020809104026020016040519081016040528092919081815260200182805461079090613cbd565b80156107dd5780601f106107b2576101008083540402835291602001916107dd565b820191906000526020600020905b8154815290600101906020018083116107c057829003601f168201915b5050505050905090565b60006107f282611dee565b506000908152601b60205260409020546001600160a01b031690565b61081781611e17565b6108218282611e3e565b5050565b60405163fe6e324760e01b8152600b600482015260009073e408468a947828e1592d0d12657c6437d93d2cfe9063fe6e3247906024015b602060405180830381865af4158015610879573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089d9190613cf7565b905090565b6108ac3382611f00565b6108b581611ffb565b6108c3576108c33382612017565b50565b6108d03382611f00565b6108d981611e17565b6108e4838383612053565b505050565b6108f16120b2565b602880546001600160a01b0319166001600160a01b0392909216919091179055565b736b0419e1420cb20a4118d13363c1f7c1578c5191638fb14e3b601d61093884610d5a565b6040518363ffffffff1660e01b8152600401610955929190613d10565b60006040518083038186803b15801561096d57600080fd5b505af4158015610981573d6000803e3d6000fd5b5050505050565b6109906133e9565b6109ed85858585602b8054806020026020016040519081016040528092919081815260200182805480156109e357602002820191906000526020600020905b8154815260200190600101908083116109cf575b5050505050611aa4565b90505b949350505050565b610a0181610d5a565b6001600160a01b0316336001600160a01b031614610a32576040516359dc379f60e01b815260040160405180910390fd5b604051630d03463560e31b81526025600482015260248101829052734b8874ef568caaa69e15ae3ced9b6d7987b2dad29063681a31a890604401610955565b610a796120b2565b60405163bbc884db60e01b815260226004820152739cfe653040054af47692dfdf4c26f1ce9259b1219063bbc884db906024015b60006040518083038186803b158015610ac557600080fd5b505af4158015610ad9573d6000803e3d6000fd5b50505050565b6108e48383836040518060200160405280600081525061135d565b610b043382611f00565b610b0d81611e17565b610b1681611ffb565b15610b4257610b2533826120ee565b6000818152600f6020526040902080546001600160a81b03191690555b6108c381612196565b60405163989fba7d60e01b81526025600482015260248101829052606090734b8874ef568caaa69e15ae3ced9b6d7987b2dad29063989fba7d90604401600060405180830381865af4158015610ba5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261074f9190810190613d27565b610bd56120b2565b6040516344ece89360e01b815260226004820152739cfe653040054af47692dfdf4c26f1ce9259b121906344ece89390602401610aad565b610c156120b2565b60405163c6c30e7760e01b815273e5cd560be0e0fab2850ef38a1b1b86e9d4fa03469063c6c30e7790610c519060039086908690600401613dc0565b60006040518083038186803b158015610c6957600080fd5b505af4158015610c7d573d6000803e3d6000fd5b505050505050565b610c8d6120b2565b6021805460ff1916911515919091179055565b610ca86120b2565b60405163ddffa49760e01b815260226004820152739cfe653040054af47692dfdf4c26f1ce9259b1219063ddffa49790602401602060405180830381865af4158015610cf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1c9190613cf7565b82610d26600d5490565b610d309190613df5565b1115610d4f5760405163c30436e960e01b815260040160405180910390fd5b610ad98383836121d5565b60405163307866fb60e01b8152600b60048201526024810182905260009073e408468a947828e1592d0d12657c6437d93d2cfe9063307866fb906044015b602060405180830381865af4158015610db5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074f9190613e08565b610dea610de582610d5a565b612242565b736b0419e1420cb20a4118d13363c1f7c1578c519163b0468662601d61093884610d5a565b604051630672195960e11b815260009073e408468a947828e1592d0d12657c6437d93d2cfe90630ce432b290610e4c90600b908690600401613d10565b602060405180830381865af4158015610e69573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074f9190613cf7565b610e956120b2565b610e9f6000612286565b565b736b0419e1420cb20a4118d13363c1f7c1578c51916311841d70601d83610ec786610d5a565b6040518463ffffffff1660e01b8152600401610c5193929190613e25565b610eed6120b2565b604051636d0aa15360e11b815260036004820152811515602482015273e5cd560be0e0fab2850ef38a1b1b86e9d4fa03469063da1542a690604401610955565b60606002805461076490613cbd565b6028548290829033906001600160a01b0316610f735760405162461bcd60e51b8152600401610f6a90613e44565b60405180910390fd5b60006029547f68e83002b91b0fd96d4df3566b5122221117e3ec6c2468fda594f6491f89b1c983604051602001610fab929190613d10565b60405160208183030381529060405280519060200120604051602001610fd2929190613e73565b604051602081830303815290604052805190602001209050600061102e85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525086939250506122d69050565b6028549091506001600160a01b0380831691161461105e5760405162461bcd60e51b8152600401610f6a90613e8e565b336001600160a01b038416146110865760405162461bcd60e51b8152600401610f6a90613e8e565b602d5461109f906001600160401b0316600160006122fa565b5060006110ab336123d5565b602d5490915081906001600160401b0316600481106110cc576110cc613eb9565b60200201516110dc906001613ecf565b602d5482906001600160401b0316600481106110fa576110fa613eb9565b61ffff909216602092909202015261111233826123e8565b5050505050505050565b60606000611129836125d2565b604051633dcbad6160e01b8152602c600482015273a87f185bb1d76386498a16eb24f0257df781deb190633dcbad6190602401600060405180830381865af4158015611179573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111a19190810190613f21565b60405163d7ac45b160e01b8152602c600482015273a87f185bb1d76386498a16eb24f0257df781deb19063d7ac45b190602401600060405180830381865af41580156111f1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526112199190810190613f21565b6040516374f4678560e11b8152602c600482015273a87f185bb1d76386498a16eb24f0257df781deb19063e9e8cf0a90602401600060405180830381865af4158015611269573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526112919190810190613f21565b6040516020016112a49493929190613f85565b60405160208183030381529060405290506112be81612664565b6040516020016112ce91906140a1565b604051602081830303815290604052915050919050565b6000601e816112f384610d5a565b6001600160a01b0316815260208101919091526040016000206001015492915050565b60006113213361183e565b511115611353576113536113343361183e565b60008151811061134657611346613eb9565b6020026020010151611e17565b61082182826127b6565b6113673383611f00565b61137082611e17565b610ad984848484612831565b606061074f8261111c565b61138f6120b2565b6040516316aa2cf160e11b815273e5cd560be0e0fab2850ef38a1b1b86e9d4fa034690632d5459e2906109559060039085906004016140e6565b6113d16120b2565b6040516318aea9b160e01b81526003600482015260248101839052811515604482015273e5cd560be0e0fab2850ef38a1b1b86e9d4fa0346906318aea9b190606401610c51565b6114206120b2565b600281146114a4576003811461146a576040516345f5dac360e11b815273e5cd560be0e0fab2850ef38a1b1b86e9d4fa034690638bebb58690610c519060039086906004016140e6565b6040516348b5a5a360e01b815273e5cd560be0e0fab2850ef38a1b1b86e9d4fa0346906348b5a5a390610c519060039086906004016140e6565b60405163db6a3cab60e01b815273e5cd560be0e0fab2850ef38a1b1b86e9d4fa03469063db6a3cab90610c519060039086906004016140e6565b6114e781610d5a565b6001600160a01b0316336001600160a01b031614611518576040516359dc379f60e01b815260040160405180910390fd5b604051636271484f60e11b8152734b8874ef568caaa69e15ae3ced9b6d7987b2dad29063c4e2909e9061095590602590339086906004016140ff565b600061089d612865565b6000611569826128a0565b506001600160a01b031660009081526011602052604090205490565b60405163ae33168f60e01b815260009073e408468a947828e1592d0d12657c6437d93d2cfe9063ae33168f90610e4c90600b908690600401613d10565b6000736b0419e1420cb20a4118d13363c1f7c1578c519163f1650c05601d6115e985610d5a565b6040518363ffffffff1660e01b8152600401610d98929190613d10565b60408051608081018252600080825260606020830181905292820181905291810191909152600061167e7f68e83002b91b0fd96d4df3566b5122221117e3ec6c2468fda594f6491f89b1c984604051602001611663929190613d10565b604051602081830303815290604052805190602001206128c7565b905060006116c486868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525086939250506122d69050565b90506040518060800160405280856001600160a01b0316815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050908252506001600160a01b0392831660208201526028549092166040909201919091529150505b9392505050565b604051633571c1ef60e11b81526003600482015260609073e5cd560be0e0fab2850ef38a1b1b86e9d4fa034690636ae383de90602401600060405180830381865af4158015611796573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261089d9190810190613f21565b60405163e4e0a72360e01b8152600090738eaf680cd929e8798160e18e33b1753703dd1f149063e4e0a723906117fd9060159087908790600401613e25565b602060405180830381865af415801561181a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173c919061411e565b604051631fcfc1d560e31b815260609081907316cc42f7b61853f2d2c5880c6a5402cf01960d429063fe7e0ea89061187d90600f908790600401613d10565b602060405180830381865af415801561189a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118be919061411e565b1561074f576040516303c2425160e01b81527316cc42f7b61853f2d2c5880c6a5402cf01960d42906303c24251906118fd90600f908790600401613d10565b602060405180830381865af415801561191a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061193e9190613cf7565b80548060200260200160405190810160405280929190818152602001828054801561198857602002820191906000526020600020905b815481526020019060010190808311611974575b5050505050915050919050565b604051633745024960e01b81528190734b8874ef568caaa69e15ae3ced9b6d7987b2dad2906337450249906119d1906025903390600401613d10565b602060405180830381865af41580156119ee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a129190613cf7565b14611a32573360405163377a707b60e11b8152600401610f6a9190613525565b604051635a3f7e5160e01b8152734b8874ef568caaa69e15ae3ced9b6d7987b2dad290635a3f7e5190610955906025903390600401613d10565b611a746120b2565b6001600160a01b038116611a9b57604051630640d5fb60e51b815260040160405180910390fd5b6108c381612286565b611aac6133e9565b6028546001600160a01b0316611ad45760405162461bcd60e51b8152600401610f6a90613e44565b6001600160a01b03841660005b8451811015611b2357848181518110611afc57611afc613eb9565b602002602001015182611b0f9190613df5565b915080611b1b8161413b565b915050611ae1565b5060005b8351811015611b6957838181518110611b4257611b42613eb9565b602002602001015182611b559190613df5565b915080611b618161413b565b915050611b27565b506000611b75826125d2565b905060006029547f41574b15c8e23aa40add5bda345b122430c1eaf039ae2dbc17b672b5acf3745483604051602001611bae9190614154565b60405160208183030381529060405280519060200120604051602001611bde929190918252602082015260400190565b60405160208183030381529060405280519060200120604051602001611c05929190613e73565b6040516020818303038152906040528051906020012090506000611c618a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525086939250506122d69050565b90506040518060c00160405280896001600160a01b031681526020018b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050908252506001600160a01b0392831660208201526028549092166040830152606082019390935260800192909252979650505050505050565b6000611cf682611ffb565b15611d2b57601e6000611d0884610d5a565b6001600160a01b0316815260208101919091526040016000205460ff1692915050565b506000919050565b600080611d3f83610e0f565b90508015611dde576000611d528461183e565b60405163cc6a6bdf60e01b8152909150734b8874ef568caaa69e15ae3ced9b6d7987b2dad29063cc6a6bdf90611d949060259085908a906000906004016141ab565b602060405180830381865af4158015611db1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd59190613cf7565b9250505061074f565b5060009392505050565b50600190565b611df7816128d5565b6108c357604051631e97bf7b60e11b815260048101829052602401610f6a565b611e2081611ceb565b156108c35760405163035857a760e41b815260040160405180910390fd5b611e478161290b565b6040516339adbc2360e11b8152738eaf680cd929e8798160e18e33b1753703dd1f149063735b784690611e8390601590869086906004016140ff565b60006040518083038186803b158015611e9b57600080fd5b505af4158015611eaf573d6000803e3d6000fd5b5050505080826001600160a01b0316611ec783610d5a565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b611f0981610d5a565b6001600160a01b0316826001600160a01b03161480611f355750611f35611f2f82610d5a565b836117be565b80611fcc5750604051636e367b3f60e11b815260156004820152602481018290526001600160a01b03831690738eaf680cd929e8798160e18e33b1753703dd1f149063dc6cf67e90604401602060405180830381865af4158015611f9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fc19190613e08565b6001600160a01b0316145b6108215760405163a528473560e01b81526001600160a01b038316600482015260248101829052604401610f6a565b6000908152600f6020526040902054600160a01b900460ff1690565b60405163c213e42f60e01b81527316cc42f7b61853f2d2c5880c6a5402cf01960d429063c213e42f90610c5190600f90869086906004016140ff565b6001600160a01b03821661207a57604051639b7cfcb760e01b815260040160405180910390fd5b61208381612945565b61208c81611ffb565b1561209c5761209c838383612984565b6120a7838383612a61565b6108e4838383612ab7565b336120c56000546001600160a01b031690565b6001600160a01b031614610e9f573360405163d4ed9a1760e01b8152600401610f6a9190613525565b604051630ba3340f60e21b81527316cc42f7b61853f2d2c5880c6a5402cf01960d4290632e8cd03c9061212a90600f90869086906004016140ff565b60006040518083038186803b15801561214257600080fd5b505af4158015612156573d6000803e3d6000fd5b505060405163502bb5d160e11b81527316cc42f7b61853f2d2c5880c6a5402cf01960d42925063a0576ba29150610c5190600f90869086906004016140ff565b60405163cf2563bd60e01b8152600b60048201526024810182905273e408468a947828e1592d0d12657c6437d93d2cfe9063cf2563bd90604401610955565b60215460009060ff166121fb576040516303eaac9360e01b815260040160405180910390fd5b6001600160a01b0384166122245783604051630bc2c5df60e11b8152600401610f6a9190613525565b81612238576122338484612afd565b6109f0565b6109f08484612b7d565b738eaf680cd929e8798160e18e33b1753703dd1f14633f4e7cce6015836122688161183e565b6040518463ffffffff1660e01b8152600401610955939291906141e0565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008060006122e58585612bd2565b915091506122f281612c17565b509392505050565b60006123068484612d5c565b61232357604051634f69b16b60e01b815260040160405180910390fd5b60405163ddffa49760e01b815260226004820152739cfe653040054af47692dfdf4c26f1ce9259b1219063ddffa49790602401602060405180830381865af4158015612373573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123979190613cf7565b836123a1600d5490565b6123ab9190613df5565b11156123ca5760405163c30436e960e01b815260040160405180910390fd5b6109f03384846121d5565b6123dd61343a565b61074f600b83612e89565b805160208201516040516386e37b2760e01b8152600b6004820181905261ffff938416602483015292909116604482015273e408468a947828e1592d0d12657c6437d93d2cfe91639adeb2d29185908490633838ced990849083906386e37b2790606401602060405180830381865af4158015612469573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061248d919061420a565b6040808a015160608b015191516386e37b2760e01b8152600b600482015261ffff91821660248201529116604482015273e408468a947828e1592d0d12657c6437d93d2cfe906386e37b2790606401602060405180830381865af41580156124f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061251d919061420a565b6040516001600160e01b031960e086901b168152600481019390935263ffffffff9182166024840152166044820152606401602060405180830381865af415801561256c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612590919061424c565b6040516001600160e01b031960e086901b16815260048101939093526001600160a01b0390911660248301526001600160401b03166044820152606401610c51565b606060006125df83612f3a565b60010190506000816001600160401b038111156125fe576125fe613619565b6040519080825280601f01601f191660200182016040528015612628576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461263257509392505050565b6060815160000361268357505060408051602081019091526000815290565b600060405180606001604052806040815260200161438d60409139905060006003845160026126b29190613df5565b6126bc9190614267565b6126c7906004614289565b6001600160401b038111156126de576126de613619565b6040519080825280601f01601f191660200182016040528015612708576020820181803683370190505b509050600182016020820185865187015b80821015612774576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f8116850151845350600183019250612719565b505060038651066001811461279057600281146127a3576127ab565b603d6001830353603d60028303536127ab565b603d60018303535b509195945050505050565b806127f757604051630aeeeecb60e01b8152738eaf680cd929e8798160e18e33b1753703dd1f1490630aeeeecb90610c519060159086903390600401613e25565b60405163b2875b1960e01b8152738eaf680cd929e8798160e18e33b1753703dd1f149063b2875b1990610c51906015908690600401613d10565b61283d84848484613012565b61285a57604051637063b1a960e11b815260040160405180910390fd5b610ad9848484612053565b60405163ddffa49760e01b815260226004820152600090739cfe653040054af47692dfdf4c26f1ce9259b1219063ddffa4979060240161085c565b6001600160a01b0381166108c3576040516349e27cff60e01b815260040160405180910390fd5b600061074f60295483613111565b60006128e082611ffb565b1561290257506000908152601b6020526040902054600160a01b900460ff1690565b61074f82613144565b3361291582610d5a565b6001600160a01b0316146108c35760405163a528473560e01b815233600482015260248101829052604401610f6a565b6040516356c7310360e11b81526015600482015260248101829052738eaf680cd929e8798160e18e33b1753703dd1f149063ad8e620690604401610955565b60405163502bb5d160e11b81527316cc42f7b61853f2d2c5880c6a5402cf01960d429063a0576ba2906129c090600f90879086906004016140ff565b60006040518083038186803b1580156129d857600080fd5b505af41580156129ec573d6000803e3d6000fd5b505060405163c213e42f60e01b81527316cc42f7b61853f2d2c5880c6a5402cf01960d42925063c213e42f9150612a2c90600f90869086906004016140ff565b60006040518083038186803b158015612a4457600080fd5b505af4158015612a58573d6000803e3d6000fd5b50505050505050565b604051630a13733160e21b8152600b60048201526001600160a01b038085166024830152831660448201526064810182905273e408468a947828e1592d0d12657c6437d93d2cfe9063284dccc490608401612a2c565b80826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b604051634ae9f7ab60e01b815260009073e408468a947828e1592d0d12657c6437d93d2cfe90634ae9f7ab90612b3c90600b90879087906004016140ff565b602060405180830381865af4158015612b59573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173c9190613cf7565b600080612b89600d5490565b612b94906001613df5565b90506000612ba28585612afd565b9050815b818111612bc957612bb78682612017565b80612bc18161413b565b915050612ba6565b50949350505050565b6000808251604103612c085760208301516040840151606085015160001a612bfc878285856131c2565b94509450505050612c10565b506000905060025b9250929050565b6000816004811115612c2b57612c2b6142a0565b03612c335750565b6001816004811115612c4757612c476142a0565b03612c8f5760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606401610f6a565b6002816004811115612ca357612ca36142a0565b03612cf05760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610f6a565b6003816004811115612d0457612d046142a0565b036108c35760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610f6a565b600080612d6761327c565b9050806001600160401b0316846001600160401b03161115612d9c5760405163f60be67160e01b815260040160405180910390fd5b600083612da8600d5490565b612db29190613df5565b90506000612dc8866001600160401b03166132f3565b905080604001516001600160401b0316821115612df8576040516323e4615760e11b815260040160405180910390fd5b6000612e03336123d5565b876001600160401b031660048110612e1d57612e1d613eb9565b6020020151612e309061ffff1687613df5565b9050600082602001516001600160401b0316118015612e5b575081602001516001600160401b031681115b15612e7c57604051632dbcfc5560e21b815260048101829052602401610f6a565b5060019695505050505050565b612e9161343a565b6001600160a01b0382166000908152600184016020526040812054612eba90859060c01c61338e565b90506000612ecf8583835b60200201516133bd565b90506000612edf86846001612ec5565b9050604051806080016040528083600060028110612eff57612eff613eb9565b6020908102919091015161ffff9081168352948101518516828201528351851660408301529290920151909216606090910152949350505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612f795772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612fa5576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612fc357662386f26fc10000830492506010015b6305f5e1008310612fdb576305f5e100830492506008015b6127108310612fef57612710830492506004015b60648310613001576064830492506002015b600a831061074f5760010192915050565b60006001600160a01b0384163b1561310957604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906130569033908990889088906004016142b6565b6020604051808303816000875af1925050508015613091575060408051601f3d908101601f1916820190925261308e918101906142f3565b60015b6130ef573d8080156130bf576040519150601f19603f3d011682016040523d82523d6000602084013e6130c4565b606091505b5080516000036130e757604051639b7cfcb760e01b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506109f0565b5060016109f0565b60008282604051602001613126929190613e73565b60405160208183030381529060405280519060200120905092915050565b604051635715761b60e11b8152600b60048201526024810182905260009073e408468a947828e1592d0d12657c6437d93d2cfe9063ae2aec3690604401602060405180830381865af415801561319e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074f919061411e565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b038311156131ef5750600090506003613273565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613243573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661326c57600060019250925050613273565b9150600090505b94509492505050565b60405163d73ee61560e01b815260226004820152600090739cfe653040054af47692dfdf4c26f1ce9259b1219063d73ee61590602401602060405180830381865af41580156132cf573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089d919061424c565b6040805160808101825260008082526020820181905281830181905260608201529051633946d61960e21b81526022600482015260248101839052739cfe653040054af47692dfdf4c26f1ce9259b1219063e51b586490604401608060405180830381865af415801561336a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074f9190614310565b613396613458565b506040805180820190915263ffffffff8281168252602092831c1691810191909152919050565b6133c5613458565b506040805180820190915261ffff8083168252601083901c16602082015292915050565b6040518060c0016040528060006001600160a01b031681526020016060815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160608152602001600081525090565b60405180608001604052806004906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b6001600160e01b0319811681146108c357600080fd5b60006020828403121561349e57600080fd5b813561173c81613476565b60005b838110156134c45781810151838201526020016134ac565b50506000910152565b600081518084526134e58160208601602086016134a9565b601f01601f19169290920160200192915050565b60208152600061173c60208301846134cd565b60006020828403121561351e57600080fd5b5035919050565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146108c357600080fd5b6000806040838503121561356157600080fd5b823561356c81613539565b946020939093013593505050565b60008060006060848603121561358f57600080fd5b833561359a81613539565b925060208401356135aa81613539565b929592945050506040919091013590565b6000602082840312156135cd57600080fd5b813561173c81613539565b60008083601f8401126135ea57600080fd5b5081356001600160401b0381111561360157600080fd5b602083019150836020828501011115612c1057600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561365757613657613619565b604052919050565b60006001600160401b0382111561367857613678613619565b5060051b60200190565b600082601f83011261369357600080fd5b813560206136a86136a38361365f565b61362f565b82815260059290921b840181019181810190868411156136c757600080fd5b8286015b848110156136e257803583529183019183016136cb565b509695505050505050565b6000806000806060858703121561370357600080fd5b84356001600160401b038082111561371a57600080fd5b613726888389016135d8565b90965094506020870135915061373b82613539565b9092506040860135908082111561375157600080fd5b5061375e87828801613682565b91505092959194509250565b60208152600060018060a01b03808451166020840152602084015160c0604085015261379960e08501826134cd565b905081604086015116606085015281606086015116608085015260808501519150601f198482030160a08501526137d081836134cd565b91505060a084015160c08401528091505092915050565b6020808252825182820181905260009190848201906040850190845b818110156138285783516001600160a01b031683529284019291840191600101613803565b50909695505050505050565b60006001600160401b0382111561384d5761384d613619565b50601f01601f191660200190565b60006138696136a384613834565b905082815283838301111561387d57600080fd5b828260208301376000602084830101529392505050565b600082601f8301126138a557600080fd5b61173c8383356020850161385b565b600080604083850312156138c757600080fd5b8235915060208301356001600160401b038111156138e457600080fd5b6138f085828601613894565b9150509250929050565b80151581146108c357600080fd5b60006020828403121561391a57600080fd5b813561173c816138fa565b60008060006060848603121561393a57600080fd5b833561394581613539565b925060208401359150604084013561395c816138fa565b809150509250925092565b6000806040838503121561397a57600080fd5b82359150602083013561398c81613539565b809150509250929050565b600080602083850312156139aa57600080fd5b82356001600160401b038111156139c057600080fd5b6139cc858286016135d8565b90969095509350505050565b600080604083850312156139eb57600080fd5b82356139f681613539565b9150602083013561398c816138fa565b60008060008060808587031215613a1c57600080fd5b8435613a2781613539565b93506020850135613a3781613539565b92506040850135915060608501356001600160401b03811115613a5957600080fd5b8501601f81018713613a6a57600080fd5b61375e8782356020840161385b565b600060208284031215613a8b57600080fd5b81356001600160401b03811115613aa157600080fd5b6109f084828501613894565b60008060408385031215613ac057600080fd5b82359150602083013561398c816138fa565b60008060408385031215613ae557600080fd5b82356001600160401b03811115613afb57600080fd5b613b0785828601613894565b95602094909401359450505050565b600080600060408486031215613b2b57600080fd5b83356001600160401b03811115613b4157600080fd5b613b4d868287016135d8565b909450925050602084013561395c81613539565b60208152600060018060a01b03808451166020840152602084015160806040850152613b9060a08501826134cd565b9050816040860151166060850152816060860151166080850152809250505092915050565b60008060408385031215613bc857600080fd5b8235613bd381613539565b9150602083013561398c81613539565b6020808252825182820181905260009190848201906040850190845b8181101561382857835183529284019291840191600101613bff565b600080600080600060808688031215613c3357600080fd5b85356001600160401b0380821115613c4a57600080fd5b613c5689838a016135d8565b909750955060208801359150613c6b82613539565b90935060408701359080821115613c8157600080fd5b613c8d89838a01613682565b93506060880135915080821115613ca357600080fd5b50613cb088828901613682565b9150509295509295909350565b600181811c90821680613cd157607f821691505b602082108103613cf157634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215613d0957600080fd5b5051919050565b9182526001600160a01b0316602082015260400190565b60006020808385031215613d3a57600080fd5b82516001600160401b03811115613d5057600080fd5b8301601f81018513613d6157600080fd5b8051613d6f6136a38261365f565b81815260059190911b82018301908381019087831115613d8e57600080fd5b928401925b82841015613db5578351613da681613539565b82529284019290840190613d93565b979650505050505050565b8381528260208201526060604082015260006109ed60608301846134cd565b634e487b7160e01b600052601160045260246000fd5b8082018082111561074f5761074f613ddf565b600060208284031215613e1a57600080fd5b815161173c81613539565b9283526001600160a01b03918216602084015216604082015260600190565b602080825260159082015274185b1b1bdddb1a5cdd081b9bdd08195b98589b1959605a1b604082015260600190565b61190160f01b81526002810192909252602282015260420190565b602080825260119082015270696e76616c6964207369676e617475726560781b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b61ffff818116838216019080821115613eea57613eea613ddf565b5092915050565b6000613eff6136a384613834565b9050828152838383011115613f1357600080fd5b61173c8360208301846134a9565b600060208284031215613f3357600080fd5b81516001600160401b03811115613f4957600080fd5b8201601f81018413613f5a57600080fd5b6109f084825160208401613ef1565b60008151613f7b8185602086016134a9565b9290920192915050565b607b60f81b815278226e616d65223a2022486f726465204f534d2050617373202360381b60018201528451600090613fc481601a850160208a016134a9565b711116113232b9b1b934b83a34b7b7111d101160711b601a918401918201528551613ff681602c840160208a016134a9565b601160f91b602c9290910191820181905269161134b6b0b3b2911d1160b11b602d830152855161402d816037850160208a016134a9565b60379201918201527f2c2265787465726e616c5f75726c223a2268747470733a2f2f6f736d2e746f6f60388201526236399160e91b6058820152613db561409461408e605b84016d161130ba3a3934b13aba32b9911d60911b8152600e0190565b86613f69565b607d60f81b815260010190565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000008152600082516140d981601d8501602087016134a9565b91909101601d0192915050565b8281526040602082015260006109f060408301846134cd565b9283526001600160a01b03919091166020830152604082015260600190565b60006020828403121561413057600080fd5b815161173c816138fa565b60006001820161414d5761414d613ddf565b5060010190565b600082516141668184602087016134a9565b9190910192915050565b600081518084526020808501945080840160005b838110156141a057815187529582019590820190600101614184565b509495945050505050565b8481526080602082015260006141c46080830186614170565b6001600160a01b03949094166040830152506060015292915050565b8381526001600160a01b03831660208201526060604082018190526000906109ed90830184614170565b60006020828403121561421c57600080fd5b815163ffffffff8116811461173c57600080fd5b80516001600160401b038116811461424757600080fd5b919050565b60006020828403121561425e57600080fd5b61173c82614230565b60008261428457634e487b7160e01b600052601260045260246000fd5b500490565b808202811582820484141761074f5761074f613ddf565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906142e9908301846134cd565b9695505050505050565b60006020828403121561430557600080fd5b815161173c81613476565b60006080828403121561432257600080fd5b604051608081018181106001600160401b038211171561434457614344613619565b60405261435083614230565b815261435e60208401614230565b602082015261436f60408401614230565b604082015261438060608401614230565b6060820152939250505056fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220fbbfc472cf441143b71b10ccceace3a672c861b28b7708dd37c13bce6e8463a364736f6c63430008120033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102d75760003560e01c8063911c987411610188578063d5abeb01116100e4578063e985e9c511610092578063e985e9c514610671578063ea66aeb314610684578063ea6ef371146106a4578063f2fde38b146106b7578063f5a2233c146106ca578063f6aacfb1146106dd578063f7888aec146106f057600080fd5b8063d5abeb01146105f7578063d855a579146105ff578063d97de9b614610610578063dc33e68114610623578063de3efc9114610636578063e8657ae514610649578063e8a3d4851461066957600080fd5b8063a22cb46511610141578063a22cb46514610572578063b88d4fde14610585578063c87b56dd14610598578063ccb4807b146105ab578063d068a181146105be578063d480924d146105d1578063d5688cdc146105e457600080fd5b8063911c98741461050b578063940cd05b1461051e57806395d89b411461053157806395fc164f1461053957806399f21cf51461054c578063a1a39af21461055f57600080fd5b806342966c68116102375780636352211e116101f05780636352211e146104725780636afc13341461048557806370a0823114610498578063715018a6146104ab57806386126853146104b35780638da5cb5b146104e75780638f32d59b146104f857600080fd5b806342966c68146103fe57806346dc94a114610411578063477e3c731461043157806349dfc1e41461043957806353ca912a1461044c57806356a3d7321461045f57600080fd5b806323b872dd1161029457806323b872dd1461037757806331beb6051461038a57806335ca1c791461039d5780633b9c3b4b146103b05780633be795f2146103d05780633eadb6db146103e357806342842e0e146103eb57600080fd5b806301ffc9a7146102dc57806306fdde0314610304578063081812fc14610319578063095ea7b31461033957806318160ddd1461034e5780631a29aacd14610364575b600080fd5b6102ef6102ea36600461348c565b610703565b60405190151581526020015b60405180910390f35b61030c610755565b6040516102fb91906134f9565b61032c61032736600461350c565b6107e7565b6040516102fb9190613525565b61034c61034736600461354e565b61080e565b005b610356610825565b6040519081526020016102fb565b61034c61037236600461350c565b6108a2565b61034c61038536600461357a565b6108c6565b61034c6103983660046135bb565b6108e9565b61034c6103ab36600461350c565b610913565b6103c36103be3660046136ed565b610988565b6040516102fb919061376a565b61034c6103de36600461350c565b6109f8565b61034c610a71565b61034c6103f936600461357a565b610adf565b61034c61040c36600461350c565b610afa565b61042461041f36600461350c565b610b4b565b6040516102fb91906137e7565b61034c610bcd565b61034c6104473660046138b4565b610c0d565b61034c61045a366004613908565b610c85565b61034c61046d366004613925565b610ca0565b61032c61048036600461350c565b610d5a565b61034c61049336600461350c565b610dd9565b6103566104a63660046135bb565b610e0f565b61034c610e8d565b6102ef6104c1366004613967565b6001600160a01b0316600090815260208080526040808320938352929052205460ff1690565b6000546001600160a01b031661032c565b6000546001600160a01b031633146102ef565b61034c610519366004613967565b610ea1565b61034c61052c366004613908565b610ee5565b61030c610f2d565b61034c610547366004613997565b610f3c565b61030c61055a36600461350c565b61111c565b61035661056d36600461350c565b6112e5565b61034c6105803660046139d8565b611316565b61034c610593366004613a06565b61135d565b61030c6105a636600461350c565b61137c565b61034c6105b9366004613a79565b611387565b61034c6105cc366004613aad565b6113c9565b61034c6105df366004613ad2565b611418565b61034c6105f236600461350c565b6114de565b610356611554565b6028546001600160a01b031661032c565b61035661061e3660046135bb565b61155e565b6103566106313660046135bb565b611585565b61032c61064436600461350c565b6115c2565b61065c610657366004613b16565b611606565b6040516102fb9190613b61565b61030c611743565b6102ef61067f366004613bb5565b6117be565b6106976106923660046135bb565b61183e565b6040516102fb9190613be3565b61034c6106b236600461350c565b611995565b61034c6106c53660046135bb565b611a6c565b6103c36106d8366004613c1b565b611aa4565b6102ef6106eb36600461350c565b611ceb565b6103566106fe366004613bb5565b611d33565b60006001600160e01b031982166380ac58cd60e01b148061073457506001600160e01b03198216635b5e139f60e01b145b8061074f57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606001805461076490613cbd565b80601f016020809104026020016040519081016040528092919081815260200182805461079090613cbd565b80156107dd5780601f106107b2576101008083540402835291602001916107dd565b820191906000526020600020905b8154815290600101906020018083116107c057829003601f168201915b5050505050905090565b60006107f282611dee565b506000908152601b60205260409020546001600160a01b031690565b61081781611e17565b6108218282611e3e565b5050565b60405163fe6e324760e01b8152600b600482015260009073e408468a947828e1592d0d12657c6437d93d2cfe9063fe6e3247906024015b602060405180830381865af4158015610879573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089d9190613cf7565b905090565b6108ac3382611f00565b6108b581611ffb565b6108c3576108c33382612017565b50565b6108d03382611f00565b6108d981611e17565b6108e4838383612053565b505050565b6108f16120b2565b602880546001600160a01b0319166001600160a01b0392909216919091179055565b736b0419e1420cb20a4118d13363c1f7c1578c5191638fb14e3b601d61093884610d5a565b6040518363ffffffff1660e01b8152600401610955929190613d10565b60006040518083038186803b15801561096d57600080fd5b505af4158015610981573d6000803e3d6000fd5b5050505050565b6109906133e9565b6109ed85858585602b8054806020026020016040519081016040528092919081815260200182805480156109e357602002820191906000526020600020905b8154815260200190600101908083116109cf575b5050505050611aa4565b90505b949350505050565b610a0181610d5a565b6001600160a01b0316336001600160a01b031614610a32576040516359dc379f60e01b815260040160405180910390fd5b604051630d03463560e31b81526025600482015260248101829052734b8874ef568caaa69e15ae3ced9b6d7987b2dad29063681a31a890604401610955565b610a796120b2565b60405163bbc884db60e01b815260226004820152739cfe653040054af47692dfdf4c26f1ce9259b1219063bbc884db906024015b60006040518083038186803b158015610ac557600080fd5b505af4158015610ad9573d6000803e3d6000fd5b50505050565b6108e48383836040518060200160405280600081525061135d565b610b043382611f00565b610b0d81611e17565b610b1681611ffb565b15610b4257610b2533826120ee565b6000818152600f6020526040902080546001600160a81b03191690555b6108c381612196565b60405163989fba7d60e01b81526025600482015260248101829052606090734b8874ef568caaa69e15ae3ced9b6d7987b2dad29063989fba7d90604401600060405180830381865af4158015610ba5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261074f9190810190613d27565b610bd56120b2565b6040516344ece89360e01b815260226004820152739cfe653040054af47692dfdf4c26f1ce9259b121906344ece89390602401610aad565b610c156120b2565b60405163c6c30e7760e01b815273e5cd560be0e0fab2850ef38a1b1b86e9d4fa03469063c6c30e7790610c519060039086908690600401613dc0565b60006040518083038186803b158015610c6957600080fd5b505af4158015610c7d573d6000803e3d6000fd5b505050505050565b610c8d6120b2565b6021805460ff1916911515919091179055565b610ca86120b2565b60405163ddffa49760e01b815260226004820152739cfe653040054af47692dfdf4c26f1ce9259b1219063ddffa49790602401602060405180830381865af4158015610cf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1c9190613cf7565b82610d26600d5490565b610d309190613df5565b1115610d4f5760405163c30436e960e01b815260040160405180910390fd5b610ad98383836121d5565b60405163307866fb60e01b8152600b60048201526024810182905260009073e408468a947828e1592d0d12657c6437d93d2cfe9063307866fb906044015b602060405180830381865af4158015610db5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074f9190613e08565b610dea610de582610d5a565b612242565b736b0419e1420cb20a4118d13363c1f7c1578c519163b0468662601d61093884610d5a565b604051630672195960e11b815260009073e408468a947828e1592d0d12657c6437d93d2cfe90630ce432b290610e4c90600b908690600401613d10565b602060405180830381865af4158015610e69573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074f9190613cf7565b610e956120b2565b610e9f6000612286565b565b736b0419e1420cb20a4118d13363c1f7c1578c51916311841d70601d83610ec786610d5a565b6040518463ffffffff1660e01b8152600401610c5193929190613e25565b610eed6120b2565b604051636d0aa15360e11b815260036004820152811515602482015273e5cd560be0e0fab2850ef38a1b1b86e9d4fa03469063da1542a690604401610955565b60606002805461076490613cbd565b6028548290829033906001600160a01b0316610f735760405162461bcd60e51b8152600401610f6a90613e44565b60405180910390fd5b60006029547f68e83002b91b0fd96d4df3566b5122221117e3ec6c2468fda594f6491f89b1c983604051602001610fab929190613d10565b60405160208183030381529060405280519060200120604051602001610fd2929190613e73565b604051602081830303815290604052805190602001209050600061102e85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525086939250506122d69050565b6028549091506001600160a01b0380831691161461105e5760405162461bcd60e51b8152600401610f6a90613e8e565b336001600160a01b038416146110865760405162461bcd60e51b8152600401610f6a90613e8e565b602d5461109f906001600160401b0316600160006122fa565b5060006110ab336123d5565b602d5490915081906001600160401b0316600481106110cc576110cc613eb9565b60200201516110dc906001613ecf565b602d5482906001600160401b0316600481106110fa576110fa613eb9565b61ffff909216602092909202015261111233826123e8565b5050505050505050565b60606000611129836125d2565b604051633dcbad6160e01b8152602c600482015273a87f185bb1d76386498a16eb24f0257df781deb190633dcbad6190602401600060405180830381865af4158015611179573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111a19190810190613f21565b60405163d7ac45b160e01b8152602c600482015273a87f185bb1d76386498a16eb24f0257df781deb19063d7ac45b190602401600060405180830381865af41580156111f1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526112199190810190613f21565b6040516374f4678560e11b8152602c600482015273a87f185bb1d76386498a16eb24f0257df781deb19063e9e8cf0a90602401600060405180830381865af4158015611269573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526112919190810190613f21565b6040516020016112a49493929190613f85565b60405160208183030381529060405290506112be81612664565b6040516020016112ce91906140a1565b604051602081830303815290604052915050919050565b6000601e816112f384610d5a565b6001600160a01b0316815260208101919091526040016000206001015492915050565b60006113213361183e565b511115611353576113536113343361183e565b60008151811061134657611346613eb9565b6020026020010151611e17565b61082182826127b6565b6113673383611f00565b61137082611e17565b610ad984848484612831565b606061074f8261111c565b61138f6120b2565b6040516316aa2cf160e11b815273e5cd560be0e0fab2850ef38a1b1b86e9d4fa034690632d5459e2906109559060039085906004016140e6565b6113d16120b2565b6040516318aea9b160e01b81526003600482015260248101839052811515604482015273e5cd560be0e0fab2850ef38a1b1b86e9d4fa0346906318aea9b190606401610c51565b6114206120b2565b600281146114a4576003811461146a576040516345f5dac360e11b815273e5cd560be0e0fab2850ef38a1b1b86e9d4fa034690638bebb58690610c519060039086906004016140e6565b6040516348b5a5a360e01b815273e5cd560be0e0fab2850ef38a1b1b86e9d4fa0346906348b5a5a390610c519060039086906004016140e6565b60405163db6a3cab60e01b815273e5cd560be0e0fab2850ef38a1b1b86e9d4fa03469063db6a3cab90610c519060039086906004016140e6565b6114e781610d5a565b6001600160a01b0316336001600160a01b031614611518576040516359dc379f60e01b815260040160405180910390fd5b604051636271484f60e11b8152734b8874ef568caaa69e15ae3ced9b6d7987b2dad29063c4e2909e9061095590602590339086906004016140ff565b600061089d612865565b6000611569826128a0565b506001600160a01b031660009081526011602052604090205490565b60405163ae33168f60e01b815260009073e408468a947828e1592d0d12657c6437d93d2cfe9063ae33168f90610e4c90600b908690600401613d10565b6000736b0419e1420cb20a4118d13363c1f7c1578c519163f1650c05601d6115e985610d5a565b6040518363ffffffff1660e01b8152600401610d98929190613d10565b60408051608081018252600080825260606020830181905292820181905291810191909152600061167e7f68e83002b91b0fd96d4df3566b5122221117e3ec6c2468fda594f6491f89b1c984604051602001611663929190613d10565b604051602081830303815290604052805190602001206128c7565b905060006116c486868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525086939250506122d69050565b90506040518060800160405280856001600160a01b0316815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050908252506001600160a01b0392831660208201526028549092166040909201919091529150505b9392505050565b604051633571c1ef60e11b81526003600482015260609073e5cd560be0e0fab2850ef38a1b1b86e9d4fa034690636ae383de90602401600060405180830381865af4158015611796573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261089d9190810190613f21565b60405163e4e0a72360e01b8152600090738eaf680cd929e8798160e18e33b1753703dd1f149063e4e0a723906117fd9060159087908790600401613e25565b602060405180830381865af415801561181a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173c919061411e565b604051631fcfc1d560e31b815260609081907316cc42f7b61853f2d2c5880c6a5402cf01960d429063fe7e0ea89061187d90600f908790600401613d10565b602060405180830381865af415801561189a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118be919061411e565b1561074f576040516303c2425160e01b81527316cc42f7b61853f2d2c5880c6a5402cf01960d42906303c24251906118fd90600f908790600401613d10565b602060405180830381865af415801561191a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061193e9190613cf7565b80548060200260200160405190810160405280929190818152602001828054801561198857602002820191906000526020600020905b815481526020019060010190808311611974575b5050505050915050919050565b604051633745024960e01b81528190734b8874ef568caaa69e15ae3ced9b6d7987b2dad2906337450249906119d1906025903390600401613d10565b602060405180830381865af41580156119ee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a129190613cf7565b14611a32573360405163377a707b60e11b8152600401610f6a9190613525565b604051635a3f7e5160e01b8152734b8874ef568caaa69e15ae3ced9b6d7987b2dad290635a3f7e5190610955906025903390600401613d10565b611a746120b2565b6001600160a01b038116611a9b57604051630640d5fb60e51b815260040160405180910390fd5b6108c381612286565b611aac6133e9565b6028546001600160a01b0316611ad45760405162461bcd60e51b8152600401610f6a90613e44565b6001600160a01b03841660005b8451811015611b2357848181518110611afc57611afc613eb9565b602002602001015182611b0f9190613df5565b915080611b1b8161413b565b915050611ae1565b5060005b8351811015611b6957838181518110611b4257611b42613eb9565b602002602001015182611b559190613df5565b915080611b618161413b565b915050611b27565b506000611b75826125d2565b905060006029547f41574b15c8e23aa40add5bda345b122430c1eaf039ae2dbc17b672b5acf3745483604051602001611bae9190614154565b60405160208183030381529060405280519060200120604051602001611bde929190918252602082015260400190565b60405160208183030381529060405280519060200120604051602001611c05929190613e73565b6040516020818303038152906040528051906020012090506000611c618a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525086939250506122d69050565b90506040518060c00160405280896001600160a01b031681526020018b8b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050908252506001600160a01b0392831660208201526028549092166040830152606082019390935260800192909252979650505050505050565b6000611cf682611ffb565b15611d2b57601e6000611d0884610d5a565b6001600160a01b0316815260208101919091526040016000205460ff1692915050565b506000919050565b600080611d3f83610e0f565b90508015611dde576000611d528461183e565b60405163cc6a6bdf60e01b8152909150734b8874ef568caaa69e15ae3ced9b6d7987b2dad29063cc6a6bdf90611d949060259085908a906000906004016141ab565b602060405180830381865af4158015611db1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd59190613cf7565b9250505061074f565b5060009392505050565b50600190565b611df7816128d5565b6108c357604051631e97bf7b60e11b815260048101829052602401610f6a565b611e2081611ceb565b156108c35760405163035857a760e41b815260040160405180910390fd5b611e478161290b565b6040516339adbc2360e11b8152738eaf680cd929e8798160e18e33b1753703dd1f149063735b784690611e8390601590869086906004016140ff565b60006040518083038186803b158015611e9b57600080fd5b505af4158015611eaf573d6000803e3d6000fd5b5050505080826001600160a01b0316611ec783610d5a565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b611f0981610d5a565b6001600160a01b0316826001600160a01b03161480611f355750611f35611f2f82610d5a565b836117be565b80611fcc5750604051636e367b3f60e11b815260156004820152602481018290526001600160a01b03831690738eaf680cd929e8798160e18e33b1753703dd1f149063dc6cf67e90604401602060405180830381865af4158015611f9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fc19190613e08565b6001600160a01b0316145b6108215760405163a528473560e01b81526001600160a01b038316600482015260248101829052604401610f6a565b6000908152600f6020526040902054600160a01b900460ff1690565b60405163c213e42f60e01b81527316cc42f7b61853f2d2c5880c6a5402cf01960d429063c213e42f90610c5190600f90869086906004016140ff565b6001600160a01b03821661207a57604051639b7cfcb760e01b815260040160405180910390fd5b61208381612945565b61208c81611ffb565b1561209c5761209c838383612984565b6120a7838383612a61565b6108e4838383612ab7565b336120c56000546001600160a01b031690565b6001600160a01b031614610e9f573360405163d4ed9a1760e01b8152600401610f6a9190613525565b604051630ba3340f60e21b81527316cc42f7b61853f2d2c5880c6a5402cf01960d4290632e8cd03c9061212a90600f90869086906004016140ff565b60006040518083038186803b15801561214257600080fd5b505af4158015612156573d6000803e3d6000fd5b505060405163502bb5d160e11b81527316cc42f7b61853f2d2c5880c6a5402cf01960d42925063a0576ba29150610c5190600f90869086906004016140ff565b60405163cf2563bd60e01b8152600b60048201526024810182905273e408468a947828e1592d0d12657c6437d93d2cfe9063cf2563bd90604401610955565b60215460009060ff166121fb576040516303eaac9360e01b815260040160405180910390fd5b6001600160a01b0384166122245783604051630bc2c5df60e11b8152600401610f6a9190613525565b81612238576122338484612afd565b6109f0565b6109f08484612b7d565b738eaf680cd929e8798160e18e33b1753703dd1f14633f4e7cce6015836122688161183e565b6040518463ffffffff1660e01b8152600401610955939291906141e0565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008060006122e58585612bd2565b915091506122f281612c17565b509392505050565b60006123068484612d5c565b61232357604051634f69b16b60e01b815260040160405180910390fd5b60405163ddffa49760e01b815260226004820152739cfe653040054af47692dfdf4c26f1ce9259b1219063ddffa49790602401602060405180830381865af4158015612373573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123979190613cf7565b836123a1600d5490565b6123ab9190613df5565b11156123ca5760405163c30436e960e01b815260040160405180910390fd5b6109f03384846121d5565b6123dd61343a565b61074f600b83612e89565b805160208201516040516386e37b2760e01b8152600b6004820181905261ffff938416602483015292909116604482015273e408468a947828e1592d0d12657c6437d93d2cfe91639adeb2d29185908490633838ced990849083906386e37b2790606401602060405180830381865af4158015612469573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061248d919061420a565b6040808a015160608b015191516386e37b2760e01b8152600b600482015261ffff91821660248201529116604482015273e408468a947828e1592d0d12657c6437d93d2cfe906386e37b2790606401602060405180830381865af41580156124f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061251d919061420a565b6040516001600160e01b031960e086901b168152600481019390935263ffffffff9182166024840152166044820152606401602060405180830381865af415801561256c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612590919061424c565b6040516001600160e01b031960e086901b16815260048101939093526001600160a01b0390911660248301526001600160401b03166044820152606401610c51565b606060006125df83612f3a565b60010190506000816001600160401b038111156125fe576125fe613619565b6040519080825280601f01601f191660200182016040528015612628576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461263257509392505050565b6060815160000361268357505060408051602081019091526000815290565b600060405180606001604052806040815260200161438d60409139905060006003845160026126b29190613df5565b6126bc9190614267565b6126c7906004614289565b6001600160401b038111156126de576126de613619565b6040519080825280601f01601f191660200182016040528015612708576020820181803683370190505b509050600182016020820185865187015b80821015612774576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f8116850151845350600183019250612719565b505060038651066001811461279057600281146127a3576127ab565b603d6001830353603d60028303536127ab565b603d60018303535b509195945050505050565b806127f757604051630aeeeecb60e01b8152738eaf680cd929e8798160e18e33b1753703dd1f1490630aeeeecb90610c519060159086903390600401613e25565b60405163b2875b1960e01b8152738eaf680cd929e8798160e18e33b1753703dd1f149063b2875b1990610c51906015908690600401613d10565b61283d84848484613012565b61285a57604051637063b1a960e11b815260040160405180910390fd5b610ad9848484612053565b60405163ddffa49760e01b815260226004820152600090739cfe653040054af47692dfdf4c26f1ce9259b1219063ddffa4979060240161085c565b6001600160a01b0381166108c3576040516349e27cff60e01b815260040160405180910390fd5b600061074f60295483613111565b60006128e082611ffb565b1561290257506000908152601b6020526040902054600160a01b900460ff1690565b61074f82613144565b3361291582610d5a565b6001600160a01b0316146108c35760405163a528473560e01b815233600482015260248101829052604401610f6a565b6040516356c7310360e11b81526015600482015260248101829052738eaf680cd929e8798160e18e33b1753703dd1f149063ad8e620690604401610955565b60405163502bb5d160e11b81527316cc42f7b61853f2d2c5880c6a5402cf01960d429063a0576ba2906129c090600f90879086906004016140ff565b60006040518083038186803b1580156129d857600080fd5b505af41580156129ec573d6000803e3d6000fd5b505060405163c213e42f60e01b81527316cc42f7b61853f2d2c5880c6a5402cf01960d42925063c213e42f9150612a2c90600f90869086906004016140ff565b60006040518083038186803b158015612a4457600080fd5b505af4158015612a58573d6000803e3d6000fd5b50505050505050565b604051630a13733160e21b8152600b60048201526001600160a01b038085166024830152831660448201526064810182905273e408468a947828e1592d0d12657c6437d93d2cfe9063284dccc490608401612a2c565b80826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b604051634ae9f7ab60e01b815260009073e408468a947828e1592d0d12657c6437d93d2cfe90634ae9f7ab90612b3c90600b90879087906004016140ff565b602060405180830381865af4158015612b59573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173c9190613cf7565b600080612b89600d5490565b612b94906001613df5565b90506000612ba28585612afd565b9050815b818111612bc957612bb78682612017565b80612bc18161413b565b915050612ba6565b50949350505050565b6000808251604103612c085760208301516040840151606085015160001a612bfc878285856131c2565b94509450505050612c10565b506000905060025b9250929050565b6000816004811115612c2b57612c2b6142a0565b03612c335750565b6001816004811115612c4757612c476142a0565b03612c8f5760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606401610f6a565b6002816004811115612ca357612ca36142a0565b03612cf05760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610f6a565b6003816004811115612d0457612d046142a0565b036108c35760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610f6a565b600080612d6761327c565b9050806001600160401b0316846001600160401b03161115612d9c5760405163f60be67160e01b815260040160405180910390fd5b600083612da8600d5490565b612db29190613df5565b90506000612dc8866001600160401b03166132f3565b905080604001516001600160401b0316821115612df8576040516323e4615760e11b815260040160405180910390fd5b6000612e03336123d5565b876001600160401b031660048110612e1d57612e1d613eb9565b6020020151612e309061ffff1687613df5565b9050600082602001516001600160401b0316118015612e5b575081602001516001600160401b031681115b15612e7c57604051632dbcfc5560e21b815260048101829052602401610f6a565b5060019695505050505050565b612e9161343a565b6001600160a01b0382166000908152600184016020526040812054612eba90859060c01c61338e565b90506000612ecf8583835b60200201516133bd565b90506000612edf86846001612ec5565b9050604051806080016040528083600060028110612eff57612eff613eb9565b6020908102919091015161ffff9081168352948101518516828201528351851660408301529290920151909216606090910152949350505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612f795772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612fa5576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612fc357662386f26fc10000830492506010015b6305f5e1008310612fdb576305f5e100830492506008015b6127108310612fef57612710830492506004015b60648310613001576064830492506002015b600a831061074f5760010192915050565b60006001600160a01b0384163b1561310957604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906130569033908990889088906004016142b6565b6020604051808303816000875af1925050508015613091575060408051601f3d908101601f1916820190925261308e918101906142f3565b60015b6130ef573d8080156130bf576040519150601f19603f3d011682016040523d82523d6000602084013e6130c4565b606091505b5080516000036130e757604051639b7cfcb760e01b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506109f0565b5060016109f0565b60008282604051602001613126929190613e73565b60405160208183030381529060405280519060200120905092915050565b604051635715761b60e11b8152600b60048201526024810182905260009073e408468a947828e1592d0d12657c6437d93d2cfe9063ae2aec3690604401602060405180830381865af415801561319e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074f919061411e565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b038311156131ef5750600090506003613273565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613243573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661326c57600060019250925050613273565b9150600090505b94509492505050565b60405163d73ee61560e01b815260226004820152600090739cfe653040054af47692dfdf4c26f1ce9259b1219063d73ee61590602401602060405180830381865af41580156132cf573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089d919061424c565b6040805160808101825260008082526020820181905281830181905260608201529051633946d61960e21b81526022600482015260248101839052739cfe653040054af47692dfdf4c26f1ce9259b1219063e51b586490604401608060405180830381865af415801561336a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074f9190614310565b613396613458565b506040805180820190915263ffffffff8281168252602092831c1691810191909152919050565b6133c5613458565b506040805180820190915261ffff8083168252601083901c16602082015292915050565b6040518060c0016040528060006001600160a01b031681526020016060815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160608152602001600081525090565b60405180608001604052806004906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b6001600160e01b0319811681146108c357600080fd5b60006020828403121561349e57600080fd5b813561173c81613476565b60005b838110156134c45781810151838201526020016134ac565b50506000910152565b600081518084526134e58160208601602086016134a9565b601f01601f19169290920160200192915050565b60208152600061173c60208301846134cd565b60006020828403121561351e57600080fd5b5035919050565b6001600160a01b0391909116815260200190565b6001600160a01b03811681146108c357600080fd5b6000806040838503121561356157600080fd5b823561356c81613539565b946020939093013593505050565b60008060006060848603121561358f57600080fd5b833561359a81613539565b925060208401356135aa81613539565b929592945050506040919091013590565b6000602082840312156135cd57600080fd5b813561173c81613539565b60008083601f8401126135ea57600080fd5b5081356001600160401b0381111561360157600080fd5b602083019150836020828501011115612c1057600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561365757613657613619565b604052919050565b60006001600160401b0382111561367857613678613619565b5060051b60200190565b600082601f83011261369357600080fd5b813560206136a86136a38361365f565b61362f565b82815260059290921b840181019181810190868411156136c757600080fd5b8286015b848110156136e257803583529183019183016136cb565b509695505050505050565b6000806000806060858703121561370357600080fd5b84356001600160401b038082111561371a57600080fd5b613726888389016135d8565b90965094506020870135915061373b82613539565b9092506040860135908082111561375157600080fd5b5061375e87828801613682565b91505092959194509250565b60208152600060018060a01b03808451166020840152602084015160c0604085015261379960e08501826134cd565b905081604086015116606085015281606086015116608085015260808501519150601f198482030160a08501526137d081836134cd565b91505060a084015160c08401528091505092915050565b6020808252825182820181905260009190848201906040850190845b818110156138285783516001600160a01b031683529284019291840191600101613803565b50909695505050505050565b60006001600160401b0382111561384d5761384d613619565b50601f01601f191660200190565b60006138696136a384613834565b905082815283838301111561387d57600080fd5b828260208301376000602084830101529392505050565b600082601f8301126138a557600080fd5b61173c8383356020850161385b565b600080604083850312156138c757600080fd5b8235915060208301356001600160401b038111156138e457600080fd5b6138f085828601613894565b9150509250929050565b80151581146108c357600080fd5b60006020828403121561391a57600080fd5b813561173c816138fa565b60008060006060848603121561393a57600080fd5b833561394581613539565b925060208401359150604084013561395c816138fa565b809150509250925092565b6000806040838503121561397a57600080fd5b82359150602083013561398c81613539565b809150509250929050565b600080602083850312156139aa57600080fd5b82356001600160401b038111156139c057600080fd5b6139cc858286016135d8565b90969095509350505050565b600080604083850312156139eb57600080fd5b82356139f681613539565b9150602083013561398c816138fa565b60008060008060808587031215613a1c57600080fd5b8435613a2781613539565b93506020850135613a3781613539565b92506040850135915060608501356001600160401b03811115613a5957600080fd5b8501601f81018713613a6a57600080fd5b61375e8782356020840161385b565b600060208284031215613a8b57600080fd5b81356001600160401b03811115613aa157600080fd5b6109f084828501613894565b60008060408385031215613ac057600080fd5b82359150602083013561398c816138fa565b60008060408385031215613ae557600080fd5b82356001600160401b03811115613afb57600080fd5b613b0785828601613894565b95602094909401359450505050565b600080600060408486031215613b2b57600080fd5b83356001600160401b03811115613b4157600080fd5b613b4d868287016135d8565b909450925050602084013561395c81613539565b60208152600060018060a01b03808451166020840152602084015160806040850152613b9060a08501826134cd565b9050816040860151166060850152816060860151166080850152809250505092915050565b60008060408385031215613bc857600080fd5b8235613bd381613539565b9150602083013561398c81613539565b6020808252825182820181905260009190848201906040850190845b8181101561382857835183529284019291840191600101613bff565b600080600080600060808688031215613c3357600080fd5b85356001600160401b0380821115613c4a57600080fd5b613c5689838a016135d8565b909750955060208801359150613c6b82613539565b90935060408701359080821115613c8157600080fd5b613c8d89838a01613682565b93506060880135915080821115613ca357600080fd5b50613cb088828901613682565b9150509295509295909350565b600181811c90821680613cd157607f821691505b602082108103613cf157634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215613d0957600080fd5b5051919050565b9182526001600160a01b0316602082015260400190565b60006020808385031215613d3a57600080fd5b82516001600160401b03811115613d5057600080fd5b8301601f81018513613d6157600080fd5b8051613d6f6136a38261365f565b81815260059190911b82018301908381019087831115613d8e57600080fd5b928401925b82841015613db5578351613da681613539565b82529284019290840190613d93565b979650505050505050565b8381528260208201526060604082015260006109ed60608301846134cd565b634e487b7160e01b600052601160045260246000fd5b8082018082111561074f5761074f613ddf565b600060208284031215613e1a57600080fd5b815161173c81613539565b9283526001600160a01b03918216602084015216604082015260600190565b602080825260159082015274185b1b1bdddb1a5cdd081b9bdd08195b98589b1959605a1b604082015260600190565b61190160f01b81526002810192909252602282015260420190565b602080825260119082015270696e76616c6964207369676e617475726560781b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b61ffff818116838216019080821115613eea57613eea613ddf565b5092915050565b6000613eff6136a384613834565b9050828152838383011115613f1357600080fd5b61173c8360208301846134a9565b600060208284031215613f3357600080fd5b81516001600160401b03811115613f4957600080fd5b8201601f81018413613f5a57600080fd5b6109f084825160208401613ef1565b60008151613f7b8185602086016134a9565b9290920192915050565b607b60f81b815278226e616d65223a2022486f726465204f534d2050617373202360381b60018201528451600090613fc481601a850160208a016134a9565b711116113232b9b1b934b83a34b7b7111d101160711b601a918401918201528551613ff681602c840160208a016134a9565b601160f91b602c9290910191820181905269161134b6b0b3b2911d1160b11b602d830152855161402d816037850160208a016134a9565b60379201918201527f2c2265787465726e616c5f75726c223a2268747470733a2f2f6f736d2e746f6f60388201526236399160e91b6058820152613db561409461408e605b84016d161130ba3a3934b13aba32b9911d60911b8152600e0190565b86613f69565b607d60f81b815260010190565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000008152600082516140d981601d8501602087016134a9565b91909101601d0192915050565b8281526040602082015260006109f060408301846134cd565b9283526001600160a01b03919091166020830152604082015260600190565b60006020828403121561413057600080fd5b815161173c816138fa565b60006001820161414d5761414d613ddf565b5060010190565b600082516141668184602087016134a9565b9190910192915050565b600081518084526020808501945080840160005b838110156141a057815187529582019590820190600101614184565b509495945050505050565b8481526080602082015260006141c46080830186614170565b6001600160a01b03949094166040830152506060015292915050565b8381526001600160a01b03831660208201526060604082018190526000906109ed90830184614170565b60006020828403121561421c57600080fd5b815163ffffffff8116811461173c57600080fd5b80516001600160401b038116811461424757600080fd5b919050565b60006020828403121561425e57600080fd5b61173c82614230565b60008261428457634e487b7160e01b600052601260045260246000fd5b500490565b808202811582820484141761074f5761074f613ddf565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906142e9908301846134cd565b9695505050505050565b60006020828403121561430557600080fd5b815161173c81613476565b60006080828403121561432257600080fd5b604051608081018181106001600160401b038211171561434457614344613619565b60405261435083614230565b815261435e60208401614230565b602082015261436f60408401614230565b604082015261438060608401614230565b6060820152939250505056fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220fbbfc472cf441143b71b10ccceace3a672c861b28b7708dd37c13bce6e8463a364736f6c63430008120033
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.