ERC-1155
Overview
Max Total Supply
64
Holders
42
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
OpenCollection
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT /** * @title OpenCollection - Provenance * @author zeroknots.eth * @notice This contract implements an ERC1155 collection with a minting mechanism that supports * a Merkle tree-based allowlist and provenance SBT. Users can mint up to a certain amount of tokens * if they are on the allowlist or have a provenance SBT. */ pragma solidity 0.8.19; // ERC1155 standard import {ERC1155} from "solady/tokens/ERC1155.sol"; // OpenZeppelin's Ownable contract for access control import {Ownable} from "openzeppelin-contracts/contracts/access/Ownable.sol"; // OpenZeppelin's MerkleProof contract for checking allowlist membership import {Strings} from "openzeppelin-contracts/contracts/utils/Strings.sol"; // OpenCollectionLib contract for additional utility functions import {OpenCollectionLib} from "./OpenCollectionLib.sol"; contract OpenCollection is ERC1155, Ownable { // Importing the library for address. This is used to convert an address to a bytes32. using OpenCollectionLib for address; // Custom errors error MaxMintAmount(uint256 amount); error InsufficientFunds(uint256 amount); error MintNotStarted(); error NotOnAllowlist(); // Events event Reveal(uint256 seed); event Withdraw(uint256 amount); // Token ID constants uint256 public constant TOKENID_COMMON = 1; uint256 public constant TOKENID_UNCOMMON = 2; uint256 public constant TOKENID_RARE = 3; // Maximum mint amount per user uint256 private MAX_MINT_AMOUNT = 2; // Total supply constants uint256 public immutable UNCOMMON_TOTAL_SUPPLY = 10; uint256 public immutable RARE_TOTAL_SUPPLY = 3; // Merkle tree root for the allowlist bytes32 public merkleTreeRoot; // Mint price in wei uint256 public MINTPRICE; // Base URI for metadata string private _uri; // Mapping of user's mint allowance mapping(bytes32 => uint256) public mintAllowance; // Queue of minted addresses address[] private queue; /** * @notice Constructs the OpenCollection contract. */ constructor() {} /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256 tokenId) public view override returns (string memory) { return string(abi.encodePacked(_uri, Strings.toString(tokenId))); } function updateURI(string memory newuri) public onlyOwner { _uri = newuri; } /** * * ADMIN FUNCTIONS * */ function airdrop(address[] calldata to, uint256[] calldata amount) external payable onlyOwner { uint256 toLength = to.length; require(toLength == amount.length, "Input Error"); for (uint256 i; i < toLength;) { _mint(to[i], TOKENID_COMMON, amount[i], ""); _recordToQueue(to[i], amount[i]); unchecked { ++i; } } } /** * @notice Withdraws the specified amount of Ether from the contract. * @dev Can only be called by the contract owner. * @param amount The amount of Ether to withdraw, or 0 to withdraw the entire balance. */ function withdraw(uint256 amount) external onlyOwner { if (amount == 0) amount = address(this).balance; payable(owner()).transfer(amount); emit Withdraw(amount); } /** * @notice Reveal the winners by selecting unique random winners from the queue of addresses that minted tokens. * @dev Generates two sets of unique random winners for the two token types (B and C) by utilizing the OpenCollectionLib. * The reveal process involves burning the OPEN tokens of the winners and minting new B or C tokens for them. * This function can only be called by the contract owner. */ function reveal() external onlyOwner { // Obtain a seed for random number generation from the previous block's RANDAO value uint256 seed = block.prevrandao; // Use the OpenCollectionLib's _selectUniqueRandom function to generate two sets of unique random winners. // - winners1: Represents the winners of TOKENID_B tokens // - winners2: Represents the winners of TOKENID_C tokens uint256[] memory winners1 = OpenCollectionLib._selectUniqueRandom(seed, queue.length, UNCOMMON_TOTAL_SUPPLY); uint256[] memory winners2 = OpenCollectionLib._selectUniqueRandom(seed + 1, queue.length, RARE_TOTAL_SUPPLY); // Iterate through the winners1 array for (uint256 i; i < winners1.length;) { // Get the address of the winner from the queue address winner = queue[winners1[i]]; // Burn 1 OPEN token from the winner's balance _burn(winner, TOKENID_COMMON, 1); // Mint 1 TOKENID_B token for the winner _mint(winner, TOKENID_UNCOMMON, 1, ""); // Safely increment the loop counterbatch unchecked { ++i; } } // Iterate through the winners2 array for (uint256 i; i < winners2.length;) { // Get the address of the winner from the queue address winner = queue[winners2[i]]; while (balanceOf(winner, TOKENID_COMMON) == 0) winner = queue[winners2[i] + 1]; // already won // Burn 1 OPEN token from the winner's balance _burn(winner, TOKENID_COMMON, 1); // Mint 1 TOKENID_C token for the winner _mint(winner, TOKENID_RARE, 1, ""); unchecked { ++i; } } // Emit the Reveal event with the seed used for random number generation emit Reveal(seed); } /** * * INTERNAL FUNCTIONS * */ /** * @notice Records the minted tokens to the queue. * @dev Adds the recipient address to the queue 'amount' number of times. * @param to The address to mint tokens to. * @param amount The number of tokens to mint. */ function _recordToQueue(address to, uint256 amount) internal { for (uint256 i; i < amount;) { queue.push(to); // amount <= MAX_MINT_AMOUNT, so this is safe unchecked { ++i; } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts 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/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 // 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 pragma solidity ^0.8.4; /// @notice Simple ERC1155 implementation. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/tokens/ERC1155.sol) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC1155.sol) /// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/token/ERC1155/ERC1155.sol) abstract contract ERC1155 { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The lengths of the input arrays are not the same. error ArrayLengthsMismatch(); /// @dev Cannot mint or transfer to the zero address. error TransferToZeroAddress(); /// @dev The recipient's balance has overflowed. error AccountBalanceOverflow(); /// @dev Insufficient balance. error InsufficientBalance(); /// @dev Only the token owner or an approved account can manage the tokens. error NotOwnerNorApproved(); /// @dev Cannot safely transfer to a contract that does not implement /// the ERC1155Receiver interface. error TransferToNonERC1155ReceiverImplementer(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* EVENTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Emitted when `amount` of token `id` is transferred /// from `from` to `to` by `operator`. event TransferSingle( address indexed operator, address indexed from, address indexed to, uint256 id, uint256 amount ); /// @dev Emitted when `amounts` of token `ids` are transferred /// from `from` to `to` by `operator`. event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] amounts ); /// @dev Emitted when `owner` enables or disables `operator` to manage all of their tokens. event ApprovalForAll(address indexed owner, address indexed operator, bool isApproved); /// @dev Emitted when the Uniform Resource Identifier (URI) for token `id` /// is updated to `value`. This event is not used in the base contract. /// You may need to emit this event depending on your URI logic. /// /// See: https://eips.ethereum.org/EIPS/eip-1155#metadata event URI(string value, uint256 indexed id); /// @dev `keccak256(bytes("TransferSingle(address,address,address,uint256,uint256)"))`. uint256 private constant _TRANSFER_SINGLE_EVENT_SIGNATURE = 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62; /// @dev `keccak256(bytes("TransferBatch(address,address,address,uint256[],uint256[])"))`. uint256 private constant _TRANSFER_BATCH_EVENT_SIGNATURE = 0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb; /// @dev `keccak256(bytes("ApprovalForAll(address,address,bool)"))`. uint256 private constant _APPROVAL_FOR_ALL_EVENT_SIGNATURE = 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* STORAGE */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The `ownerSlotSeed` of a given owner is given by. /// ``` /// let ownerSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, owner)) /// ``` /// /// The balance slot of `owner` is given by. /// ``` /// mstore(0x20, ownerSlotSeed) /// mstore(0x00, id) /// let balanceSlot := keccak256(0x00, 0x40) /// ``` /// /// The operator approval slot of `owner` is given by. /// ``` /// mstore(0x20, ownerSlotSeed) /// mstore(0x00, operator) /// let operatorApprovalSlot := keccak256(0x0c, 0x34) /// ``` uint256 private constant _ERC1155_MASTER_SLOT_SEED = 0x9a31110384e0b0c9; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* ERC1155 METADATA */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the URI for token `id`. /// /// You can either return the same templated URI for all token IDs, /// (e.g. "https://example.com/api/{id}.json"), /// or return a unique URI for each `id`. /// /// See: https://eips.ethereum.org/EIPS/eip-1155#metadata function uri(uint256 id) public view virtual returns (string memory); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* ERC1155 */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the amount of `id` owned by `owner`. function balanceOf(address owner, uint256 id) public view virtual returns (uint256 result) { /// @solidity memory-safe-assembly assembly { mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, shl(96, owner))) mstore(0x00, id) result := sload(keccak256(0x00, 0x40)) } } /// @dev Returns whether `operator` is approved to manage the tokens of `owner`. function isApprovedForAll(address owner, address operator) public view virtual returns (bool result) { /// @solidity memory-safe-assembly assembly { mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, shl(96, owner))) mstore(0x00, operator) result := sload(keccak256(0x0c, 0x34)) } } /// @dev Sets whether `operator` is approved to manage the tokens of the caller. /// /// Emits a {ApprovalForAll} event. function setApprovalForAll(address operator, bool isApproved) public virtual { /// @solidity memory-safe-assembly assembly { // Clear the upper 96 bits. operator := shr(96, shl(96, operator)) // Convert to 0 or 1. isApproved := iszero(iszero(isApproved)) // Update the `isApproved` for (`msg.sender`, `operator`). mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, shl(96, caller()))) mstore(0x00, operator) sstore(keccak256(0x0c, 0x34), isApproved) // Emit the {ApprovalForAll} event. mstore(0x00, isApproved) log3(0x00, 0x20, _APPROVAL_FOR_ALL_EVENT_SIGNATURE, caller(), operator) } } /// @dev Transfers `amount` of `id` from `from` to `to`. /// /// Requirements: /// - `to` cannot be the zero address. /// - `from` must have at least `amount` of `id`. /// - If the caller is not `from`, /// it must be approved to manage the tokens of `from`. /// - If `to` refers to a smart contract, it must implement /// {ERC1155-onERC1155Reveived}, which is called upon a batch transfer. /// /// Emits a {Transfer} event. function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) public virtual { if (_useBeforeTokenTransfer()) { _beforeTokenTransfer(from, to, _single(id), _single(amount), data); } /// @solidity memory-safe-assembly assembly { let fromSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, from)) let toSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, to)) mstore(0x20, fromSlotSeed) // Clear the upper 96 bits. from := shr(96, fromSlotSeed) to := shr(96, toSlotSeed) // If the caller is not `from`, do the authorization check. if iszero(eq(caller(), from)) { mstore(0x00, caller()) if iszero(sload(keccak256(0x0c, 0x34))) { mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`. revert(0x1c, 0x04) } } // Revert if `to` is the zero address. if iszero(to) { mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`. revert(0x1c, 0x04) } // Subtract and store the updated balance of `from`. { mstore(0x00, id) let fromBalanceSlot := keccak256(0x00, 0x40) let fromBalance := sload(fromBalanceSlot) if gt(amount, fromBalance) { mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`. revert(0x1c, 0x04) } sstore(fromBalanceSlot, sub(fromBalance, amount)) } // Increase and store the updated balance of `to`. { mstore(0x20, toSlotSeed) let toBalanceSlot := keccak256(0x00, 0x40) let toBalanceBefore := sload(toBalanceSlot) let toBalanceAfter := add(toBalanceBefore, amount) if lt(toBalanceAfter, toBalanceBefore) { mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`. revert(0x1c, 0x04) } sstore(toBalanceSlot, toBalanceAfter) } // Emit a {TransferSingle} event. { mstore(0x20, amount) log4(0x00, 0x40, _TRANSFER_SINGLE_EVENT_SIGNATURE, caller(), from, to) } } if (_useAfterTokenTransfer()) { _afterTokenTransfer(from, to, _single(id), _single(amount), data); } /// @solidity memory-safe-assembly assembly { // Do the {onERC1155Received} check if `to` is a smart contract. if extcodesize(to) { // Prepare the calldata. let m := mload(0x40) let onERC1155ReceivedSelector := 0xf23a6e61 mstore(m, onERC1155ReceivedSelector) mstore(add(m, 0x20), caller()) mstore(add(m, 0x40), from) mstore(add(m, 0x60), id) mstore(add(m, 0x80), amount) mstore(add(m, 0xa0), 0xa0) calldatacopy(add(m, 0xc0), sub(data.offset, 0x20), add(0x20, data.length)) // Revert if the call reverts. if iszero(call(gas(), to, 0, add(m, 0x1c), add(0xc4, data.length), m, 0x20)) { if returndatasize() { // Bubble up the revert if the delegatecall reverts. returndatacopy(0x00, 0x00, returndatasize()) revert(0x00, returndatasize()) } mstore(m, 0) } // Load the returndata and compare it. if iszero(eq(mload(m), shl(224, onERC1155ReceivedSelector))) { mstore(0x00, 0x9c05499b) // `TransferToNonERC1155ReceiverImplementer()`. revert(0x1c, 0x04) } } } } /// @dev Transfers `amounts` of `ids` from `from` to `to`. /// /// Requirements: /// - `to` cannot be the zero address. /// - `from` must have at least `amount` of `id`. /// - `ids` and `amounts` must have the same length. /// - If the caller is not `from`, /// it must be approved to manage the tokens of `from`. /// - If `to` refers to a smart contract, it must implement /// {ERC1155-onERC1155BatchReveived}, which is called upon a batch transfer. /// /// Emits a {TransferBatch} event. function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) public virtual { if (_useBeforeTokenTransfer()) { _beforeTokenTransfer(from, to, ids, amounts, data); } /// @solidity memory-safe-assembly assembly { if iszero(eq(ids.length, amounts.length)) { mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`. revert(0x1c, 0x04) } let fromSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, from)) let toSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, to)) mstore(0x20, fromSlotSeed) // Clear the upper 96 bits. from := shr(96, fromSlotSeed) to := shr(96, toSlotSeed) // Revert if `to` is the zero address. if iszero(to) { mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`. revert(0x1c, 0x04) } // If the caller is not `from`, do the authorization check. if iszero(eq(caller(), from)) { mstore(0x00, caller()) if iszero(sload(keccak256(0x0c, 0x34))) { mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`. revert(0x1c, 0x04) } } // Loop through all the `ids` and update the balances. { let end := shl(5, ids.length) for { let i := 0 } iszero(eq(i, end)) { i := add(i, 0x20) } { let amount := calldataload(add(amounts.offset, i)) // Subtract and store the updated balance of `from`. { mstore(0x20, fromSlotSeed) mstore(0x00, calldataload(add(ids.offset, i))) let fromBalanceSlot := keccak256(0x00, 0x40) let fromBalance := sload(fromBalanceSlot) if gt(amount, fromBalance) { mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`. revert(0x1c, 0x04) } sstore(fromBalanceSlot, sub(fromBalance, amount)) } // Increase and store the updated balance of `to`. { mstore(0x20, toSlotSeed) let toBalanceSlot := keccak256(0x00, 0x40) let toBalanceBefore := sload(toBalanceSlot) let toBalanceAfter := add(toBalanceBefore, amount) if lt(toBalanceAfter, toBalanceBefore) { mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`. revert(0x1c, 0x04) } sstore(toBalanceSlot, toBalanceAfter) } } } // Emit a {TransferBatch} event. { let m := mload(0x40) // Copy the `ids`. mstore(m, 0x40) let n := add(0x20, shl(5, ids.length)) let o := add(m, 0x40) calldatacopy(o, sub(ids.offset, 0x20), n) // Copy the `amounts`. mstore(add(m, 0x20), add(0x40, n)) o := add(o, n) n := add(0x20, shl(5, amounts.length)) calldatacopy(o, sub(amounts.offset, 0x20), n) n := sub(add(o, n), m) // Do the emit. log4(m, n, _TRANSFER_BATCH_EVENT_SIGNATURE, caller(), from, to) } } if (_useAfterTokenTransfer()) { _afterTokenTransferCalldata(from, to, ids, amounts, data); } /// @solidity memory-safe-assembly assembly { // Do the {onERC1155BatchReceived} check if `to` is a smart contract. if extcodesize(to) { let m := mload(0x40) // Prepare the calldata. let onERC1155BatchReceivedSelector := 0xbc197c81 mstore(m, onERC1155BatchReceivedSelector) mstore(add(m, 0x20), caller()) mstore(add(m, 0x40), from) // Copy the `ids`. mstore(add(m, 0x60), 0xa0) let n := add(0x20, shl(5, ids.length)) let o := add(m, 0xc0) calldatacopy(o, sub(ids.offset, 0x20), n) // Copy the `amounts`. let s := add(0xa0, n) mstore(add(m, 0x80), s) o := add(o, n) n := add(0x20, shl(5, amounts.length)) calldatacopy(o, sub(amounts.offset, 0x20), n) // Copy the `data`. mstore(add(m, 0xa0), add(s, n)) o := add(o, n) n := add(0x20, data.length) calldatacopy(o, sub(data.offset, 0x20), n) n := sub(add(o, n), add(m, 0x1c)) // Revert if the call reverts. if iszero(call(gas(), to, 0, add(m, 0x1c), n, m, 0x20)) { if returndatasize() { // Bubble up the revert if the delegatecall reverts. returndatacopy(0x00, 0x00, returndatasize()) revert(0x00, returndatasize()) } mstore(m, 0) } // Load the returndata and compare it. if iszero(eq(mload(m), shl(224, onERC1155BatchReceivedSelector))) { mstore(0x00, 0x9c05499b) // `TransferToNonERC1155ReceiverImplementer()`. revert(0x1c, 0x04) } } } } /// @dev Returns the amounts of `ids` for `owners. /// /// Requirements: /// - `owners` and `ids` must have the same length. function balanceOfBatch(address[] calldata owners, uint256[] calldata ids) public view virtual returns (uint256[] memory balances) { /// @solidity memory-safe-assembly assembly { if iszero(eq(ids.length, owners.length)) { mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`. revert(0x1c, 0x04) } balances := mload(0x40) mstore(balances, ids.length) let o := add(balances, 0x20) let end := shl(5, ids.length) mstore(0x40, add(end, o)) // Loop through all the `ids` and load the balances. for { let i := 0 } iszero(eq(i, end)) { i := add(i, 0x20) } { let owner := calldataload(add(owners.offset, i)) mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, shl(96, owner))) mstore(0x00, calldataload(add(ids.offset, i))) mstore(add(o, i), sload(keccak256(0x00, 0x40))) } } } /// @dev Returns true if this contract implements the interface defined by `interfaceId`. /// See: https://eips.ethereum.org/EIPS/eip-165 /// This function call must use less than 30000 gas. function supportsInterface(bytes4 interfaceId) public view virtual returns (bool result) { /// @solidity memory-safe-assembly assembly { let s := shr(224, interfaceId) // ERC165: 0x01ffc9a7, ERC1155: 0xd9b67a26, ERC1155MetadataURI: 0x0e89341c. result := or(or(eq(s, 0x01ffc9a7), eq(s, 0xd9b67a26)), eq(s, 0x0e89341c)) } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* INTERNAL MINT FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Mints `amount` of `id` to `to`. /// /// Requirements: /// - `to` cannot be the zero address. /// - If `to` refers to a smart contract, it must implement /// {ERC1155-onERC1155Reveived}, which is called upon a batch transfer. /// /// Emits a {Transfer} event. function _mint(address to, uint256 id, uint256 amount, bytes memory data) internal virtual { if (_useBeforeTokenTransfer()) { _beforeTokenTransfer(address(0), to, _single(id), _single(amount), data); } /// @solidity memory-safe-assembly assembly { let toSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, to)) // Clear the upper 96 bits. to := shr(96, toSlotSeed) // Revert if `to` is the zero address. if iszero(to) { mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`. revert(0x1c, 0x04) } // Increase and store the updated balance of `to`. { mstore(0x20, toSlotSeed) mstore(0x00, id) let toBalanceSlot := keccak256(0x00, 0x40) let toBalanceBefore := sload(toBalanceSlot) let toBalanceAfter := add(toBalanceBefore, amount) if lt(toBalanceAfter, toBalanceBefore) { mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`. revert(0x1c, 0x04) } sstore(toBalanceSlot, toBalanceAfter) } // Emit a {TransferSingle} event. { mstore(0x00, id) mstore(0x20, amount) log4(0x00, 0x40, _TRANSFER_SINGLE_EVENT_SIGNATURE, caller(), 0, to) } } if (_useAfterTokenTransfer()) { _afterTokenTransfer(address(0), to, _single(id), _single(amount), data); } if (_hasCode(to)) _checkOnERC1155Received(address(0), to, id, amount, data); } /// @dev Mints `amounts` of `ids` to `to`. /// /// Requirements: /// - `to` cannot be the zero address. /// - `ids` and `amounts` must have the same length. /// - If `to` refers to a smart contract, it must implement /// {ERC1155-onERC1155BatchReveived}, which is called upon a batch transfer. /// /// Emits a {TransferBatch} event. function _batchMint( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { if (_useBeforeTokenTransfer()) { _beforeTokenTransfer(address(0), to, ids, amounts, data); } /// @solidity memory-safe-assembly assembly { if iszero(eq(mload(ids), mload(amounts))) { mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`. revert(0x1c, 0x04) } let toSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, to)) // Clear the upper 96 bits. to := shr(96, toSlotSeed) // Revert if `to` is the zero address. if iszero(to) { mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`. revert(0x1c, 0x04) } // Loop through all the `ids` and update the balances. { let end := shl(5, mload(ids)) for { let i := 0 } iszero(eq(i, end)) {} { i := add(i, 0x20) let amount := mload(add(amounts, i)) // Increase and store the updated balance of `to`. { mstore(0x20, toSlotSeed) mstore(0x00, mload(add(ids, i))) let toBalanceSlot := keccak256(0x00, 0x40) let toBalanceBefore := sload(toBalanceSlot) let toBalanceAfter := add(toBalanceBefore, amount) if lt(toBalanceAfter, toBalanceBefore) { mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`. revert(0x1c, 0x04) } sstore(toBalanceSlot, toBalanceAfter) } } } // Emit a {TransferBatch} event. { let m := mload(0x40) // Copy the `ids`. mstore(m, 0x40) let n := add(0x20, shl(5, mload(ids))) let o := add(m, 0x40) pop(staticcall(gas(), 4, ids, n, o, n)) // Copy the `amounts`. mstore(add(m, 0x20), add(0x40, returndatasize())) o := add(o, returndatasize()) n := add(0x20, shl(5, mload(amounts))) pop(staticcall(gas(), 4, amounts, n, o, n)) n := sub(add(o, returndatasize()), m) // Do the emit. log4(m, n, _TRANSFER_BATCH_EVENT_SIGNATURE, caller(), 0, to) } } if (_useAfterTokenTransfer()) { _afterTokenTransfer(address(0), to, ids, amounts, data); } if (_hasCode(to)) _checkOnERC1155BatchReceived(address(0), to, ids, amounts, data); } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* INTERNAL BURN FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Equivalent to `_burn(address(0), from, id, amount)`. function _burn(address from, uint256 id, uint256 amount) internal virtual { _burn(address(0), from, id, amount); } /// @dev Destroys `amount` of `id` from `from`. /// /// Requirements: /// - `from` must have at least `amount` of `id`. /// - If `by` is not the zero address, it must be either `from`, /// or approved to manage the tokens of `from`. /// /// Emits a {Transfer} event. function _burn(address by, address from, uint256 id, uint256 amount) internal virtual { if (_useBeforeTokenTransfer()) { _beforeTokenTransfer(from, address(0), _single(id), _single(amount), ""); } /// @solidity memory-safe-assembly assembly { let fromSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, from)) mstore(0x20, fromSlotSeed) // Clear the upper 96 bits. from := shr(96, fromSlotSeed) by := shr(96, shl(96, by)) // If `by` is not the zero address, and not equal to `from`, // check if it is approved to manage all the tokens of `from`. if iszero(or(iszero(by), eq(by, from))) { mstore(0x00, by) if iszero(sload(keccak256(0x0c, 0x34))) { mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`. revert(0x1c, 0x04) } } // Decrease and store the updated balance of `from`. { mstore(0x00, id) let fromBalanceSlot := keccak256(0x00, 0x40) let fromBalance := sload(fromBalanceSlot) if gt(amount, fromBalance) { mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`. revert(0x1c, 0x04) } sstore(fromBalanceSlot, sub(fromBalance, amount)) } // Emit a {TransferSingle} event. { mstore(0x00, id) mstore(0x20, amount) log4(0x00, 0x40, _TRANSFER_SINGLE_EVENT_SIGNATURE, caller(), from, 0) } } if (_useAfterTokenTransfer()) { _afterTokenTransfer(from, address(0), _single(id), _single(amount), ""); } } /// @dev Equivalent to `_batchBurn(address(0), from, ids, amounts)`. function _batchBurn(address from, uint256[] memory ids, uint256[] memory amounts) internal virtual { _batchBurn(address(0), from, ids, amounts); } /// @dev Destroys `amounts` of `ids` from `from`. /// /// Requirements: /// - `ids` and `amounts` must have the same length. /// - `from` must have at least `amounts` of `ids`. /// - If `by` is not the zero address, it must be either `from`, /// or approved to manage the tokens of `from`. /// /// Emits a {TransferBatch} event. function _batchBurn(address by, address from, uint256[] memory ids, uint256[] memory amounts) internal virtual { if (_useBeforeTokenTransfer()) { _beforeTokenTransfer(from, address(0), ids, amounts, ""); } /// @solidity memory-safe-assembly assembly { if iszero(eq(mload(ids), mload(amounts))) { mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`. revert(0x1c, 0x04) } let fromSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, from)) mstore(0x20, fromSlotSeed) // Clear the upper 96 bits. from := shr(96, fromSlotSeed) by := shr(96, shl(96, by)) // If `by` is not the zero address, and not equal to `from`, // check if it is approved to manage all the tokens of `from`. if iszero(or(iszero(by), eq(by, from))) { mstore(0x00, by) if iszero(sload(keccak256(0x0c, 0x34))) { mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`. revert(0x1c, 0x04) } } // Loop through all the `ids` and update the balances. { let end := shl(5, mload(ids)) for { let i := 0 } iszero(eq(i, end)) {} { i := add(i, 0x20) let amount := mload(add(amounts, i)) // Increase and store the updated balance of `to`. { mstore(0x00, mload(add(ids, i))) let fromBalanceSlot := keccak256(0x00, 0x40) let fromBalance := sload(fromBalanceSlot) if gt(amount, fromBalance) { mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`. revert(0x1c, 0x04) } sstore(fromBalanceSlot, sub(fromBalance, amount)) } } } // Emit a {TransferBatch} event. { let m := mload(0x40) // Copy the `ids`. mstore(m, 0x40) let n := add(0x20, shl(5, mload(ids))) let o := add(m, 0x40) pop(staticcall(gas(), 4, ids, n, o, n)) // Copy the `amounts`. mstore(add(m, 0x20), add(0x40, returndatasize())) o := add(o, returndatasize()) n := add(0x20, shl(5, mload(amounts))) pop(staticcall(gas(), 4, amounts, n, o, n)) n := sub(add(o, returndatasize()), m) // Do the emit. log4(m, n, _TRANSFER_BATCH_EVENT_SIGNATURE, caller(), from, 0) } } if (_useAfterTokenTransfer()) { _afterTokenTransfer(from, address(0), ids, amounts, ""); } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* INTERNAL APPROVAL FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Approve or remove the `operator` as an operator for `by`, /// without authorization checks. /// /// Emits a {ApprovalForAll} event. function _setApprovalForAll(address by, address operator, bool isApproved) internal virtual { /// @solidity memory-safe-assembly assembly { // Clear the upper 96 bits. operator := shr(96, shl(96, operator)) // Convert to 0 or 1. isApproved := iszero(iszero(isApproved)) // Update the `isApproved` for (`by`, `operator`). mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, shl(96, by))) mstore(0x00, operator) sstore(keccak256(0x0c, 0x34), isApproved) // Emit the {ApprovalForAll} event. mstore(0x00, isApproved) log3(0x00, 0x20, _APPROVAL_FOR_ALL_EVENT_SIGNATURE, caller(), operator) } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* INTERNAL TRANSFER FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Equivalent to `_safeTransfer(address(0), from, to, id, amount, data)`. function _safeTransfer(address from, address to, uint256 id, uint256 amount, bytes memory data) internal virtual { _safeTransfer(address(0), from, to, id, amount, data); } /// @dev Transfers `amount` of `id` from `from` to `to`. /// /// Requirements: /// - `to` cannot be the zero address. /// - `from` must have at least `amount` of `id`. /// - If `by` is not the zero address, it must be either `from`, /// or approved to manage the tokens of `from`. /// - If `to` refers to a smart contract, it must implement /// {ERC1155-onERC1155Reveived}, which is called upon a batch transfer. /// /// Emits a {Transfer} event. function _safeTransfer( address by, address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { if (_useBeforeTokenTransfer()) { _beforeTokenTransfer(from, to, _single(id), _single(amount), data); } /// @solidity memory-safe-assembly assembly { let fromSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, from)) let toSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, to)) mstore(0x20, fromSlotSeed) // Clear the upper 96 bits. from := shr(96, fromSlotSeed) to := shr(96, toSlotSeed) by := shr(96, shl(96, by)) // If `by` is not the zero address, and not equal to `from`, // check if it is approved to manage all the tokens of `from`. if iszero(or(iszero(by), eq(by, from))) { mstore(0x00, by) if iszero(sload(keccak256(0x0c, 0x34))) { mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`. revert(0x1c, 0x04) } } // Revert if `to` is the zero address. if iszero(to) { mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`. revert(0x1c, 0x04) } // Subtract and store the updated balance of `from`. { mstore(0x00, id) let fromBalanceSlot := keccak256(0x00, 0x40) let fromBalance := sload(fromBalanceSlot) if gt(amount, fromBalance) { mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`. revert(0x1c, 0x04) } sstore(fromBalanceSlot, sub(fromBalance, amount)) } // Increase and store the updated balance of `to`. { mstore(0x20, toSlotSeed) let toBalanceSlot := keccak256(0x00, 0x40) let toBalanceBefore := sload(toBalanceSlot) let toBalanceAfter := add(toBalanceBefore, amount) if lt(toBalanceAfter, toBalanceBefore) { mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`. revert(0x1c, 0x04) } sstore(toBalanceSlot, toBalanceAfter) } // Emit a {TransferSingle} event. { mstore(0x20, amount) log4(0x00, 0x40, _TRANSFER_SINGLE_EVENT_SIGNATURE, caller(), from, to) } } if (_hasCode(to)) _checkOnERC1155Received(from, to, id, amount, data); if (_useAfterTokenTransfer()) { _afterTokenTransfer(from, to, _single(id), _single(amount), data); } } /// @dev Equivalent to `_safeBatchTransfer(address(0), from, to, ids, amounts, data)`. function _safeBatchTransfer( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { _safeBatchTransfer(address(0), from, to, ids, amounts, data); } /// @dev Transfers `amounts` of `ids` from `from` to `to`. /// /// Requirements: /// - `to` cannot be the zero address. /// - `ids` and `amounts` must have the same length. /// - `from` must have at least `amounts` of `ids`. /// - If `by` is not the zero address, it must be either `from`, /// or approved to manage the tokens of `from`. /// - If `to` refers to a smart contract, it must implement /// {ERC1155-onERC1155BatchReveived}, which is called upon a batch transfer. /// /// Emits a {TransferBatch} event. function _safeBatchTransfer( address by, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { if (_useBeforeTokenTransfer()) { _beforeTokenTransfer(from, to, ids, amounts, data); } /// @solidity memory-safe-assembly assembly { if iszero(eq(mload(ids), mload(amounts))) { mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`. revert(0x1c, 0x04) } let fromSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, from)) let toSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, to)) mstore(0x20, fromSlotSeed) // Clear the upper 96 bits. from := shr(96, fromSlotSeed) to := shr(96, toSlotSeed) by := shr(96, shl(96, by)) // Revert if `to` is the zero address. if iszero(to) { mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`. revert(0x1c, 0x04) } // If `by` is not the zero address, and not equal to `from`, // check if it is approved to manage all the tokens of `from`. if iszero(or(iszero(by), eq(by, from))) { mstore(0x00, by) if iszero(sload(keccak256(0x0c, 0x34))) { mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`. revert(0x1c, 0x04) } } // Loop through all the `ids` and update the balances. { let end := shl(5, mload(ids)) for { let i := 0 } iszero(eq(i, end)) {} { i := add(i, 0x20) let amount := mload(add(amounts, i)) // Subtract and store the updated balance of `from`. { mstore(0x20, fromSlotSeed) mstore(0x00, mload(add(ids, i))) let fromBalanceSlot := keccak256(0x00, 0x40) let fromBalance := sload(fromBalanceSlot) if gt(amount, fromBalance) { mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`. revert(0x1c, 0x04) } sstore(fromBalanceSlot, sub(fromBalance, amount)) } // Increase and store the updated balance of `to`. { mstore(0x20, toSlotSeed) let toBalanceSlot := keccak256(0x00, 0x40) let toBalanceBefore := sload(toBalanceSlot) let toBalanceAfter := add(toBalanceBefore, amount) if lt(toBalanceAfter, toBalanceBefore) { mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`. revert(0x1c, 0x04) } sstore(toBalanceSlot, toBalanceAfter) } } } // Emit a {TransferBatch} event. { let m := mload(0x40) // Copy the `ids`. mstore(m, 0x40) let n := add(0x20, shl(5, mload(ids))) let o := add(m, 0x40) pop(staticcall(gas(), 4, ids, n, o, n)) // Copy the `amounts`. mstore(add(m, 0x20), add(0x40, returndatasize())) o := add(o, returndatasize()) n := add(0x20, shl(5, mload(amounts))) pop(staticcall(gas(), 4, amounts, n, o, n)) n := sub(add(o, returndatasize()), m) // Do the emit. log4(m, n, _TRANSFER_BATCH_EVENT_SIGNATURE, caller(), from, to) } } if (_hasCode(to)) _checkOnERC1155BatchReceived(from, to, ids, amounts, data); if (_useAfterTokenTransfer()) { _afterTokenTransfer(from, to, ids, amounts, data); } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* HOOKS FOR OVERRIDING */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Override this function to return true if `_beforeTokenTransfer` is used. /// The is to help the compiler avoid producing dead bytecode. function _useBeforeTokenTransfer() internal view virtual returns (bool) { return false; } /// @dev Hook that is called before any token transfer. /// This includes minting and burning, as well as batched variants. /// /// The same hook is called on both single and batched variants. /// For single transfers, the length of the `id` and `amount` arrays are 1. function _beforeTokenTransfer( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} /// @dev Override this function to return true if `_afterTokenTransfer` is used. /// The is to help the compiler avoid producing dead bytecode. function _useAfterTokenTransfer() internal view virtual returns (bool) { return false; } /// @dev Hook that is called after any token transfer. /// This includes minting and burning, as well as batched variants. /// /// The same hook is called on both single and batched variants. /// For single transfers, the length of the `id` and `amount` arrays are 1. function _afterTokenTransfer( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* PRIVATE HELPERS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Helper for calling the `_afterTokenTransfer` hook. /// The is to help the compiler avoid producing dead bytecode. function _afterTokenTransferCalldata( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) private { if (_useAfterTokenTransfer()) { _afterTokenTransfer(from, to, ids, amounts, data); } } /// @dev Returns if `a` has bytecode of non-zero length. function _hasCode(address a) private view returns (bool result) { /// @solidity memory-safe-assembly assembly { result := extcodesize(a) // Can handle dirty upper bits. } } /// @dev Perform a call to invoke {IERC1155Receiver-onERC1155Received} on `to`. /// Reverts if the target does not support the function correctly. function _checkOnERC1155Received( address from, address to, uint256 id, uint256 amount, bytes memory data ) private { /// @solidity memory-safe-assembly assembly { // Prepare the calldata. let m := mload(0x40) let onERC1155ReceivedSelector := 0xf23a6e61 mstore(m, onERC1155ReceivedSelector) mstore(add(m, 0x20), caller()) mstore(add(m, 0x40), shr(96, shl(96, from))) mstore(add(m, 0x60), id) mstore(add(m, 0x80), amount) mstore(add(m, 0xa0), 0xa0) let n := mload(data) mstore(add(m, 0xc0), n) if n { pop(staticcall(gas(), 4, add(data, 0x20), n, add(m, 0xe0), n)) } // Revert if the call reverts. if iszero(call(gas(), to, 0, add(m, 0x1c), add(0xc4, n), m, 0x20)) { if returndatasize() { // Bubble up the revert if the delegatecall reverts. returndatacopy(0x00, 0x00, returndatasize()) revert(0x00, returndatasize()) } mstore(m, 0) } // Load the returndata and compare it. if iszero(eq(mload(m), shl(224, onERC1155ReceivedSelector))) { mstore(0x00, 0x9c05499b) // `TransferToNonERC1155ReceiverImplementer()`. revert(0x1c, 0x04) } } } /// @dev Perform a call to invoke {IERC1155Receiver-onERC1155BatchReceived} on `to`. /// Reverts if the target does not support the function correctly. function _checkOnERC1155BatchReceived( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { /// @solidity memory-safe-assembly assembly { // Prepare the calldata. let m := mload(0x40) let onERC1155BatchReceivedSelector := 0xbc197c81 mstore(m, onERC1155BatchReceivedSelector) mstore(add(m, 0x20), caller()) mstore(add(m, 0x40), shr(96, shl(96, from))) // Copy the `ids`. mstore(add(m, 0x60), 0xa0) let n := add(0x20, shl(5, mload(ids))) let o := add(m, 0xc0) pop(staticcall(gas(), 4, ids, n, o, n)) // Copy the `amounts`. let s := add(0xa0, returndatasize()) mstore(add(m, 0x80), s) o := add(o, returndatasize()) n := add(0x20, shl(5, mload(amounts))) pop(staticcall(gas(), 4, amounts, n, o, n)) // Copy the `data`. mstore(add(m, 0xa0), add(s, returndatasize())) o := add(o, returndatasize()) n := add(0x20, mload(data)) pop(staticcall(gas(), 4, data, n, o, n)) n := sub(add(o, returndatasize()), add(m, 0x1c)) // Revert if the call reverts. if iszero(call(gas(), to, 0, add(m, 0x1c), n, m, 0x20)) { if returndatasize() { // Bubble up the revert if the delegatecall reverts. returndatacopy(0x00, 0x00, returndatasize()) revert(0x00, returndatasize()) } mstore(m, 0) } // Load the returndata and compare it. if iszero(eq(mload(m), shl(224, onERC1155BatchReceivedSelector))) { mstore(0x00, 0x9c05499b) // `TransferToNonERC1155ReceiverImplementer()`. revert(0x1c, 0x04) } } } /// @dev Returns `x` in an array with a single element. function _single(uint256 x) private pure returns (uint256[] memory result) { assembly { result := mload(0x40) mstore(0x40, add(result, 0x40)) mstore(result, 1) mstore(add(result, 0x20), x) } } }
pragma solidity ^0.8.0; library OpenCollectionLib { function _isUnique(uint256 randomNumber, uint256[] memory selected) private pure returns (bool) { for (uint256 j = 0; j < selected.length; j++) { if (selected[j] == randomNumber) { return false; } } return true; } function _selectUniqueRandom(uint256 seed, uint256 max, uint256 count) internal pure returns (uint256[] memory) { require(max >= count, "Count must be less than or equal to max"); uint256[] memory selected = new uint256[](count); uint256 selectedIndex = 0; for (uint256 i = 0; selectedIndex < count; i++) { uint256 randomNumber = uint256(keccak256(abi.encodePacked(seed, selectedIndex, i))) % max; bool isUnique = _isUnique(randomNumber, selected); if (isUnique) { selected[selectedIndex] = randomNumber; selectedIndex++; } } return selected; } function toBytes32(address addr) internal pure returns (bytes32) { return bytes32(uint256(uint160(addr)) << 96); } }
{ "remappings": [ "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "solady/=lib/solady/src/", "solmate/=lib/solmate/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccountBalanceOverflow","type":"error"},{"inputs":[],"name":"ArrayLengthsMismatch","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"InsufficientFunds","type":"error"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MaxMintAmount","type":"error"},{"inputs":[],"name":"MintNotStarted","type":"error"},{"inputs":[],"name":"NotOnAllowlist","type":"error"},{"inputs":[],"name":"NotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferToNonERC1155ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"isApproved","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":false,"internalType":"uint256","name":"seed","type":"uint256"}],"name":"Reveal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"MINTPRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RARE_TOTAL_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKENID_COMMON","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKENID_RARE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKENID_UNCOMMON","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UNCOMMON_TOTAL_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"amount","type":"uint256[]"}],"name":"airdrop","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"owners","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"balances","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"result","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleTreeRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"mintAllowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","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":"isApproved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"result","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newuri","type":"string"}],"name":"updateURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c06040526002600155600a608052600360a05234801561001f57600080fd5b506100293361002e565b61007e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60805160a051611acd6100b1600039600081816103a301526109bb01526000818161022301526109800152611acd6000f3fe60806040526004361061013f5760003560e01c8063715018a6116100b6578063d679ad381161006f578063d679ad38146103e5578063e985e9c5146103fa578063ee9df88414610434578063f242432a14610449578063f2fde38b14610469578063f716aee91461048957600080fd5b8063715018a61461031f5780638da5cb5b14610334578063a22cb4651461035c578063a475b5dd1461037c578063a5c1c9f714610391578063c30f4a5a146103c557600080fd5b80632eb2c2d6116101085780632eb2c2d6146102675780632edb6b6f146102875780634c043ef1146102b45780634e1273f4146102c95780635dee9b17146102f6578063672434821461030c57600080fd5b8062fdd58e1461014457806301ffc9a7146101975780630e89341c146101e45780631a6e0376146102115780632e1a7d4d14610245575b600080fd5b34801561015057600080fd5b5061018461015f3660046113c9565b60008260601b679a31110384e0b0c91760205281600052604060002054905092915050565b6040519081526020015b60405180910390f35b3480156101a357600080fd5b506101d46101b23660046113f3565b6301ffc9a760e09190911c90811463d9b67a26821417630e89341c9091141790565b604051901515815260200161018e565b3480156101f057600080fd5b506102046101ff366004611424565b61049f565b60405161018e9190611461565b34801561021d57600080fd5b506101847f000000000000000000000000000000000000000000000000000000000000000081565b34801561025157600080fd5b50610265610260366004611424565b6104d3565b005b34801561027357600080fd5b50610265610282366004611522565b610556565b34801561029357600080fd5b506101846102a2366004611424565b60056020526000908152604090205481565b3480156102c057600080fd5b50610184600181565b3480156102d557600080fd5b506102e96102e43660046115dd565b610782565b60405161018e9190611649565b34801561030257600080fd5b5061018460035481565b61026561031a3660046115dd565b6107f2565b34801561032b57600080fd5b506102656108fa565b34801561034057600080fd5b506000546040516001600160a01b03909116815260200161018e565b34801561036857600080fd5b5061026561037736600461168d565b61090e565b34801561038857600080fd5b50610265610968565b34801561039d57600080fd5b506101847f000000000000000000000000000000000000000000000000000000000000000081565b3480156103d157600080fd5b506102656103e03660046116df565b610b9b565b3480156103f157600080fd5b50610184600381565b34801561040657600080fd5b506101d4610415366004611790565b60609190911b679a31110384e0b0c9176020526000526034600c205490565b34801561044057600080fd5b50610184600281565b34801561045557600080fd5b506102656104643660046117c3565b610bb3565b34801561047557600080fd5b5061026561048436600461183b565b610d16565b34801561049557600080fd5b5061018460025481565b606060046104ac83610d8f565b6040516020016104bd929190611890565b6040516020818303038152906040529050919050565b6104db610e22565b806000036104e65750475b600080546040516001600160a01b039091169183156108fc02918491818181858888f1935050505015801561051f573d6000803e3d6000fd5b506040518181527f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d9060200160405180910390a150565b82851461056b57633b800a466000526004601cfd5b8760601b679a31110384e0b0c9178760601b679a31110384e0b0c917816020528160601c99508060601c9850886105aa5763ea553b346000526004601cfd5b8933146105cd57336000526034600c20546105cd57634b6e7f186000526004601cfd5b8660051b60005b81811461063e578088013584602052818b013560005260406000208054808311156106075763f4d678b86000526004601cfd5b829003905560208490526040600020805480830181811015610631576301336cea6000526004601cfd5b90915550506020016105d4565b50505050604051604081528560051b602001604082018160208a03823760408201602084810191909152600587901b01910181601f198801823701819003888a337f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8486a450506106ad600090565b156106c2576106c28888888888888888610e7c565b863b156107785760405163bc197c8180825233602083015289604083015260a060608301528660051b60200160c083018160208b0382378160a00180608086015282820191508760051b60200192508260208a038337820160a085015260208501910181601f198701823701829003601b190160208382601c820160008e5af161075b573d15610756573d6000803e3d6000fd5b600083525b508060e01b82511461077557639c05499b6000526004601cfd5b50505b5050505050505050565b606083821461079957633b800a466000526004601cfd5b6040519050818152602081018260051b81810160405260005b8181146107e757679a31110384e0b0c98882013560601b176020908152868201356000908152604090205484830152016107b2565b505050949350505050565b6107fa610e22565b8281811461083d5760405162461bcd60e51b815260206004820152600b60248201526a24b7383aba1022b93937b960a91b60448201526064015b60405180910390fd5b60005b818110156108f2576108a286868381811061085d5761085d611917565b9050602002016020810190610872919061183b565b600186868581811061088657610886611917565b9050602002013560405180602001604052806000815250610e81565b6108ea8686838181106108b7576108b7611917565b90506020020160208101906108cc919061183b565b8585848181106108de576108de611917565b90506020020135610f29565b600101610840565b505050505050565b610902610e22565b61090c6000610f8b565b565b8160601b60601c915080151590503360601b679a31110384e0b0c91760205281600052806034600c20558060005281337f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160206000a35050565b610970610e22565b60065444906000906109a49083907f0000000000000000000000000000000000000000000000000000000000000000610fdb565b905060006109df6109b6846001611943565b6006547f0000000000000000000000000000000000000000000000000000000000000000610fdb565b905060005b8251811015610a645760006006848381518110610a0357610a03611917565b602002602001015181548110610a1b57610a1b611917565b6000918252602090912001546001600160a01b03169050610a3e81600180611135565b610a5b816002600160405180602001604052806000815250610e81565b506001016109e4565b5060005b8151811015610b625760006006838381518110610a8757610a87611917565b602002602001015181548110610a9f57610a9f611917565b6000918252602090912001546001600160a01b031690505b679a31110384e0b0c9606082901b17602052600160009081526040902054600003610b30576006838381518110610af057610af0611917565b60200260200101516001610b049190611943565b81548110610b1457610b14611917565b6000918252602090912001546001600160a01b03169050610ab7565b610b3c81600180611135565b610b59816003600160405180602001604052806000815250610e81565b50600101610a68565b506040518381527f1747b48b6ade85d7dc97c0f523e0e780795930a468c01b18a51546791fdd3ac09060200160405180910390a1505050565b610ba3610e22565b6004610baf828261199c565b5050565b8560601b679a31110384e0b0c9178560601b679a31110384e0b0c917816020528160601c97508060601c9650873314610c0257336000526034600c2054610c0257634b6e7f186000526004601cfd5b86610c155763ea553b346000526004601cfd5b8560005260406000209150815480861115610c385763f4d678b86000526004601cfd5b8581038355508060205260406000209150815485810181811015610c64576301336cea6000526004601cfd5b909255505060208390528486337fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260406000a4843b156108f25760405163f23a6e6180825233602083015287604083015285606083015284608083015260a080830152826020016020850360c08401376020828460c401601c850160008b5af1610cfd573d15610cf8573d6000803e3d6000fd5b600082525b8060e01b82511461077857639c05499b6000526004601cfd5b610d1e610e22565b6001600160a01b038116610d835760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610834565b610d8c81610f8b565b50565b60606000610d9c83611142565b600101905060008167ffffffffffffffff811115610dbc57610dbc6116c9565b6040519080825280601f01601f191660200182016040528015610de6576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084610df057509392505050565b6000546001600160a01b0316331461090c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610834565b610778565b610e8c565b50505050565b8360601b679a31110384e0b0c9178060601c945084610eb35763ea553b346000526004601cfd5b80602052836000526040600020805484810181811015610edb576301336cea6000526004601cfd5b808355505050508260005281602052836000337fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260406000a4833b15610e8657610e8660008585858561121b565b60005b81811015610f865760068054600180820183556000929092527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b0319166001600160a01b03861617905501610f2c565b505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60608183101561103d5760405162461bcd60e51b815260206004820152602760248201527f436f756e74206d757374206265206c657373207468616e206f7220657175616c604482015266040e8de40dac2f60cb1b6064820152608401610834565b60008267ffffffffffffffff811115611058576110586116c9565b604051908082528060200260200182016040528015611081578160200160208202803683370190505b5090506000805b8482101561112a5760408051602081018990529081018390526060810182905260009087906080016040516020818303038152906040528051906020012060001c6110d39190611a5c565b905060006110e182866112b4565b9050801561111557818585815181106110fc576110fc611917565b60209081029190910101528361111181611a7e565b9450505b5050808061112290611a7e565b915050611088565b509095945050505050565b610f866000848484611307565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106111815772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106111ad576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106111cb57662386f26fc10000830492506010015b6305f5e10083106111e3576305f5e100830492506008015b61271083106111f757612710830492506004015b60648310611209576064830492506002015b600a8310611215576001015b92915050565b60405163f23a6e618082523360208301528660601b60601c604083015284606083015283608083015260a08083015282518060c08401528015611268578060e08401826020870160045afa505b6020838260c401601c860160008b5af1611291573d1561128c573d6000803e3d6000fd5b600083525b508060e01b8251146112ab57639c05499b6000526004601cfd5b50505050505050565b6000805b82518110156112fd57838382815181106112d4576112d4611917565b6020026020010151036112eb576000915050611215565b806112f581611a7e565b9150506112b8565b5060019392505050565b679a31110384e0b0c9606093841b1760208190526001600160a01b039094169390921c9183158484141761135157836000526034600c205461135157634b6e7f186000526004601cfd5b8160005260406000208054808311156113725763f4d678b86000526004601cfd5b82900390556000828152602082905283337fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62604084a4610e86565b80356001600160a01b03811681146113c457600080fd5b919050565b600080604083850312156113dc57600080fd5b6113e5836113ad565b946020939093013593505050565b60006020828403121561140557600080fd5b81356001600160e01b03198116811461141d57600080fd5b9392505050565b60006020828403121561143657600080fd5b5035919050565b60005b83811015611458578181015183820152602001611440565b50506000910152565b602081526000825180602084015261148081604085016020870161143d565b601f01601f19169190910160400192915050565b60008083601f8401126114a657600080fd5b50813567ffffffffffffffff8111156114be57600080fd5b6020830191508360208260051b85010111156114d957600080fd5b9250929050565b60008083601f8401126114f257600080fd5b50813567ffffffffffffffff81111561150a57600080fd5b6020830191508360208285010111156114d957600080fd5b60008060008060008060008060a0898b03121561153e57600080fd5b611547896113ad565b975061155560208a016113ad565b9650604089013567ffffffffffffffff8082111561157257600080fd5b61157e8c838d01611494565b909850965060608b013591508082111561159757600080fd5b6115a38c838d01611494565b909650945060808b01359150808211156115bc57600080fd5b506115c98b828c016114e0565b999c989b5096995094979396929594505050565b600080600080604085870312156115f357600080fd5b843567ffffffffffffffff8082111561160b57600080fd5b61161788838901611494565b9096509450602087013591508082111561163057600080fd5b5061163d87828801611494565b95989497509550505050565b6020808252825182820181905260009190848201906040850190845b8181101561168157835183529284019291840191600101611665565b50909695505050505050565b600080604083850312156116a057600080fd5b6116a9836113ad565b9150602083013580151581146116be57600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156116f157600080fd5b813567ffffffffffffffff8082111561170957600080fd5b818401915084601f83011261171d57600080fd5b81358181111561172f5761172f6116c9565b604051601f8201601f19908116603f01168101908382118183101715611757576117576116c9565b8160405282815287602084870101111561177057600080fd5b826020860160208301376000928101602001929092525095945050505050565b600080604083850312156117a357600080fd5b6117ac836113ad565b91506117ba602084016113ad565b90509250929050565b60008060008060008060a087890312156117dc57600080fd5b6117e5876113ad565b95506117f3602088016113ad565b94506040870135935060608701359250608087013567ffffffffffffffff81111561181d57600080fd5b61182989828a016114e0565b979a9699509497509295939492505050565b60006020828403121561184d57600080fd5b61141d826113ad565b600181811c9082168061186a57607f821691505b60208210810361188a57634e487b7160e01b600052602260045260246000fd5b50919050565b600080845461189e81611856565b600182811680156118b657600181146118cb576118fa565b60ff19841687528215158302870194506118fa565b8860005260208060002060005b858110156118f15781548a8201529084019082016118d8565b50505082870194505b50505050835161190e81836020880161143d565b01949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156112155761121561192d565b601f821115610f8657600081815260208120601f850160051c8101602086101561197d5750805b601f850160051c820191505b818110156108f257828155600101611989565b815167ffffffffffffffff8111156119b6576119b66116c9565b6119ca816119c48454611856565b84611956565b602080601f8311600181146119ff57600084156119e75750858301515b600019600386901b1c1916600185901b1785556108f2565b600085815260208120601f198616915b82811015611a2e57888601518255948401946001909101908401611a0f565b5085821015611a4c5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082611a7957634e487b7160e01b600052601260045260246000fd5b500690565b600060018201611a9057611a9061192d565b506001019056fea2646970667358221220fcab8668aa95446cee62264f90e323a48e79c64e626e5daa673bea3159ce104a64736f6c63430008130033
Deployed Bytecode
0x60806040526004361061013f5760003560e01c8063715018a6116100b6578063d679ad381161006f578063d679ad38146103e5578063e985e9c5146103fa578063ee9df88414610434578063f242432a14610449578063f2fde38b14610469578063f716aee91461048957600080fd5b8063715018a61461031f5780638da5cb5b14610334578063a22cb4651461035c578063a475b5dd1461037c578063a5c1c9f714610391578063c30f4a5a146103c557600080fd5b80632eb2c2d6116101085780632eb2c2d6146102675780632edb6b6f146102875780634c043ef1146102b45780634e1273f4146102c95780635dee9b17146102f6578063672434821461030c57600080fd5b8062fdd58e1461014457806301ffc9a7146101975780630e89341c146101e45780631a6e0376146102115780632e1a7d4d14610245575b600080fd5b34801561015057600080fd5b5061018461015f3660046113c9565b60008260601b679a31110384e0b0c91760205281600052604060002054905092915050565b6040519081526020015b60405180910390f35b3480156101a357600080fd5b506101d46101b23660046113f3565b6301ffc9a760e09190911c90811463d9b67a26821417630e89341c9091141790565b604051901515815260200161018e565b3480156101f057600080fd5b506102046101ff366004611424565b61049f565b60405161018e9190611461565b34801561021d57600080fd5b506101847f000000000000000000000000000000000000000000000000000000000000000a81565b34801561025157600080fd5b50610265610260366004611424565b6104d3565b005b34801561027357600080fd5b50610265610282366004611522565b610556565b34801561029357600080fd5b506101846102a2366004611424565b60056020526000908152604090205481565b3480156102c057600080fd5b50610184600181565b3480156102d557600080fd5b506102e96102e43660046115dd565b610782565b60405161018e9190611649565b34801561030257600080fd5b5061018460035481565b61026561031a3660046115dd565b6107f2565b34801561032b57600080fd5b506102656108fa565b34801561034057600080fd5b506000546040516001600160a01b03909116815260200161018e565b34801561036857600080fd5b5061026561037736600461168d565b61090e565b34801561038857600080fd5b50610265610968565b34801561039d57600080fd5b506101847f000000000000000000000000000000000000000000000000000000000000000381565b3480156103d157600080fd5b506102656103e03660046116df565b610b9b565b3480156103f157600080fd5b50610184600381565b34801561040657600080fd5b506101d4610415366004611790565b60609190911b679a31110384e0b0c9176020526000526034600c205490565b34801561044057600080fd5b50610184600281565b34801561045557600080fd5b506102656104643660046117c3565b610bb3565b34801561047557600080fd5b5061026561048436600461183b565b610d16565b34801561049557600080fd5b5061018460025481565b606060046104ac83610d8f565b6040516020016104bd929190611890565b6040516020818303038152906040529050919050565b6104db610e22565b806000036104e65750475b600080546040516001600160a01b039091169183156108fc02918491818181858888f1935050505015801561051f573d6000803e3d6000fd5b506040518181527f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d9060200160405180910390a150565b82851461056b57633b800a466000526004601cfd5b8760601b679a31110384e0b0c9178760601b679a31110384e0b0c917816020528160601c99508060601c9850886105aa5763ea553b346000526004601cfd5b8933146105cd57336000526034600c20546105cd57634b6e7f186000526004601cfd5b8660051b60005b81811461063e578088013584602052818b013560005260406000208054808311156106075763f4d678b86000526004601cfd5b829003905560208490526040600020805480830181811015610631576301336cea6000526004601cfd5b90915550506020016105d4565b50505050604051604081528560051b602001604082018160208a03823760408201602084810191909152600587901b01910181601f198801823701819003888a337f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8486a450506106ad600090565b156106c2576106c28888888888888888610e7c565b863b156107785760405163bc197c8180825233602083015289604083015260a060608301528660051b60200160c083018160208b0382378160a00180608086015282820191508760051b60200192508260208a038337820160a085015260208501910181601f198701823701829003601b190160208382601c820160008e5af161075b573d15610756573d6000803e3d6000fd5b600083525b508060e01b82511461077557639c05499b6000526004601cfd5b50505b5050505050505050565b606083821461079957633b800a466000526004601cfd5b6040519050818152602081018260051b81810160405260005b8181146107e757679a31110384e0b0c98882013560601b176020908152868201356000908152604090205484830152016107b2565b505050949350505050565b6107fa610e22565b8281811461083d5760405162461bcd60e51b815260206004820152600b60248201526a24b7383aba1022b93937b960a91b60448201526064015b60405180910390fd5b60005b818110156108f2576108a286868381811061085d5761085d611917565b9050602002016020810190610872919061183b565b600186868581811061088657610886611917565b9050602002013560405180602001604052806000815250610e81565b6108ea8686838181106108b7576108b7611917565b90506020020160208101906108cc919061183b565b8585848181106108de576108de611917565b90506020020135610f29565b600101610840565b505050505050565b610902610e22565b61090c6000610f8b565b565b8160601b60601c915080151590503360601b679a31110384e0b0c91760205281600052806034600c20558060005281337f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160206000a35050565b610970610e22565b60065444906000906109a49083907f000000000000000000000000000000000000000000000000000000000000000a610fdb565b905060006109df6109b6846001611943565b6006547f0000000000000000000000000000000000000000000000000000000000000003610fdb565b905060005b8251811015610a645760006006848381518110610a0357610a03611917565b602002602001015181548110610a1b57610a1b611917565b6000918252602090912001546001600160a01b03169050610a3e81600180611135565b610a5b816002600160405180602001604052806000815250610e81565b506001016109e4565b5060005b8151811015610b625760006006838381518110610a8757610a87611917565b602002602001015181548110610a9f57610a9f611917565b6000918252602090912001546001600160a01b031690505b679a31110384e0b0c9606082901b17602052600160009081526040902054600003610b30576006838381518110610af057610af0611917565b60200260200101516001610b049190611943565b81548110610b1457610b14611917565b6000918252602090912001546001600160a01b03169050610ab7565b610b3c81600180611135565b610b59816003600160405180602001604052806000815250610e81565b50600101610a68565b506040518381527f1747b48b6ade85d7dc97c0f523e0e780795930a468c01b18a51546791fdd3ac09060200160405180910390a1505050565b610ba3610e22565b6004610baf828261199c565b5050565b8560601b679a31110384e0b0c9178560601b679a31110384e0b0c917816020528160601c97508060601c9650873314610c0257336000526034600c2054610c0257634b6e7f186000526004601cfd5b86610c155763ea553b346000526004601cfd5b8560005260406000209150815480861115610c385763f4d678b86000526004601cfd5b8581038355508060205260406000209150815485810181811015610c64576301336cea6000526004601cfd5b909255505060208390528486337fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260406000a4843b156108f25760405163f23a6e6180825233602083015287604083015285606083015284608083015260a080830152826020016020850360c08401376020828460c401601c850160008b5af1610cfd573d15610cf8573d6000803e3d6000fd5b600082525b8060e01b82511461077857639c05499b6000526004601cfd5b610d1e610e22565b6001600160a01b038116610d835760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610834565b610d8c81610f8b565b50565b60606000610d9c83611142565b600101905060008167ffffffffffffffff811115610dbc57610dbc6116c9565b6040519080825280601f01601f191660200182016040528015610de6576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084610df057509392505050565b6000546001600160a01b0316331461090c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610834565b610778565b610e8c565b50505050565b8360601b679a31110384e0b0c9178060601c945084610eb35763ea553b346000526004601cfd5b80602052836000526040600020805484810181811015610edb576301336cea6000526004601cfd5b808355505050508260005281602052836000337fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260406000a4833b15610e8657610e8660008585858561121b565b60005b81811015610f865760068054600180820183556000929092527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b0319166001600160a01b03861617905501610f2c565b505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60608183101561103d5760405162461bcd60e51b815260206004820152602760248201527f436f756e74206d757374206265206c657373207468616e206f7220657175616c604482015266040e8de40dac2f60cb1b6064820152608401610834565b60008267ffffffffffffffff811115611058576110586116c9565b604051908082528060200260200182016040528015611081578160200160208202803683370190505b5090506000805b8482101561112a5760408051602081018990529081018390526060810182905260009087906080016040516020818303038152906040528051906020012060001c6110d39190611a5c565b905060006110e182866112b4565b9050801561111557818585815181106110fc576110fc611917565b60209081029190910101528361111181611a7e565b9450505b5050808061112290611a7e565b915050611088565b509095945050505050565b610f866000848484611307565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106111815772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106111ad576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106111cb57662386f26fc10000830492506010015b6305f5e10083106111e3576305f5e100830492506008015b61271083106111f757612710830492506004015b60648310611209576064830492506002015b600a8310611215576001015b92915050565b60405163f23a6e618082523360208301528660601b60601c604083015284606083015283608083015260a08083015282518060c08401528015611268578060e08401826020870160045afa505b6020838260c401601c860160008b5af1611291573d1561128c573d6000803e3d6000fd5b600083525b508060e01b8251146112ab57639c05499b6000526004601cfd5b50505050505050565b6000805b82518110156112fd57838382815181106112d4576112d4611917565b6020026020010151036112eb576000915050611215565b806112f581611a7e565b9150506112b8565b5060019392505050565b679a31110384e0b0c9606093841b1760208190526001600160a01b039094169390921c9183158484141761135157836000526034600c205461135157634b6e7f186000526004601cfd5b8160005260406000208054808311156113725763f4d678b86000526004601cfd5b82900390556000828152602082905283337fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62604084a4610e86565b80356001600160a01b03811681146113c457600080fd5b919050565b600080604083850312156113dc57600080fd5b6113e5836113ad565b946020939093013593505050565b60006020828403121561140557600080fd5b81356001600160e01b03198116811461141d57600080fd5b9392505050565b60006020828403121561143657600080fd5b5035919050565b60005b83811015611458578181015183820152602001611440565b50506000910152565b602081526000825180602084015261148081604085016020870161143d565b601f01601f19169190910160400192915050565b60008083601f8401126114a657600080fd5b50813567ffffffffffffffff8111156114be57600080fd5b6020830191508360208260051b85010111156114d957600080fd5b9250929050565b60008083601f8401126114f257600080fd5b50813567ffffffffffffffff81111561150a57600080fd5b6020830191508360208285010111156114d957600080fd5b60008060008060008060008060a0898b03121561153e57600080fd5b611547896113ad565b975061155560208a016113ad565b9650604089013567ffffffffffffffff8082111561157257600080fd5b61157e8c838d01611494565b909850965060608b013591508082111561159757600080fd5b6115a38c838d01611494565b909650945060808b01359150808211156115bc57600080fd5b506115c98b828c016114e0565b999c989b5096995094979396929594505050565b600080600080604085870312156115f357600080fd5b843567ffffffffffffffff8082111561160b57600080fd5b61161788838901611494565b9096509450602087013591508082111561163057600080fd5b5061163d87828801611494565b95989497509550505050565b6020808252825182820181905260009190848201906040850190845b8181101561168157835183529284019291840191600101611665565b50909695505050505050565b600080604083850312156116a057600080fd5b6116a9836113ad565b9150602083013580151581146116be57600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156116f157600080fd5b813567ffffffffffffffff8082111561170957600080fd5b818401915084601f83011261171d57600080fd5b81358181111561172f5761172f6116c9565b604051601f8201601f19908116603f01168101908382118183101715611757576117576116c9565b8160405282815287602084870101111561177057600080fd5b826020860160208301376000928101602001929092525095945050505050565b600080604083850312156117a357600080fd5b6117ac836113ad565b91506117ba602084016113ad565b90509250929050565b60008060008060008060a087890312156117dc57600080fd5b6117e5876113ad565b95506117f3602088016113ad565b94506040870135935060608701359250608087013567ffffffffffffffff81111561181d57600080fd5b61182989828a016114e0565b979a9699509497509295939492505050565b60006020828403121561184d57600080fd5b61141d826113ad565b600181811c9082168061186a57607f821691505b60208210810361188a57634e487b7160e01b600052602260045260246000fd5b50919050565b600080845461189e81611856565b600182811680156118b657600181146118cb576118fa565b60ff19841687528215158302870194506118fa565b8860005260208060002060005b858110156118f15781548a8201529084019082016118d8565b50505082870194505b50505050835161190e81836020880161143d565b01949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156112155761121561192d565b601f821115610f8657600081815260208120601f850160051c8101602086101561197d5750805b601f850160051c820191505b818110156108f257828155600101611989565b815167ffffffffffffffff8111156119b6576119b66116c9565b6119ca816119c48454611856565b84611956565b602080601f8311600181146119ff57600084156119e75750858301515b600019600386901b1c1916600185901b1785556108f2565b600085815260208120601f198616915b82811015611a2e57888601518255948401946001909101908401611a0f565b5085821015611a4c5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082611a7957634e487b7160e01b600052601260045260246000fd5b500690565b600060018201611a9057611a9061192d565b506001019056fea2646970667358221220fcab8668aa95446cee62264f90e323a48e79c64e626e5daa673bea3159ce104a64736f6c63430008130033
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.