ERC-721
Overview
Max Total Supply
866 CFP
Holders
367
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract
Balance
0 CFPLoading...
Loading
Loading...
Loading
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
Pets
Compiler Version
v0.8.24+commit.e11b9ed9
ZkSolc Version
v1.5.7
Optimization Enabled:
Yes with Mode 3
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.22; import { MintableERC721AC } from "../MintableERC721AC.sol"; contract Pets is MintableERC721AC { constructor( address initialOwner_, address royaltyReceiver_, uint96 feeNumerator_ ) MintableERC721AC( "ChronoForge Pets", "CFP", "https://chronoforge.gg", "https://chronoforge.gg", initialOwner_, royaltyReceiver_, feeNumerator_ ) {} }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.22; import { ERC721A } from "erc721a/contracts/ERC721A.sol"; import { ERC721AC } from "@limitbreak/creator-token-standards/src/erc721c/ERC721AC.sol"; import { BasicRoyalties } from "@limitbreak/creator-token-standards/src/programmable-royalties/BasicRoyalties.sol"; import { OwnableBasic } from "@limitbreak/creator-token-standards/src/access/OwnableBasic.sol"; import { ICreatorToken } from "@limitbreak/creator-token-standards/src/interfaces/ICreatorToken.sol"; import { ICreatorTokenLegacy } from "@limitbreak/creator-token-standards/src/interfaces/ICreatorTokenLegacy.sol"; import { ERC2981 } from "@openzeppelin/contracts/token/common/ERC2981.sol"; import { AccessControlEnumerable, IAccessControlEnumerable } from "@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; /** * @title Mintable ERC721AC * @notice This contract is a base contract for ERC721AC tokens that allows for minting tokens to multiple addresses and enforces royalties */ abstract contract MintableERC721AC is OwnableBasic, AccessControlEnumerable, ERC721AC, BasicRoyalties { using Strings for uint256; /// @dev Role to be granted to addresses that can mint tokens to accounts bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); /// @dev Role to be granted to admin addresses bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE"); /// @dev Base token URI for the NFT Metadata string internal _baseTokenURI; /// @dev Contract URI string internal _contractURI; /// @dev Error thrown when the number of addresses amounts in a batch mint do not match error BatchAmountMismatch(); /// @dev Error thrown when the token being queried does not exist error TokenDoesNotExist(); /// @dev Error thrown when the caller is not the owner of the token error NotTokenOwner(); /// @dev Error thrown when the query range is invalid error InvalidQueryRange(); /// @dev Event emitted when a token is minted event Mint(address indexed to, uint256 indexed tokenId); /// @dev Event emitted when a token is burned event Burn(address indexed to, uint256 indexed tokenId); /** * @param name_ The name of the token * @param symbol_ The symbol of the token * @param baseTokenURI_ The base token URI for the token metadata * @param contractURI_ The contract URI * @param initialOwner_ The initial owner of the contract * @param royaltyReceiver_ The receiver of the royalty fees * @param feeNumerator_ The default royalty fee numerator */ constructor( string memory name_, string memory symbol_, string memory baseTokenURI_, string memory contractURI_, address initialOwner_, address royaltyReceiver_, uint96 feeNumerator_ ) ERC721AC(name_, symbol_) BasicRoyalties(royaltyReceiver_, feeNumerator_) Ownable(initialOwner_) { _setRoleAdmin(MINTER_ROLE, DEFAULT_ADMIN_ROLE); _setRoleAdmin(ADMIN_ROLE, DEFAULT_ADMIN_ROLE); _grantRole(DEFAULT_ADMIN_ROLE, initialOwner_); _baseTokenURI = baseTokenURI_; _contractURI = contractURI_; } /** * @dev Mint tokens to an address as an account with the MINTER_ROLE * @param to The address to mint tokens to * @param amount The amount of tokens to mint */ function mintTo(address to, uint256 amount) external onlyRole(MINTER_ROLE) { _safeMint(to, amount); emit Mint(to, amount); } /** * @dev Mint tokens to multiple addresses as an account with the MINTER_ROLE * @param tos The addresses to mint tokens to * @param amounts The amounts of tokens to mint to each address */ function batchMintTo(address[] calldata tos, uint256[] calldata amounts) external onlyRole(MINTER_ROLE) { if (tos.length != amounts.length) { revert BatchAmountMismatch(); } for (uint256 i = 0; i < tos.length; i++) { _safeMint(tos[i], amounts[i]); emit Mint(tos[i], amounts[i]); } } /** * @dev Burn a token as the owner of the token * @param tokenId The ID of the token to burn */ function burn(uint256 tokenId) external { if (ownerOf(tokenId) != msg.sender) revert NotTokenOwner(); _burn(tokenId); emit Burn(msg.sender, tokenId); } /** * @dev Batch burn tokens as the owner of the tokens * @param tokenIds The IDs of the tokens to burn */ function batchBurn(uint256[] calldata tokenIds) external { uint256 i = 0; uint256 length = tokenIds.length; for (i; i < length; ++i) { if (ownerOf(tokenIds[i]) != msg.sender) revert NotTokenOwner(); _burn(tokenIds[i]); emit Burn(msg.sender, tokenIds[i]); } } /** * @dev Overrides the base URI for the token metadata * @return The base URI for the token metadata */ function _baseURI() internal view override returns (string memory) { return _baseTokenURI; } /** * @dev Sets the base URI for the token metadata * @param baseURI The base URI for the token metadata */ function setBaseURI(string memory baseURI) external onlyRole(ADMIN_ROLE) { _baseTokenURI = baseURI; } /** * @dev Returns the base URI for the token metadata * @return The base URI for the token metadata */ function baseTokenURI() external view returns (string memory) { return _baseTokenURI; } /** * @dev Returns the token URI for a given token ID * @param tokenId The ID of the token * @return The token URI for the token */ function tokenURI(uint256 tokenId) public view override returns (string memory) { if (!_exists(tokenId)) revert TokenDoesNotExist(); return string(abi.encodePacked(_baseURI(), tokenId.toString())); } /** * @dev Sets the contract URI * @param contractURI_ The contract URI */ function setContractURI(string memory contractURI_) external onlyRole(ADMIN_ROLE) { _contractURI = contractURI_; } /** * @dev Returns the contract URI * @return The contract URI */ function contractURI() external view returns (string memory) { return _contractURI; } /** * @dev Sets the default royalty for the contract * @param receiver The address of the receiver of the royalty fees * @param feeNumerator The default royalty fee numerator */ function setDefaultRoyalty(address receiver, uint96 feeNumerator) external onlyRole(ADMIN_ROLE) { _setDefaultRoyalty(receiver, feeNumerator); } /** * @dev Sets the royalty for a token * @param tokenId The ID of the token * @param receiver The address of the receiver of the royalty fees * @param feeNumerator The royalty fee numerator */ function setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) external onlyRole(ADMIN_ROLE) { _setTokenRoyalty(tokenId, receiver, feeNumerator); } /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * * - `addr = address(0)` * - `startTimestamp = 0` * - `burned = false` * - `extraData = 0` * * If the `tokenId` is burned: * * - `addr = <Address of owner before token was burned>` * - `startTimestamp = <Timestamp when token was burned>` * - `burned = true` * - `extraData = <Extra data when token was burned>` * * Otherwise: * * - `addr = <Address of owner>` * - `startTimestamp = <Timestamp of start of ownership>` * - `burned = false` * - `extraData = <Extra data at start of ownership>` */ function explicitOwnershipOf(uint256 tokenId) public view virtual returns (TokenOwnership memory ownership) { unchecked { if (tokenId >= _startTokenId()) { if (tokenId > _sequentialUpTo()) return _ownershipAt(tokenId); if (tokenId < _nextTokenId()) { // If the `tokenId` is within bounds, // scan backwards for the initialized ownership slot. while (!_ownershipIsInitialized(tokenId)) --tokenId; return _ownershipAt(tokenId); } } } } /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] calldata tokenIds) external view virtual returns (TokenOwnership[] memory) { TokenOwnership[] memory ownerships; uint256 i = tokenIds.length; assembly { // Grab the free memory pointer. ownerships := mload(0x40) // Store the length. mstore(ownerships, i) // Allocate one word for the length, // `tokenIds.length` words for the pointers. i := shl(5, i) // Multiply `i` by 32. mstore(0x40, add(add(ownerships, 0x20), i)) } while (i != 0) { uint256 tokenId; assembly { i := sub(i, 0x20) tokenId := calldataload(add(tokenIds.offset, i)) } TokenOwnership memory ownership = explicitOwnershipOf(tokenId); assembly { // Store the pointer of `ownership` in the `ownerships` array. mstore(add(add(ownerships, 0x20), i), ownership) } } return ownerships; } /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start < stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view virtual returns (uint256[] memory) { return _tokensOfOwnerIn(owner, start, stop); } /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(`totalSupply`) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K collections should be fine). */ function tokensOfOwner(address owner) external view virtual returns (uint256[] memory) { // If spot mints are enabled, full-range scan is disabled. if (_sequentialUpTo() != type(uint256).max) _revert(NotCompatibleWithSpotMints.selector); uint256 start = _startTokenId(); uint256 stop = _nextTokenId(); uint256[] memory tokenIds; if (start != stop) tokenIds = _tokensOfOwnerIn(owner, start, stop); return tokenIds; } /** * @dev Helper function for returning an array of token IDs owned by `owner`. * * Note that this function is optimized for smaller bytecode size over runtime gas, * since it is meant to be called off-chain. */ function _tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) private view returns (uint256[] memory tokenIds) { unchecked { if (start >= stop) _revert(InvalidQueryRange.selector); // Set `start = max(start, _startTokenId())`. if (start < _startTokenId()) start = _startTokenId(); uint256 nextTokenId = _nextTokenId(); // If spot mints are enabled, scan all the way until the specified `stop`. uint256 stopLimit = _sequentialUpTo() != type(uint256).max ? stop : nextTokenId; // Set `stop = min(stop, stopLimit)`. if (stop >= stopLimit) stop = stopLimit; // Number of tokens to scan. uint256 tokenIdsMaxLength = balanceOf(owner); // Set `tokenIdsMaxLength` to zero if the range contains no tokens. if (start >= stop) tokenIdsMaxLength = 0; // If there are one or more tokens to scan. if (tokenIdsMaxLength != 0) { // Set `tokenIdsMaxLength = min(balanceOf(owner), tokenIdsMaxLength)`. if (stop - start <= tokenIdsMaxLength) tokenIdsMaxLength = stop - start; uint256 m; // Start of available memory. assembly { // Grab the free memory pointer. tokenIds := mload(0x40) // Allocate one word for the length, and `tokenIdsMaxLength` words // for the data. `shl(5, x)` is equivalent to `mul(32, x)`. m := add(tokenIds, shl(5, add(tokenIdsMaxLength, 1))) mstore(0x40, m) } // We need to call `explicitOwnershipOf(start)`, // because the slot at `start` may not be initialized. TokenOwnership memory ownership = explicitOwnershipOf(start); address currOwnershipAddr; // If the starting slot exists (i.e. not burned), // initialize `currOwnershipAddr`. // `ownership.address` will not be zero, // as `start` is clamped to the valid token ID range. if (!ownership.burned) currOwnershipAddr = ownership.addr; uint256 tokenIdsIdx; // Use a do-while, which is slightly more efficient for this case, // as the array will at least contain one element. do { if (_sequentialUpTo() != type(uint256).max) { // Skip the remaining unused sequential slots. if (start == nextTokenId) start = _sequentialUpTo() + 1; // Reset `currOwnershipAddr`, as each spot-minted token is a batch of one. if (start > _sequentialUpTo()) currOwnershipAddr = address(0); } ownership = _ownershipAt(start); // This implicitly allocates memory. assembly { switch mload(add(ownership, 0x40)) // if `ownership.burned == false`. case 0 { // if `ownership.addr != address(0)`. // The `addr` already has it's upper 96 bits clearned, // since it is written to memory with regular Solidity. if mload(ownership) { currOwnershipAddr := mload(ownership) } // if `currOwnershipAddr == owner`. // The `shl(96, x)` is to make the comparison agnostic to any // dirty upper 96 bits in `owner`. if iszero(shl(96, xor(currOwnershipAddr, owner))) { tokenIdsIdx := add(tokenIdsIdx, 1) mstore(add(tokenIds, shl(5, tokenIdsIdx)), start) } } // Otherwise, reset `currOwnershipAddr`. // This handles the case of batch burned tokens // (burned bit of first slot set, remaining slots left uninitialized). default { currOwnershipAddr := 0 } start := add(start, 1) // Free temporary memory implicitly allocated for ownership // to avoid quadratic memory expansion costs. mstore(0x40, m) } } while (!(start == stop || tokenIdsIdx == tokenIdsMaxLength)); // Store the length of the array. assembly { mstore(tokenIds, tokenIdsIdx) } } } } /** * @dev Overrides start token ID to start from 1 * @return The start token ID */ function _startTokenId() internal view virtual override returns (uint256) { return 1; } /** * @dev Overrides supportsInterface to support IAccessControlEnumerable & ERC721AC * @param interfaceId The interface ID * @return bool True if the interface is supported, false otherwise */ function supportsInterface( bytes4 interfaceId ) public view virtual override(AccessControlEnumerable, ERC721AC, ERC2981) returns (bool) { return ERC721AC.supportsInterface(interfaceId) || ERC2981.supportsInterface(interfaceId) || AccessControlEnumerable.supportsInterface(interfaceId) || ERC721A.supportsInterface(interfaceId) || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721A.sol'; /** * @dev Interface of ERC721 token receiver. */ interface ERC721A__IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @title ERC721A * * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) * Non-Fungible Token Standard, including the Metadata extension. * Optimized for lower gas during batch mints. * * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) * starting from `_startTokenId()`. * * The `_sequentialUpTo()` function can be overriden to enable spot mints * (i.e. non-consecutive mints) for `tokenId`s greater than `_sequentialUpTo()`. * * Assumptions: * * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is IERC721A { // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364). struct TokenApprovalRef { address value; } // ============================================================= // CONSTANTS // ============================================================= // Mask of an entry in packed address data. uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1; // The bit position of `numberMinted` in packed address data. uint256 private constant _BITPOS_NUMBER_MINTED = 64; // The bit position of `numberBurned` in packed address data. uint256 private constant _BITPOS_NUMBER_BURNED = 128; // The bit position of `aux` in packed address data. uint256 private constant _BITPOS_AUX = 192; // Mask of all 256 bits in packed address data except the 64 bits for `aux`. uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1; // The bit position of `startTimestamp` in packed ownership. uint256 private constant _BITPOS_START_TIMESTAMP = 160; // The bit mask of the `burned` bit in packed ownership. uint256 private constant _BITMASK_BURNED = 1 << 224; // The bit position of the `nextInitialized` bit in packed ownership. uint256 private constant _BITPOS_NEXT_INITIALIZED = 225; // The bit mask of the `nextInitialized` bit in packed ownership. uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225; // The bit position of `extraData` in packed ownership. uint256 private constant _BITPOS_EXTRA_DATA = 232; // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`. uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1; // The mask of the lower 160 bits for addresses. uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; // The maximum `quantity` that can be minted with {_mintERC2309}. // This limit is to prevent overflows on the address data entries. // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309} // is required to cause an overflow, which is unrealistic. uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000; // The `Transfer` event signature is given by: // `keccak256(bytes("Transfer(address,address,uint256)"))`. bytes32 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; // ============================================================= // STORAGE // ============================================================= // The next token ID to be minted. uint256 private _currentIndex; // The number of tokens burned. uint256 private _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. // See {_packedOwnershipOf} implementation for details. // // Bits Layout: // - [0..159] `addr` // - [160..223] `startTimestamp` // - [224] `burned` // - [225] `nextInitialized` // - [232..255] `extraData` mapping(uint256 => uint256) private _packedOwnerships; // Mapping owner address to address data. // // Bits Layout: // - [0..63] `balance` // - [64..127] `numberMinted` // - [128..191] `numberBurned` // - [192..255] `aux` mapping(address => uint256) private _packedAddressData; // Mapping from token ID to approved address. mapping(uint256 => TokenApprovalRef) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // The amount of tokens minted above `_sequentialUpTo()`. // We call these spot mints (i.e. non-sequential mints). uint256 private _spotMinted; // ============================================================= // CONSTRUCTOR // ============================================================= constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); if (_sequentialUpTo() < _startTokenId()) _revert(SequentialUpToTooSmall.selector); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @dev Returns the starting token ID for sequential mints. * * Override this function to change the starting token ID for sequential mints. * * Note: The value returned must never change after any tokens have been minted. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Returns the maximum token ID (inclusive) for sequential mints. * * Override this function to return a value less than 2**256 - 1, * but greater than `_startTokenId()`, to enable spot (non-sequential) mints. * * Note: The value returned must never change after any tokens have been minted. */ function _sequentialUpTo() internal view virtual returns (uint256) { return type(uint256).max; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId() internal view virtual returns (uint256) { return _currentIndex; } /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() public view virtual override returns (uint256 result) { // Counter underflow is impossible as `_burnCounter` cannot be incremented // more than `_currentIndex + _spotMinted - _startTokenId()` times. unchecked { // With spot minting, the intermediate `result` can be temporarily negative, // and the computation must be unchecked. result = _currentIndex - _burnCounter - _startTokenId(); if (_sequentialUpTo() != type(uint256).max) result += _spotMinted; } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view virtual returns (uint256 result) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { result = _currentIndex - _startTokenId(); if (_sequentialUpTo() != type(uint256).max) result += _spotMinted; } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return _burnCounter; } /** * @dev Returns the total number of tokens that are spot-minted. */ function _totalSpotMinted() internal view virtual returns (uint256) { return _spotMinted; } // ============================================================= // ADDRESS DATA OPERATIONS // ============================================================= /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) public view virtual override returns (uint256) { if (owner == address(0)) _revert(BalanceQueryForZeroAddress.selector); return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return uint64(_packedAddressData[owner] >> _BITPOS_AUX); } /** * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal virtual { uint256 packed = _packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); _packedAddressData[owner] = packed; } // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { // The interface IDs are constants representing the first 4 bytes // of the XOR of all function selectors in the interface. // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165) // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`) return interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. } // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) _revert(URIQueryForNonexistentToken.selector); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : ''; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, it can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } // ============================================================= // OWNERSHIPS OPERATIONS // ============================================================= /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @dev Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around over time. */ function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @dev Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnerships[index]); } /** * @dev Returns whether the ownership slot at `index` is initialized. * An uninitialized slot does not necessarily mean that the slot has no owner. */ function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) { return _packedOwnerships[index] != 0; } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal virtual { if (_packedOwnerships[index] == 0) { _packedOwnerships[index] = _packedOwnershipOf(index); } } /** * @dev Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) { if (_startTokenId() <= tokenId) { packed = _packedOwnerships[tokenId]; if (tokenId > _sequentialUpTo()) { if (_packedOwnershipExists(packed)) return packed; _revert(OwnerQueryForNonexistentToken.selector); } // If the data at the starting slot does not exist, start the scan. if (packed == 0) { if (tokenId >= _currentIndex) _revert(OwnerQueryForNonexistentToken.selector); // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `tokenId` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. for (;;) { unchecked { packed = _packedOwnerships[--tokenId]; } if (packed == 0) continue; if (packed & _BITMASK_BURNED == 0) return packed; // Otherwise, the token is burned, and we must revert. // This handles the case of batch burned tokens, where only the burned bit // of the starting slot is set, and remaining slots are left uninitialized. _revert(OwnerQueryForNonexistentToken.selector); } } // Otherwise, the data exists and we can skip the scan. // This is possible because we have already achieved the target condition. // This saves 2143 gas on transfers of initialized tokens. // If the token is not burned, return `packed`. Otherwise, revert. if (packed & _BITMASK_BURNED == 0) return packed; } _revert(OwnerQueryForNonexistentToken.selector); } /** * @dev Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); ownership.burned = packed & _BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)) } } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. See {ERC721A-_approve}. * * Requirements: * * - The caller must own the token or be an approved operator. */ function approve(address to, uint256 tokenId) public payable virtual override { _approve(to, tokenId, true); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) _revert(ApprovalQueryForNonexistentToken.selector); return _tokenApprovals[tokenId].value; } /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) public virtual override { _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted. See {_mint}. */ function _exists(uint256 tokenId) internal view virtual returns (bool result) { if (_startTokenId() <= tokenId) { if (tokenId > _sequentialUpTo()) return _packedOwnershipExists(_packedOwnerships[tokenId]); if (tokenId < _currentIndex) { uint256 packed; while ((packed = _packedOwnerships[tokenId]) == 0) --tokenId; result = packed & _BITMASK_BURNED == 0; } } } /** * @dev Returns whether `packed` represents a token that exists. */ function _packedOwnershipExists(uint256 packed) private pure returns (bool result) { assembly { // The following is equivalent to `owner != address(0) && burned == false`. // Symbolically tested. result := gt(and(packed, _BITMASK_ADDRESS), and(packed, _BITMASK_BURNED)) } } /** * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`. */ function _isSenderApprovedOrOwner( address approvedAddress, address owner, address msgSender ) private pure returns (bool result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, _BITMASK_ADDRESS) // `msgSender == owner || msgSender == approvedAddress`. result := or(eq(msgSender, owner), eq(msgSender, approvedAddress)) } } /** * @dev Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedSlotAndAddress(uint256 tokenId) private view returns (uint256 approvedAddressSlot, address approvedAddress) { TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId]; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`. assembly { approvedAddressSlot := tokenApproval.slot approvedAddress := sload(approvedAddressSlot) } } // ============================================================= // TRANSFER OPERATIONS // ============================================================= /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) public payable virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); // Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean. from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS)); if (address(uint160(prevOwnershipPacked)) != from) _revert(TransferFromIncorrectOwner.selector); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // We can directly increment and decrement the balances. --_packedAddressData[from]; // Updates: `balance -= 1`. ++_packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( to, _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; assembly { // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. from, // `from`. toMasked, // `to`. tokenId // `tokenId`. ) } if (toMasked == 0) _revert(TransferToZeroAddress.selector); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public payable virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public payable virtual override { transferFrom(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { _revert(TransferToNonERC721ReceiverImplementer.selector); } } /** * @dev Hook that is called before a set of serially-ordered token IDs * are about to be transferred. This includes minting. * And also called before burning one token. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token IDs * have been transferred. This includes minting. * And also called after one token has been burned. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * `from` - Previous owner of the given token ID. * `to` - Target address that will receive the token. * `tokenId` - Token ID to be transferred. * `_data` - Optional data to send along with the call. * * Returns whether the call correctly returned the expected magic value. */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns ( bytes4 retval ) { return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { _revert(TransferToNonERC721ReceiverImplementer.selector); } assembly { revert(add(32, reason), mload(reason)) } } } // ============================================================= // MINT OPERATIONS // ============================================================= /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event for each mint. */ function _mint(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (quantity == 0) _revert(MintZeroQuantity.selector); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // `balance` and `numberMinted` have a maximum limit of 2**64. // `tokenId` has a maximum limit of 2**256. unchecked { // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; if (toMasked == 0) _revert(MintToZeroAddress.selector); uint256 end = startTokenId + quantity; uint256 tokenId = startTokenId; if (end - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector); do { assembly { // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. tokenId // `tokenId`. ) } // The `!=` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. } while (++tokenId != end); _currentIndex = end; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * This function is intended for efficient minting only during contract creation. * * It emits only one {ConsecutiveTransfer} as defined in * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). * * Calling this function outside of contract creation WILL make your contract * non-compliant with the ERC721 standard. * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 * {ConsecutiveTransfer} event is only permissible during contract creation. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {ConsecutiveTransfer} event. */ function _mintERC2309(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (to == address(0)) _revert(MintToZeroAddress.selector); if (quantity == 0) _revert(MintZeroQuantity.selector); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) _revert(MintERC2309QuantityExceedsLimit.selector); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are unrealistic due to the above check for `quantity` to be below the limit. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); if (startTokenId + quantity - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector); emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to); _currentIndex = startTokenId + quantity; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * See {_mint}. * * Emits a {Transfer} event for each mint. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = _currentIndex; uint256 index = end - quantity; do { if (!_checkContractOnERC721Received(address(0), to, index++, _data)) { _revert(TransferToNonERC721ReceiverImplementer.selector); } } while (index < end); // This prevents reentrancy to `_safeMint`. // It does not prevent reentrancy to `_safeMintSpot`. if (_currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } /** * @dev Mints a single token at `tokenId`. * * Note: A spot-minted `tokenId` that has been burned can be re-minted again. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` must be greater than `_sequentialUpTo()`. * - `tokenId` must not exist. * * Emits a {Transfer} event for each mint. */ function _mintSpot(address to, uint256 tokenId) internal virtual { if (tokenId <= _sequentialUpTo()) _revert(SpotMintTokenIdTooSmall.selector); uint256 prevOwnershipPacked = _packedOwnerships[tokenId]; if (_packedOwnershipExists(prevOwnershipPacked)) _revert(TokenAlreadyExists.selector); _beforeTokenTransfers(address(0), to, tokenId, 1); // Overflows are incredibly unrealistic. // The `numberMinted` for `to` is incremented by 1, and has a max limit of 2**64 - 1. // `_spotMinted` is incremented by 1, and has a max limit of 2**256 - 1. unchecked { // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `true` (as `quantity == 1`). _packedOwnerships[tokenId] = _packOwnershipData( to, _nextInitializedFlag(1) | _nextExtraData(address(0), to, prevOwnershipPacked) ); // Updates: // - `balance += 1`. // - `numberMinted += 1`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += (1 << _BITPOS_NUMBER_MINTED) | 1; // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; if (toMasked == 0) _revert(MintToZeroAddress.selector); assembly { // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. tokenId // `tokenId`. ) } ++_spotMinted; } _afterTokenTransfers(address(0), to, tokenId, 1); } /** * @dev Safely mints a single token at `tokenId`. * * Note: A spot-minted `tokenId` that has been burned can be re-minted again. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}. * - `tokenId` must be greater than `_sequentialUpTo()`. * - `tokenId` must not exist. * * See {_mintSpot}. * * Emits a {Transfer} event. */ function _safeMintSpot( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mintSpot(to, tokenId); unchecked { if (to.code.length != 0) { uint256 currentSpotMinted = _spotMinted; if (!_checkContractOnERC721Received(address(0), to, tokenId, _data)) { _revert(TransferToNonERC721ReceiverImplementer.selector); } // This prevents reentrancy to `_safeMintSpot`. // It does not prevent reentrancy to `_safeMint`. if (_spotMinted != currentSpotMinted) revert(); } } } /** * @dev Equivalent to `_safeMintSpot(to, tokenId, '')`. */ function _safeMintSpot(address to, uint256 tokenId) internal virtual { _safeMintSpot(to, tokenId, ''); } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Equivalent to `_approve(to, tokenId, false)`. */ function _approve(address to, uint256 tokenId) internal virtual { _approve(to, tokenId, false); } /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - `tokenId` must exist. * * Emits an {Approval} event. */ function _approve( address to, uint256 tokenId, bool approvalCheck ) internal virtual { address owner = ownerOf(tokenId); if (approvalCheck && _msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { _revert(ApprovalCallerNotOwnerNorApproved.selector); } _tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // Updates: // - `balance -= 1`. // - `numberBurned += 1`. // // We can directly decrement the balance, and increment the number burned. // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`. _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1; // Updates: // - `address` to the last owner. // - `startTimestamp` to the timestamp of burning. // - `burned` to `true`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( from, (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as `_burnCounter` cannot be exceed `_currentIndex + _spotMinted` times. unchecked { _burnCounter++; } } // ============================================================= // EXTRA DATA OPERATIONS // ============================================================= /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { uint256 packed = _packedOwnerships[index]; if (packed == 0) _revert(OwnershipNotInitializedForExtraData.selector); uint256 extraDataCasted; // Cast `extraData` with assembly to avoid redundant masking. assembly { extraDataCasted := extraData } packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA); _packedOwnerships[index] = packed; } /** * @dev Called during each token transfer to set the 24bit `extraData` field. * Intended to be overridden by the cosumer contract. * * `previousExtraData` - the value of `extraData` before transfer. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _extraData( address from, address to, uint24 previousExtraData ) internal view virtual returns (uint24) {} /** * @dev Returns the next extra data for the packed ownership data. * The returned result is shifted into position. */ function _nextExtraData( address from, address to, uint256 prevOwnershipPacked ) private view returns (uint256) { uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA); return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA; } // ============================================================= // OTHER OPERATIONS // ============================================================= /** * @dev Returns the message sender (defaults to `msg.sender`). * * If you are writing GSN compatible contracts, you need to override this function. */ function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; } /** * @dev Converts a uint256 to its ASCII string decimal representation. */ function _toString(uint256 value) internal pure virtual returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0. let m := add(mload(0x40), 0xa0) // Update the free memory pointer to allocate. mstore(0x40, m) // Assign the `str` to the end. str := sub(m, 0x20) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 1) // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) // prettier-ignore if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } /** * @dev For more efficient reverts. */ function _revert(bytes4 errorSelector) internal pure { assembly { mstore(0x00, errorSelector) revert(0x00, 0x04) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../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. * * The initial owner is set to the address provided by the deployer. 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; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.2.0) (utils/Strings.sol) pragma solidity ^0.8.20; import {Math} from "./math/Math.sol"; import {SafeCast} from "./math/SafeCast.sol"; import {SignedMath} from "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { using SafeCast for *; bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @dev The string being parsed contains characters that are not in scope of the given base. */ error StringsInvalidChar(); /** * @dev The string being parsed is not a properly formatted address. */ error StringsInvalidAddressFormat(); /** * @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; assembly ("memory-safe") { ptr := add(buffer, add(32, length)) } while (true) { ptr--; assembly ("memory-safe") { mstore8(ptr, byte(mod(value, 10), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { uint256 localValue = value; bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal * representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH); } /** * @dev Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal * representation, according to EIP-55. */ function toChecksumHexString(address addr) internal pure returns (string memory) { bytes memory buffer = bytes(toHexString(addr)); // hash the hex part of buffer (skip length + 2 bytes, length 40) uint256 hashValue; assembly ("memory-safe") { hashValue := shr(96, keccak256(add(buffer, 0x22), 40)) } for (uint256 i = 41; i > 1; --i) { // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f) if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) { // case shift by xoring with 0x20 buffer[i] ^= 0x20; } hashValue >>= 4; } return string(buffer); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } /** * @dev Parse a decimal string and returns the value as a `uint256`. * * Requirements: * - The string must be formatted as `[0-9]*` * - The result must fit into an `uint256` type */ function parseUint(string memory input) internal pure returns (uint256) { return parseUint(input, 0, bytes(input).length); } /** * @dev Variant of {parseUint} that parses a substring of `input` located between position `begin` (included) and * `end` (excluded). * * Requirements: * - The substring must be formatted as `[0-9]*` * - The result must fit into an `uint256` type */ function parseUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) { (bool success, uint256 value) = tryParseUint(input, begin, end); if (!success) revert StringsInvalidChar(); return value; } /** * @dev Variant of {parseUint-string} that returns false if the parsing fails because of an invalid character. * * NOTE: This function will revert if the result does not fit in a `uint256`. */ function tryParseUint(string memory input) internal pure returns (bool success, uint256 value) { return _tryParseUintUncheckedBounds(input, 0, bytes(input).length); } /** * @dev Variant of {parseUint-string-uint256-uint256} that returns false if the parsing fails because of an invalid * character. * * NOTE: This function will revert if the result does not fit in a `uint256`. */ function tryParseUint( string memory input, uint256 begin, uint256 end ) internal pure returns (bool success, uint256 value) { if (end > bytes(input).length || begin > end) return (false, 0); return _tryParseUintUncheckedBounds(input, begin, end); } /** * @dev Implementation of {tryParseUint} that does not check bounds. Caller should make sure that * `begin <= end <= input.length`. Other inputs would result in undefined behavior. */ function _tryParseUintUncheckedBounds( string memory input, uint256 begin, uint256 end ) private pure returns (bool success, uint256 value) { bytes memory buffer = bytes(input); uint256 result = 0; for (uint256 i = begin; i < end; ++i) { uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i))); if (chr > 9) return (false, 0); result *= 10; result += chr; } return (true, result); } /** * @dev Parse a decimal string and returns the value as a `int256`. * * Requirements: * - The string must be formatted as `[-+]?[0-9]*` * - The result must fit in an `int256` type. */ function parseInt(string memory input) internal pure returns (int256) { return parseInt(input, 0, bytes(input).length); } /** * @dev Variant of {parseInt-string} that parses a substring of `input` located between position `begin` (included) and * `end` (excluded). * * Requirements: * - The substring must be formatted as `[-+]?[0-9]*` * - The result must fit in an `int256` type. */ function parseInt(string memory input, uint256 begin, uint256 end) internal pure returns (int256) { (bool success, int256 value) = tryParseInt(input, begin, end); if (!success) revert StringsInvalidChar(); return value; } /** * @dev Variant of {parseInt-string} that returns false if the parsing fails because of an invalid character or if * the result does not fit in a `int256`. * * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`. */ function tryParseInt(string memory input) internal pure returns (bool success, int256 value) { return _tryParseIntUncheckedBounds(input, 0, bytes(input).length); } uint256 private constant ABS_MIN_INT256 = 2 ** 255; /** * @dev Variant of {parseInt-string-uint256-uint256} that returns false if the parsing fails because of an invalid * character or if the result does not fit in a `int256`. * * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`. */ function tryParseInt( string memory input, uint256 begin, uint256 end ) internal pure returns (bool success, int256 value) { if (end > bytes(input).length || begin > end) return (false, 0); return _tryParseIntUncheckedBounds(input, begin, end); } /** * @dev Implementation of {tryParseInt} that does not check bounds. Caller should make sure that * `begin <= end <= input.length`. Other inputs would result in undefined behavior. */ function _tryParseIntUncheckedBounds( string memory input, uint256 begin, uint256 end ) private pure returns (bool success, int256 value) { bytes memory buffer = bytes(input); // Check presence of a negative sign. bytes1 sign = begin == end ? bytes1(0) : bytes1(_unsafeReadBytesOffset(buffer, begin)); // don't do out-of-bound (possibly unsafe) read if sub-string is empty bool positiveSign = sign == bytes1("+"); bool negativeSign = sign == bytes1("-"); uint256 offset = (positiveSign || negativeSign).toUint(); (bool absSuccess, uint256 absValue) = tryParseUint(input, begin + offset, end); if (absSuccess && absValue < ABS_MIN_INT256) { return (true, negativeSign ? -int256(absValue) : int256(absValue)); } else if (absSuccess && negativeSign && absValue == ABS_MIN_INT256) { return (true, type(int256).min); } else return (false, 0); } /** * @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as a `uint256`. * * Requirements: * - The string must be formatted as `(0x)?[0-9a-fA-F]*` * - The result must fit in an `uint256` type. */ function parseHexUint(string memory input) internal pure returns (uint256) { return parseHexUint(input, 0, bytes(input).length); } /** * @dev Variant of {parseHexUint} that parses a substring of `input` located between position `begin` (included) and * `end` (excluded). * * Requirements: * - The substring must be formatted as `(0x)?[0-9a-fA-F]*` * - The result must fit in an `uint256` type. */ function parseHexUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) { (bool success, uint256 value) = tryParseHexUint(input, begin, end); if (!success) revert StringsInvalidChar(); return value; } /** * @dev Variant of {parseHexUint-string} that returns false if the parsing fails because of an invalid character. * * NOTE: This function will revert if the result does not fit in a `uint256`. */ function tryParseHexUint(string memory input) internal pure returns (bool success, uint256 value) { return _tryParseHexUintUncheckedBounds(input, 0, bytes(input).length); } /** * @dev Variant of {parseHexUint-string-uint256-uint256} that returns false if the parsing fails because of an * invalid character. * * NOTE: This function will revert if the result does not fit in a `uint256`. */ function tryParseHexUint( string memory input, uint256 begin, uint256 end ) internal pure returns (bool success, uint256 value) { if (end > bytes(input).length || begin > end) return (false, 0); return _tryParseHexUintUncheckedBounds(input, begin, end); } /** * @dev Implementation of {tryParseHexUint} that does not check bounds. Caller should make sure that * `begin <= end <= input.length`. Other inputs would result in undefined behavior. */ function _tryParseHexUintUncheckedBounds( string memory input, uint256 begin, uint256 end ) private pure returns (bool success, uint256 value) { bytes memory buffer = bytes(input); // skip 0x prefix if present bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(buffer, begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty uint256 offset = hasPrefix.toUint() * 2; uint256 result = 0; for (uint256 i = begin + offset; i < end; ++i) { uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i))); if (chr > 15) return (false, 0); result *= 16; unchecked { // Multiplying by 16 is equivalent to a shift of 4 bits (with additional overflow check). // This guaratees that adding a value < 16 will not cause an overflow, hence the unchecked. result += chr; } } return (true, result); } /** * @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as an `address`. * * Requirements: * - The string must be formatted as `(0x)?[0-9a-fA-F]{40}` */ function parseAddress(string memory input) internal pure returns (address) { return parseAddress(input, 0, bytes(input).length); } /** * @dev Variant of {parseAddress} that parses a substring of `input` located between position `begin` (included) and * `end` (excluded). * * Requirements: * - The substring must be formatted as `(0x)?[0-9a-fA-F]{40}` */ function parseAddress(string memory input, uint256 begin, uint256 end) internal pure returns (address) { (bool success, address value) = tryParseAddress(input, begin, end); if (!success) revert StringsInvalidAddressFormat(); return value; } /** * @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly * formatted address. See {parseAddress} requirements. */ function tryParseAddress(string memory input) internal pure returns (bool success, address value) { return tryParseAddress(input, 0, bytes(input).length); } /** * @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly * formatted address. See {parseAddress} requirements. */ function tryParseAddress( string memory input, uint256 begin, uint256 end ) internal pure returns (bool success, address value) { if (end > bytes(input).length || begin > end) return (false, address(0)); bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(bytes(input), begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty uint256 expectedLength = 40 + hasPrefix.toUint() * 2; // check that input is the correct length if (end - begin == expectedLength) { // length guarantees that this does not overflow, and value is at most type(uint160).max (bool s, uint256 v) = _tryParseHexUintUncheckedBounds(input, begin, end); return (s, address(uint160(v))); } else { return (false, address(0)); } } function _tryParseChr(bytes1 chr) private pure returns (uint8) { uint8 value = uint8(chr); // Try to parse `chr`: // - Case 1: [0-9] // - Case 2: [a-f] // - Case 3: [A-F] // - otherwise not supported unchecked { if (value > 47 && value < 58) value -= 48; else if (value > 96 && value < 103) value -= 87; else if (value > 64 && value < 71) value -= 55; else return type(uint8).max; } return value; } /** * @dev Reads a bytes32 from a bytes array without bounds checking. * * NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the * assembly block as such would prevent some optimizations. */ function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) { // This is not memory safe in the general case, but all calls to this private function are within bounds. assembly ("memory-safe") { value := mload(add(buffer, add(0x20, offset))) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/common/ERC2981.sol) pragma solidity ^0.8.20; import {IERC2981} from "../../interfaces/IERC2981.sol"; import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the ERC. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 tokenId => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev The default royalty set is invalid (eg. (numerator / denominator) >= 1). */ error ERC2981InvalidDefaultRoyalty(uint256 numerator, uint256 denominator); /** * @dev The default royalty receiver is invalid. */ error ERC2981InvalidDefaultRoyaltyReceiver(address receiver); /** * @dev The royalty set for an specific `tokenId` is invalid (eg. (numerator / denominator) >= 1). */ error ERC2981InvalidTokenRoyalty(uint256 tokenId, uint256 numerator, uint256 denominator); /** * @dev The royalty receiver for `tokenId` is invalid. */ error ERC2981InvalidTokenRoyaltyReceiver(uint256 tokenId, address receiver); /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) public view virtual returns (address receiver, uint256 amount) { RoyaltyInfo storage _royaltyInfo = _tokenRoyaltyInfo[tokenId]; address royaltyReceiver = _royaltyInfo.receiver; uint96 royaltyFraction = _royaltyInfo.royaltyFraction; if (royaltyReceiver == address(0)) { royaltyReceiver = _defaultRoyaltyInfo.receiver; royaltyFraction = _defaultRoyaltyInfo.royaltyFraction; } uint256 royaltyAmount = (salePrice * royaltyFraction) / _feeDenominator(); return (royaltyReceiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { uint256 denominator = _feeDenominator(); if (feeNumerator > denominator) { // Royalty fee will exceed the sale price revert ERC2981InvalidDefaultRoyalty(feeNumerator, denominator); } if (receiver == address(0)) { revert ERC2981InvalidDefaultRoyaltyReceiver(address(0)); } _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual { uint256 denominator = _feeDenominator(); if (feeNumerator > denominator) { // Royalty fee will exceed the sale price revert ERC2981InvalidTokenRoyalty(tokenId, feeNumerator, denominator); } if (receiver == address(0)) { revert ERC2981InvalidTokenRoyaltyReceiver(tokenId, address(0)); } _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; interface ICreatorTokenLegacy { event TransferValidatorUpdated(address oldValidator, address newValidator); function getTransferValidator() external view returns (address validator); function setTransferValidator(address validator) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; interface ICreatorToken { event TransferValidatorUpdated(address oldValidator, address newValidator); function getTransferValidator() external view returns (address validator); function setTransferValidator(address validator) external; function getTransferValidationFunction() external view returns (bytes4 functionSignature, bool isViewFunction); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "../utils/AutomaticValidatorTransferApproval.sol"; import "../utils/CreatorTokenBase.sol"; import "erc721a/contracts/ERC721A.sol"; import {TOKEN_TYPE_ERC721} from "@limitbreak/permit-c/src/Constants.sol"; /** * @title ERC721AC * @author Limit Break, Inc. * @notice Extends Azuki's ERC721-A implementation with Creator Token functionality, which * allows the contract owner to update the transfer validation logic by managing a security policy in * an external transfer validation security policy registry. See {CreatorTokenTransferValidator}. */ abstract contract ERC721AC is ERC721A, CreatorTokenBase, AutomaticValidatorTransferApproval { constructor(string memory name_, string memory symbol_) CreatorTokenBase() ERC721A(name_, symbol_) {} /** * @notice Overrides behavior of isApprovedFor all such that if an operator is not explicitly approved * for all, the contract owner can optionally auto-approve the 721-C transfer validator for transfers. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool isApproved) { isApproved = super.isApprovedForAll(owner, operator); if (!isApproved) { if (autoApproveTransfersFromValidator) { isApproved = operator == address(getTransferValidator()); } } } /** * @notice Indicates whether the contract implements the specified interface. * @dev Overrides supportsInterface in ERC165. * @param interfaceId The interface id * @return true if the contract implements the specified interface, false otherwise */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(ICreatorToken).interfaceId || interfaceId == type(ICreatorTokenLegacy).interfaceId || super.supportsInterface(interfaceId); } /** * @notice Returns the function selector for the transfer validator's validation function to be called * @notice for transaction simulation. */ function getTransferValidationFunction() external pure returns (bytes4 functionSignature, bool isViewFunction) { functionSignature = bytes4(keccak256("validateTransfer(address,address,address,uint256)")); isViewFunction = true; } /// @dev Ties the erc721a _beforeTokenTransfers hook to more granular transfer validation logic function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual override { for (uint256 i = 0; i < quantity;) { _validateBeforeTransfer(from, to, startTokenId + i); unchecked { ++i; } } } /// @dev Ties the erc721a _afterTokenTransfer hook to more granular transfer validation logic function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual override { for (uint256 i = 0; i < quantity;) { _validateAfterTransfer(from, to, startTokenId + i); unchecked { ++i; } } } function _msgSenderERC721A() internal view virtual override returns (address) { return _msgSender(); } function _tokenType() internal pure override returns(uint16) { return uint16(TOKEN_TYPE_ERC721); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/common/ERC2981.sol"; /** * @title BasicRoyaltiesBase * @author Limit Break, Inc. * @dev Base functionality of an NFT mix-in contract implementing the most basic form of programmable royalties. */ abstract contract BasicRoyaltiesBase is ERC2981 { event DefaultRoyaltySet(address indexed receiver, uint96 feeNumerator); event TokenRoyaltySet(uint256 indexed tokenId, address indexed receiver, uint96 feeNumerator); function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual override { super._setDefaultRoyalty(receiver, feeNumerator); emit DefaultRoyaltySet(receiver, feeNumerator); } function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual override { super._setTokenRoyalty(tokenId, receiver, feeNumerator); emit TokenRoyaltySet(tokenId, receiver, feeNumerator); } } /** * @title BasicRoyalties * @author Limit Break, Inc. * @notice Constructable BasicRoyalties Contract implementation. */ abstract contract BasicRoyalties is BasicRoyaltiesBase { constructor(address receiver, uint96 feeNumerator) { _setDefaultRoyalty(receiver, feeNumerator); } } /** * @title BasicRoyaltiesInitializable * @author Limit Break, Inc. * @notice Initializable BasicRoyalties Contract implementation to allow for EIP-1167 clones. */ abstract contract BasicRoyaltiesInitializable is BasicRoyaltiesBase {}
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./OwnablePermissions.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; abstract contract OwnableBasic is OwnablePermissions, Ownable { function _requireCallerIsContractOwner() internal view virtual override { _checkOwner(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (access/extensions/AccessControlEnumerable.sol) pragma solidity ^0.8.20; import {IAccessControlEnumerable} from "./IAccessControlEnumerable.sol"; import {AccessControl} from "../AccessControl.sol"; import {EnumerableSet} from "../../utils/structs/EnumerableSet.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping(bytes32 role => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) { return _roleMembers[role].length(); } /** * @dev Return all accounts that have `role` * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function getRoleMembers(bytes32 role) public view virtual returns (address[] memory) { return _roleMembers[role].values(); } /** * @dev Overload {AccessControl-_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override returns (bool) { bool granted = super._grantRole(role, account); if (granted) { _roleMembers[role].add(account); } return granted; } /** * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) { bool revoked = super._revokeRole(role, account); if (revoked) { _roleMembers[role].remove(account); } return revoked; } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721A. */ interface IERC721A { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * Cannot query the balance for the zero address. */ error BalanceQueryForZeroAddress(); /** * Cannot mint to the zero address. */ error MintToZeroAddress(); /** * The quantity of tokens minted must be more than zero. */ error MintZeroQuantity(); /** * The token does not exist. */ error OwnerQueryForNonexistentToken(); /** * The caller must own the token or be an approved operator. */ error TransferCallerNotOwnerNorApproved(); /** * The token must be owned by `from`. */ error TransferFromIncorrectOwner(); /** * Cannot safely transfer to a contract that does not implement the * ERC721Receiver interface. */ error TransferToNonERC721ReceiverImplementer(); /** * Cannot transfer to the zero address. */ error TransferToZeroAddress(); /** * The token does not exist. */ error URIQueryForNonexistentToken(); /** * The `quantity` minted with ERC2309 exceeds the safety limit. */ error MintERC2309QuantityExceedsLimit(); /** * The `extraData` cannot be set on an unintialized ownership slot. */ error OwnershipNotInitializedForExtraData(); /** * `_sequentialUpTo()` must be greater than `_startTokenId()`. */ error SequentialUpToTooSmall(); /** * The `tokenId` of a sequential mint exceeds `_sequentialUpTo()`. */ error SequentialMintExceedsLimit(); /** * Spot minting requires a `tokenId` greater than `_sequentialUpTo()`. */ error SpotMintTokenIdTooSmall(); /** * Cannot mint over a token that already exists. */ error TokenAlreadyExists(); /** * The feature is not compatible with spot mints. */ error NotCompatibleWithSpotMints(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. uint24 extraData; } // ============================================================= // TOKEN COUNTERS // ============================================================= /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() external view returns (uint256); // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================================================= // IERC721 // ============================================================= /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables * (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, * checking first that contract recipients are aware of the ERC721 protocol * to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move * this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external payable; /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Transfers `tokenId` from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} * whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external payable; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) external view returns (bool); // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); // ============================================================= // IERC2309 // ============================================================= /** * @dev Emitted when tokens in `fromTokenId` to `toTokenId` * (inclusive) is transferred from `from` to `to`, as defined in the * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard. * * See {_mintERC2309} for more details. */ event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; import {SafeCast} from "./SafeCast.sol"; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant. * * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone. * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute * one branch when needed, making this function more expensive. */ function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) { unchecked { // branchless ternary works because: // b ^ (a ^ b) == a // b ^ 0 == b return b ^ ((a ^ b) * int256(SafeCast.toUint(condition))); } } /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return ternary(a > b, a, b); } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return ternary(a < b, a, b); } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // Formula from the "Bit Twiddling Hacks" by Sean Eron Anderson. // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift, // taking advantage of the most significant (or "sign" bit) in two's complement representation. // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result, // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative). int256 mask = n >> 255; // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it. return uint256((n + mask) ^ mask); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "../access/OwnablePermissions.sol"; /** * @title AutomaticValidatorTransferApproval * @author Limit Break, Inc. * @notice Base contract mix-in that provides boilerplate code giving the contract owner the * option to automatically approve a 721-C transfer validator implementation for transfers. */ abstract contract AutomaticValidatorTransferApproval is OwnablePermissions { /// @dev Emitted when the automatic approval flag is modified by the creator. event AutomaticApprovalOfTransferValidatorSet(bool autoApproved); /// @dev If true, the collection's transfer validator is automatically approved to transfer holder's tokens. bool public autoApproveTransfersFromValidator; /** * @notice Sets if the transfer validator is automatically approved as an operator for all token owners. * * @dev Throws when the caller is not the contract owner. * * @param autoApprove If true, the collection's transfer validator will be automatically approved to * transfer holder's tokens. */ function setAutomaticApprovalOfTransfersFromValidator(bool autoApprove) external { _requireCallerIsContractOwner(); autoApproveTransfersFromValidator = autoApprove; emit AutomaticApprovalOfTransferValidatorSet(autoApprove); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol) // This file was procedurally generated from scripts/generate/templates/SafeCast.js. pragma solidity ^0.8.20; /** * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such an operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeCast { /** * @dev Value doesn't fit in an uint of `bits` size. */ error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value); /** * @dev An int value doesn't fit in an uint of `bits` size. */ error SafeCastOverflowedIntToUint(int256 value); /** * @dev Value doesn't fit in an int of `bits` size. */ error SafeCastOverflowedIntDowncast(uint8 bits, int256 value); /** * @dev An uint value doesn't fit in an int of `bits` size. */ error SafeCastOverflowedUintToInt(uint256 value); /** * @dev Returns the downcasted uint248 from uint256, reverting on * overflow (when the input is greater than largest uint248). * * Counterpart to Solidity's `uint248` operator. * * Requirements: * * - input must fit into 248 bits */ function toUint248(uint256 value) internal pure returns (uint248) { if (value > type(uint248).max) { revert SafeCastOverflowedUintDowncast(248, value); } return uint248(value); } /** * @dev Returns the downcasted uint240 from uint256, reverting on * overflow (when the input is greater than largest uint240). * * Counterpart to Solidity's `uint240` operator. * * Requirements: * * - input must fit into 240 bits */ function toUint240(uint256 value) internal pure returns (uint240) { if (value > type(uint240).max) { revert SafeCastOverflowedUintDowncast(240, value); } return uint240(value); } /** * @dev Returns the downcasted uint232 from uint256, reverting on * overflow (when the input is greater than largest uint232). * * Counterpart to Solidity's `uint232` operator. * * Requirements: * * - input must fit into 232 bits */ function toUint232(uint256 value) internal pure returns (uint232) { if (value > type(uint232).max) { revert SafeCastOverflowedUintDowncast(232, value); } return uint232(value); } /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). * * Counterpart to Solidity's `uint224` operator. * * Requirements: * * - input must fit into 224 bits */ function toUint224(uint256 value) internal pure returns (uint224) { if (value > type(uint224).max) { revert SafeCastOverflowedUintDowncast(224, value); } return uint224(value); } /** * @dev Returns the downcasted uint216 from uint256, reverting on * overflow (when the input is greater than largest uint216). * * Counterpart to Solidity's `uint216` operator. * * Requirements: * * - input must fit into 216 bits */ function toUint216(uint256 value) internal pure returns (uint216) { if (value > type(uint216).max) { revert SafeCastOverflowedUintDowncast(216, value); } return uint216(value); } /** * @dev Returns the downcasted uint208 from uint256, reverting on * overflow (when the input is greater than largest uint208). * * Counterpart to Solidity's `uint208` operator. * * Requirements: * * - input must fit into 208 bits */ function toUint208(uint256 value) internal pure returns (uint208) { if (value > type(uint208).max) { revert SafeCastOverflowedUintDowncast(208, value); } return uint208(value); } /** * @dev Returns the downcasted uint200 from uint256, reverting on * overflow (when the input is greater than largest uint200). * * Counterpart to Solidity's `uint200` operator. * * Requirements: * * - input must fit into 200 bits */ function toUint200(uint256 value) internal pure returns (uint200) { if (value > type(uint200).max) { revert SafeCastOverflowedUintDowncast(200, value); } return uint200(value); } /** * @dev Returns the downcasted uint192 from uint256, reverting on * overflow (when the input is greater than largest uint192). * * Counterpart to Solidity's `uint192` operator. * * Requirements: * * - input must fit into 192 bits */ function toUint192(uint256 value) internal pure returns (uint192) { if (value > type(uint192).max) { revert SafeCastOverflowedUintDowncast(192, value); } return uint192(value); } /** * @dev Returns the downcasted uint184 from uint256, reverting on * overflow (when the input is greater than largest uint184). * * Counterpart to Solidity's `uint184` operator. * * Requirements: * * - input must fit into 184 bits */ function toUint184(uint256 value) internal pure returns (uint184) { if (value > type(uint184).max) { revert SafeCastOverflowedUintDowncast(184, value); } return uint184(value); } /** * @dev Returns the downcasted uint176 from uint256, reverting on * overflow (when the input is greater than largest uint176). * * Counterpart to Solidity's `uint176` operator. * * Requirements: * * - input must fit into 176 bits */ function toUint176(uint256 value) internal pure returns (uint176) { if (value > type(uint176).max) { revert SafeCastOverflowedUintDowncast(176, value); } return uint176(value); } /** * @dev Returns the downcasted uint168 from uint256, reverting on * overflow (when the input is greater than largest uint168). * * Counterpart to Solidity's `uint168` operator. * * Requirements: * * - input must fit into 168 bits */ function toUint168(uint256 value) internal pure returns (uint168) { if (value > type(uint168).max) { revert SafeCastOverflowedUintDowncast(168, value); } return uint168(value); } /** * @dev Returns the downcasted uint160 from uint256, reverting on * overflow (when the input is greater than largest uint160). * * Counterpart to Solidity's `uint160` operator. * * Requirements: * * - input must fit into 160 bits */ function toUint160(uint256 value) internal pure returns (uint160) { if (value > type(uint160).max) { revert SafeCastOverflowedUintDowncast(160, value); } return uint160(value); } /** * @dev Returns the downcasted uint152 from uint256, reverting on * overflow (when the input is greater than largest uint152). * * Counterpart to Solidity's `uint152` operator. * * Requirements: * * - input must fit into 152 bits */ function toUint152(uint256 value) internal pure returns (uint152) { if (value > type(uint152).max) { revert SafeCastOverflowedUintDowncast(152, value); } return uint152(value); } /** * @dev Returns the downcasted uint144 from uint256, reverting on * overflow (when the input is greater than largest uint144). * * Counterpart to Solidity's `uint144` operator. * * Requirements: * * - input must fit into 144 bits */ function toUint144(uint256 value) internal pure returns (uint144) { if (value > type(uint144).max) { revert SafeCastOverflowedUintDowncast(144, value); } return uint144(value); } /** * @dev Returns the downcasted uint136 from uint256, reverting on * overflow (when the input is greater than largest uint136). * * Counterpart to Solidity's `uint136` operator. * * Requirements: * * - input must fit into 136 bits */ function toUint136(uint256 value) internal pure returns (uint136) { if (value > type(uint136).max) { revert SafeCastOverflowedUintDowncast(136, value); } return uint136(value); } /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { if (value > type(uint128).max) { revert SafeCastOverflowedUintDowncast(128, value); } return uint128(value); } /** * @dev Returns the downcasted uint120 from uint256, reverting on * overflow (when the input is greater than largest uint120). * * Counterpart to Solidity's `uint120` operator. * * Requirements: * * - input must fit into 120 bits */ function toUint120(uint256 value) internal pure returns (uint120) { if (value > type(uint120).max) { revert SafeCastOverflowedUintDowncast(120, value); } return uint120(value); } /** * @dev Returns the downcasted uint112 from uint256, reverting on * overflow (when the input is greater than largest uint112). * * Counterpart to Solidity's `uint112` operator. * * Requirements: * * - input must fit into 112 bits */ function toUint112(uint256 value) internal pure returns (uint112) { if (value > type(uint112).max) { revert SafeCastOverflowedUintDowncast(112, value); } return uint112(value); } /** * @dev Returns the downcasted uint104 from uint256, reverting on * overflow (when the input is greater than largest uint104). * * Counterpart to Solidity's `uint104` operator. * * Requirements: * * - input must fit into 104 bits */ function toUint104(uint256 value) internal pure returns (uint104) { if (value > type(uint104).max) { revert SafeCastOverflowedUintDowncast(104, value); } return uint104(value); } /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). * * Counterpart to Solidity's `uint96` operator. * * Requirements: * * - input must fit into 96 bits */ function toUint96(uint256 value) internal pure returns (uint96) { if (value > type(uint96).max) { revert SafeCastOverflowedUintDowncast(96, value); } return uint96(value); } /** * @dev Returns the downcasted uint88 from uint256, reverting on * overflow (when the input is greater than largest uint88). * * Counterpart to Solidity's `uint88` operator. * * Requirements: * * - input must fit into 88 bits */ function toUint88(uint256 value) internal pure returns (uint88) { if (value > type(uint88).max) { revert SafeCastOverflowedUintDowncast(88, value); } return uint88(value); } /** * @dev Returns the downcasted uint80 from uint256, reverting on * overflow (when the input is greater than largest uint80). * * Counterpart to Solidity's `uint80` operator. * * Requirements: * * - input must fit into 80 bits */ function toUint80(uint256 value) internal pure returns (uint80) { if (value > type(uint80).max) { revert SafeCastOverflowedUintDowncast(80, value); } return uint80(value); } /** * @dev Returns the downcasted uint72 from uint256, reverting on * overflow (when the input is greater than largest uint72). * * Counterpart to Solidity's `uint72` operator. * * Requirements: * * - input must fit into 72 bits */ function toUint72(uint256 value) internal pure returns (uint72) { if (value > type(uint72).max) { revert SafeCastOverflowedUintDowncast(72, value); } return uint72(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { if (value > type(uint64).max) { revert SafeCastOverflowedUintDowncast(64, value); } return uint64(value); } /** * @dev Returns the downcasted uint56 from uint256, reverting on * overflow (when the input is greater than largest uint56). * * Counterpart to Solidity's `uint56` operator. * * Requirements: * * - input must fit into 56 bits */ function toUint56(uint256 value) internal pure returns (uint56) { if (value > type(uint56).max) { revert SafeCastOverflowedUintDowncast(56, value); } return uint56(value); } /** * @dev Returns the downcasted uint48 from uint256, reverting on * overflow (when the input is greater than largest uint48). * * Counterpart to Solidity's `uint48` operator. * * Requirements: * * - input must fit into 48 bits */ function toUint48(uint256 value) internal pure returns (uint48) { if (value > type(uint48).max) { revert SafeCastOverflowedUintDowncast(48, value); } return uint48(value); } /** * @dev Returns the downcasted uint40 from uint256, reverting on * overflow (when the input is greater than largest uint40). * * Counterpart to Solidity's `uint40` operator. * * Requirements: * * - input must fit into 40 bits */ function toUint40(uint256 value) internal pure returns (uint40) { if (value > type(uint40).max) { revert SafeCastOverflowedUintDowncast(40, value); } return uint40(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { if (value > type(uint32).max) { revert SafeCastOverflowedUintDowncast(32, value); } return uint32(value); } /** * @dev Returns the downcasted uint24 from uint256, reverting on * overflow (when the input is greater than largest uint24). * * Counterpart to Solidity's `uint24` operator. * * Requirements: * * - input must fit into 24 bits */ function toUint24(uint256 value) internal pure returns (uint24) { if (value > type(uint24).max) { revert SafeCastOverflowedUintDowncast(24, value); } return uint24(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { if (value > type(uint16).max) { revert SafeCastOverflowedUintDowncast(16, value); } return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits */ function toUint8(uint256 value) internal pure returns (uint8) { if (value > type(uint8).max) { revert SafeCastOverflowedUintDowncast(8, value); } return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. */ function toUint256(int256 value) internal pure returns (uint256) { if (value < 0) { revert SafeCastOverflowedIntToUint(value); } return uint256(value); } /** * @dev Returns the downcasted int248 from int256, reverting on * overflow (when the input is less than smallest int248 or * greater than largest int248). * * Counterpart to Solidity's `int248` operator. * * Requirements: * * - input must fit into 248 bits */ function toInt248(int256 value) internal pure returns (int248 downcasted) { downcasted = int248(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(248, value); } } /** * @dev Returns the downcasted int240 from int256, reverting on * overflow (when the input is less than smallest int240 or * greater than largest int240). * * Counterpart to Solidity's `int240` operator. * * Requirements: * * - input must fit into 240 bits */ function toInt240(int256 value) internal pure returns (int240 downcasted) { downcasted = int240(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(240, value); } } /** * @dev Returns the downcasted int232 from int256, reverting on * overflow (when the input is less than smallest int232 or * greater than largest int232). * * Counterpart to Solidity's `int232` operator. * * Requirements: * * - input must fit into 232 bits */ function toInt232(int256 value) internal pure returns (int232 downcasted) { downcasted = int232(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(232, value); } } /** * @dev Returns the downcasted int224 from int256, reverting on * overflow (when the input is less than smallest int224 or * greater than largest int224). * * Counterpart to Solidity's `int224` operator. * * Requirements: * * - input must fit into 224 bits */ function toInt224(int256 value) internal pure returns (int224 downcasted) { downcasted = int224(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(224, value); } } /** * @dev Returns the downcasted int216 from int256, reverting on * overflow (when the input is less than smallest int216 or * greater than largest int216). * * Counterpart to Solidity's `int216` operator. * * Requirements: * * - input must fit into 216 bits */ function toInt216(int256 value) internal pure returns (int216 downcasted) { downcasted = int216(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(216, value); } } /** * @dev Returns the downcasted int208 from int256, reverting on * overflow (when the input is less than smallest int208 or * greater than largest int208). * * Counterpart to Solidity's `int208` operator. * * Requirements: * * - input must fit into 208 bits */ function toInt208(int256 value) internal pure returns (int208 downcasted) { downcasted = int208(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(208, value); } } /** * @dev Returns the downcasted int200 from int256, reverting on * overflow (when the input is less than smallest int200 or * greater than largest int200). * * Counterpart to Solidity's `int200` operator. * * Requirements: * * - input must fit into 200 bits */ function toInt200(int256 value) internal pure returns (int200 downcasted) { downcasted = int200(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(200, value); } } /** * @dev Returns the downcasted int192 from int256, reverting on * overflow (when the input is less than smallest int192 or * greater than largest int192). * * Counterpart to Solidity's `int192` operator. * * Requirements: * * - input must fit into 192 bits */ function toInt192(int256 value) internal pure returns (int192 downcasted) { downcasted = int192(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(192, value); } } /** * @dev Returns the downcasted int184 from int256, reverting on * overflow (when the input is less than smallest int184 or * greater than largest int184). * * Counterpart to Solidity's `int184` operator. * * Requirements: * * - input must fit into 184 bits */ function toInt184(int256 value) internal pure returns (int184 downcasted) { downcasted = int184(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(184, value); } } /** * @dev Returns the downcasted int176 from int256, reverting on * overflow (when the input is less than smallest int176 or * greater than largest int176). * * Counterpart to Solidity's `int176` operator. * * Requirements: * * - input must fit into 176 bits */ function toInt176(int256 value) internal pure returns (int176 downcasted) { downcasted = int176(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(176, value); } } /** * @dev Returns the downcasted int168 from int256, reverting on * overflow (when the input is less than smallest int168 or * greater than largest int168). * * Counterpart to Solidity's `int168` operator. * * Requirements: * * - input must fit into 168 bits */ function toInt168(int256 value) internal pure returns (int168 downcasted) { downcasted = int168(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(168, value); } } /** * @dev Returns the downcasted int160 from int256, reverting on * overflow (when the input is less than smallest int160 or * greater than largest int160). * * Counterpart to Solidity's `int160` operator. * * Requirements: * * - input must fit into 160 bits */ function toInt160(int256 value) internal pure returns (int160 downcasted) { downcasted = int160(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(160, value); } } /** * @dev Returns the downcasted int152 from int256, reverting on * overflow (when the input is less than smallest int152 or * greater than largest int152). * * Counterpart to Solidity's `int152` operator. * * Requirements: * * - input must fit into 152 bits */ function toInt152(int256 value) internal pure returns (int152 downcasted) { downcasted = int152(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(152, value); } } /** * @dev Returns the downcasted int144 from int256, reverting on * overflow (when the input is less than smallest int144 or * greater than largest int144). * * Counterpart to Solidity's `int144` operator. * * Requirements: * * - input must fit into 144 bits */ function toInt144(int256 value) internal pure returns (int144 downcasted) { downcasted = int144(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(144, value); } } /** * @dev Returns the downcasted int136 from int256, reverting on * overflow (when the input is less than smallest int136 or * greater than largest int136). * * Counterpart to Solidity's `int136` operator. * * Requirements: * * - input must fit into 136 bits */ function toInt136(int256 value) internal pure returns (int136 downcasted) { downcasted = int136(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(136, value); } } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits */ function toInt128(int256 value) internal pure returns (int128 downcasted) { downcasted = int128(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(128, value); } } /** * @dev Returns the downcasted int120 from int256, reverting on * overflow (when the input is less than smallest int120 or * greater than largest int120). * * Counterpart to Solidity's `int120` operator. * * Requirements: * * - input must fit into 120 bits */ function toInt120(int256 value) internal pure returns (int120 downcasted) { downcasted = int120(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(120, value); } } /** * @dev Returns the downcasted int112 from int256, reverting on * overflow (when the input is less than smallest int112 or * greater than largest int112). * * Counterpart to Solidity's `int112` operator. * * Requirements: * * - input must fit into 112 bits */ function toInt112(int256 value) internal pure returns (int112 downcasted) { downcasted = int112(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(112, value); } } /** * @dev Returns the downcasted int104 from int256, reverting on * overflow (when the input is less than smallest int104 or * greater than largest int104). * * Counterpart to Solidity's `int104` operator. * * Requirements: * * - input must fit into 104 bits */ function toInt104(int256 value) internal pure returns (int104 downcasted) { downcasted = int104(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(104, value); } } /** * @dev Returns the downcasted int96 from int256, reverting on * overflow (when the input is less than smallest int96 or * greater than largest int96). * * Counterpart to Solidity's `int96` operator. * * Requirements: * * - input must fit into 96 bits */ function toInt96(int256 value) internal pure returns (int96 downcasted) { downcasted = int96(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(96, value); } } /** * @dev Returns the downcasted int88 from int256, reverting on * overflow (when the input is less than smallest int88 or * greater than largest int88). * * Counterpart to Solidity's `int88` operator. * * Requirements: * * - input must fit into 88 bits */ function toInt88(int256 value) internal pure returns (int88 downcasted) { downcasted = int88(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(88, value); } } /** * @dev Returns the downcasted int80 from int256, reverting on * overflow (when the input is less than smallest int80 or * greater than largest int80). * * Counterpart to Solidity's `int80` operator. * * Requirements: * * - input must fit into 80 bits */ function toInt80(int256 value) internal pure returns (int80 downcasted) { downcasted = int80(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(80, value); } } /** * @dev Returns the downcasted int72 from int256, reverting on * overflow (when the input is less than smallest int72 or * greater than largest int72). * * Counterpart to Solidity's `int72` operator. * * Requirements: * * - input must fit into 72 bits */ function toInt72(int256 value) internal pure returns (int72 downcasted) { downcasted = int72(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(72, value); } } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits */ function toInt64(int256 value) internal pure returns (int64 downcasted) { downcasted = int64(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(64, value); } } /** * @dev Returns the downcasted int56 from int256, reverting on * overflow (when the input is less than smallest int56 or * greater than largest int56). * * Counterpart to Solidity's `int56` operator. * * Requirements: * * - input must fit into 56 bits */ function toInt56(int256 value) internal pure returns (int56 downcasted) { downcasted = int56(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(56, value); } } /** * @dev Returns the downcasted int48 from int256, reverting on * overflow (when the input is less than smallest int48 or * greater than largest int48). * * Counterpart to Solidity's `int48` operator. * * Requirements: * * - input must fit into 48 bits */ function toInt48(int256 value) internal pure returns (int48 downcasted) { downcasted = int48(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(48, value); } } /** * @dev Returns the downcasted int40 from int256, reverting on * overflow (when the input is less than smallest int40 or * greater than largest int40). * * Counterpart to Solidity's `int40` operator. * * Requirements: * * - input must fit into 40 bits */ function toInt40(int256 value) internal pure returns (int40 downcasted) { downcasted = int40(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(40, value); } } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits */ function toInt32(int256 value) internal pure returns (int32 downcasted) { downcasted = int32(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(32, value); } } /** * @dev Returns the downcasted int24 from int256, reverting on * overflow (when the input is less than smallest int24 or * greater than largest int24). * * Counterpart to Solidity's `int24` operator. * * Requirements: * * - input must fit into 24 bits */ function toInt24(int256 value) internal pure returns (int24 downcasted) { downcasted = int24(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(24, value); } } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits */ function toInt16(int256 value) internal pure returns (int16 downcasted) { downcasted = int16(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(16, value); } } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits */ function toInt8(int256 value) internal pure returns (int8 downcasted) { downcasted = int8(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(8, value); } } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive if (value > uint256(type(int256).max)) { revert SafeCastOverflowedUintToInt(value); } return int256(value); } /** * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump. */ function toUint(bool b) internal pure returns (uint256 u) { assembly ("memory-safe") { u := iszero(iszero(b)) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @dev Constant bytes32 value of 0x000...000 bytes32 constant ZERO_BYTES32 = bytes32(0); /// @dev Constant value of 0 uint256 constant ZERO = 0; /// @dev Constant value of 1 uint256 constant ONE = 1; /// @dev Constant value representing an open order in storage uint8 constant ORDER_STATE_OPEN = 0; /// @dev Constant value representing a filled order in storage uint8 constant ORDER_STATE_FILLED = 1; /// @dev Constant value representing a cancelled order in storage uint8 constant ORDER_STATE_CANCELLED = 2; /// @dev Constant value representing the ERC721 token type for signatures and transfer hooks uint256 constant TOKEN_TYPE_ERC721 = 721; /// @dev Constant value representing the ERC1155 token type for signatures and transfer hooks uint256 constant TOKEN_TYPE_ERC1155 = 1155; /// @dev Constant value representing the ERC20 token type for signatures and transfer hooks uint256 constant TOKEN_TYPE_ERC20 = 20; /// @dev Constant value to mask the upper bits of a signature that uses a packed `vs` value to extract `s` bytes32 constant UPPER_BIT_MASK = 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff; /// @dev EIP-712 typehash used for validating signature based stored approvals bytes32 constant UPDATE_APPROVAL_TYPEHASH = keccak256("UpdateApprovalBySignature(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 nonce,address operator,uint256 approvalExpiration,uint256 sigDeadline,uint256 masterNonce)"); /// @dev EIP-712 typehash used for validating a single use permit without additional data bytes32 constant SINGLE_USE_PERMIT_TYPEHASH = keccak256("PermitTransferFrom(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 nonce,address operator,uint256 expiration,uint256 masterNonce)"); /// @dev EIP-712 typehash used for validating a single use permit with additional data string constant SINGLE_USE_PERMIT_TRANSFER_ADVANCED_TYPEHASH_STUB = "PermitTransferFromWithAdditionalData(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 nonce,address operator,uint256 expiration,uint256 masterNonce,"; /// @dev EIP-712 typehash used for validating an order permit that updates storage as it fills string constant PERMIT_ORDER_ADVANCED_TYPEHASH_STUB = "PermitOrderWithAdditionalData(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 salt,address operator,uint256 expiration,uint256 masterNonce,"; /// @dev Pausable flag for stored approval transfers of ERC721 assets uint256 constant PAUSABLE_APPROVAL_TRANSFER_FROM_ERC721 = 1 << 0; /// @dev Pausable flag for stored approval transfers of ERC1155 assets uint256 constant PAUSABLE_APPROVAL_TRANSFER_FROM_ERC1155 = 1 << 1; /// @dev Pausable flag for stored approval transfers of ERC20 assets uint256 constant PAUSABLE_APPROVAL_TRANSFER_FROM_ERC20 = 1 << 2; /// @dev Pausable flag for single use permit transfers of ERC721 assets uint256 constant PAUSABLE_PERMITTED_TRANSFER_FROM_ERC721 = 1 << 3; /// @dev Pausable flag for single use permit transfers of ERC1155 assets uint256 constant PAUSABLE_PERMITTED_TRANSFER_FROM_ERC1155 = 1 << 4; /// @dev Pausable flag for single use permit transfers of ERC20 assets uint256 constant PAUSABLE_PERMITTED_TRANSFER_FROM_ERC20 = 1 << 5; /// @dev Pausable flag for order fill transfers of ERC1155 assets uint256 constant PAUSABLE_ORDER_TRANSFER_FROM_ERC1155 = 1 << 6; /// @dev Pausable flag for order fill transfers of ERC20 assets uint256 constant PAUSABLE_ORDER_TRANSFER_FROM_ERC20 = 1 << 7;
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.20; import {IERC165} from "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. * * NOTE: ERC-2981 allows setting the royalty to 100% of the price. In that case all the price would be sent to the * royalty receiver and 0 tokens to the seller. Contracts dealing with royalty should consider empty transfers. */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "../access/OwnablePermissions.sol"; import "../interfaces/ICreatorToken.sol"; import "../interfaces/ICreatorTokenLegacy.sol"; import "../interfaces/ITransferValidator.sol"; import "./TransferValidation.sol"; import "../interfaces/ITransferValidatorSetTokenType.sol"; /** * @title CreatorTokenBase * @author Limit Break, Inc. * @notice CreatorTokenBaseV3 is an abstract contract that provides basic functionality for managing token * transfer policies through an implementation of ICreatorTokenTransferValidator/ICreatorTokenTransferValidatorV2/ICreatorTokenTransferValidatorV3. * This contract is intended to be used as a base for creator-specific token contracts, enabling customizable transfer * restrictions and security policies. * * <h4>Features:</h4> * <ul>Ownable: This contract can have an owner who can set and update the transfer validator.</ul> * <ul>TransferValidation: Implements the basic token transfer validation interface.</ul> * * <h4>Benefits:</h4> * <ul>Provides a flexible and modular way to implement custom token transfer restrictions and security policies.</ul> * <ul>Allows creators to enforce policies such as account and codehash blacklists, whitelists, and graylists.</ul> * <ul>Can be easily integrated into other token contracts as a base contract.</ul> * * <h4>Intended Usage:</h4> * <ul>Use as a base contract for creator token implementations that require advanced transfer restrictions and * security policies.</ul> * <ul>Set and update the ICreatorTokenTransferValidator implementation contract to enforce desired policies for the * creator token.</ul> * * <h4>Compatibility:</h4> * <ul>Backward and Forward Compatible - V1/V2/V3 Creator Token Base will work with V1/V2/V3 Transfer Validators.</ul> */ abstract contract CreatorTokenBase is OwnablePermissions, TransferValidation, ICreatorToken { /// @dev Thrown when setting a transfer validator address that has no deployed code. error CreatorTokenBase__InvalidTransferValidatorContract(); /// @dev The default transfer validator that will be used if no transfer validator has been set by the creator. address public constant DEFAULT_TRANSFER_VALIDATOR = address(0x721C002B0059009a671D00aD1700c9748146cd1B); /// @dev Used to determine if the default transfer validator is applied. /// @dev Set to true when the creator sets a transfer validator address. bool private isValidatorInitialized; /// @dev Address of the transfer validator to apply to transactions. address private transferValidator; constructor() { _emitDefaultTransferValidator(); _registerTokenType(DEFAULT_TRANSFER_VALIDATOR); } /** * @notice Sets the transfer validator for the token contract. * * @dev Throws when provided validator contract is not the zero address and does not have code. * @dev Throws when the caller is not the contract owner. * * @dev <h4>Postconditions:</h4> * 1. The transferValidator address is updated. * 2. The `TransferValidatorUpdated` event is emitted. * * @param transferValidator_ The address of the transfer validator contract. */ function setTransferValidator(address transferValidator_) public { _requireCallerIsContractOwner(); bool isValidTransferValidator = transferValidator_.code.length > 0; if(transferValidator_ != address(0) && !isValidTransferValidator) { revert CreatorTokenBase__InvalidTransferValidatorContract(); } emit TransferValidatorUpdated(address(getTransferValidator()), transferValidator_); isValidatorInitialized = true; transferValidator = transferValidator_; _registerTokenType(transferValidator_); } /** * @notice Returns the transfer validator contract address for this token contract. */ function getTransferValidator() public view override returns (address validator) { validator = transferValidator; if (validator == address(0)) { if (!isValidatorInitialized) { validator = DEFAULT_TRANSFER_VALIDATOR; } } } /** * @dev Pre-validates a token transfer, reverting if the transfer is not allowed by this token's security policy. * Inheriting contracts are responsible for overriding the _beforeTokenTransfer function, or its equivalent * and calling _validateBeforeTransfer so that checks can be properly applied during token transfers. * * @dev Be aware that if the msg.sender is the transfer validator, the transfer is automatically permitted, as the * transfer validator is expected to pre-validate the transfer. * * @dev Throws when the transfer doesn't comply with the collection's transfer policy, if the transferValidator is * set to a non-zero address. * * @param caller The address of the caller. * @param from The address of the sender. * @param to The address of the receiver. * @param tokenId The token id being transferred. */ function _preValidateTransfer( address caller, address from, address to, uint256 tokenId, uint256 /*value*/) internal virtual override { address validator = getTransferValidator(); if (validator != address(0)) { if (msg.sender == validator) { return; } ITransferValidator(validator).validateTransfer(caller, from, to, tokenId); } } /** * @dev Pre-validates a token transfer, reverting if the transfer is not allowed by this token's security policy. * Inheriting contracts are responsible for overriding the _beforeTokenTransfer function, or its equivalent * and calling _validateBeforeTransfer so that checks can be properly applied during token transfers. * * @dev Be aware that if the msg.sender is the transfer validator, the transfer is automatically permitted, as the * transfer validator is expected to pre-validate the transfer. * * @dev Used for ERC20 and ERC1155 token transfers which have an amount value to validate in the transfer validator. * @dev The `tokenId` for ERC20 tokens should be set to `0`. * * @dev Throws when the transfer doesn't comply with the collection's transfer policy, if the transferValidator is * set to a non-zero address. * * @param caller The address of the caller. * @param from The address of the sender. * @param to The address of the receiver. * @param tokenId The token id being transferred. * @param amount The amount of token being transferred. */ function _preValidateTransfer( address caller, address from, address to, uint256 tokenId, uint256 amount, uint256 /*value*/) internal virtual override { address validator = getTransferValidator(); if (validator != address(0)) { if (msg.sender == validator) { return; } ITransferValidator(validator).validateTransfer(caller, from, to, tokenId, amount); } } function _tokenType() internal virtual pure returns(uint16); function _registerTokenType(address validator) internal { if (validator != address(0)) { uint256 validatorCodeSize; assembly { validatorCodeSize := extcodesize(validator) } if(validatorCodeSize > 0) { try ITransferValidatorSetTokenType(validator).setTokenTypeOfCollection(address(this), _tokenType()) { } catch { } } } } /** * @dev Used during contract deployment for constructable and cloneable creator tokens * @dev to emit the `TransferValidatorUpdated` event signaling the validator for the contract * @dev is the default transfer validator. */ function _emitDefaultTransferValidator() internal { emit TransferValidatorUpdated(address(0), DEFAULT_TRANSFER_VALIDATOR); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol) pragma solidity ^0.8.20; import {IAccessControl} from "./IAccessControl.sol"; import {Context} from "../utils/Context.sol"; import {ERC165} from "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address account => bool) hasRole; bytes32 adminRole; } mapping(bytes32 role => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with an {AccessControlUnauthorizedAccount} error including the required role. */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual returns (bool) { return _roles[role].hasRole[account]; } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()` * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier. */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account` * is missing `role`. */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert AccessControlUnauthorizedAccount(account, role); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address callerConfirmation) public virtual { if (callerConfirmation != _msgSender()) { revert AccessControlBadConfirmation(); } _revokeRole(role, callerConfirmation); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual returns (bool) { if (!hasRole(role, account)) { _roles[role].hasRole[account] = true; emit RoleGranted(role, account, _msgSender()); return true; } else { return false; } } /** * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual returns (bool) { if (hasRole(role, account)) { _roles[role].hasRole[account] = false; emit RoleRevoked(role, account, _msgSender()); return true; } else { return false; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol) pragma solidity ^0.8.20; import {Panic} from "../Panic.sol"; import {SafeCast} from "./SafeCast.sol"; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an success flag (no overflow). */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow). */ function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow). */ function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a success flag (no division by zero). */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero). */ function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant. * * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone. * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute * one branch when needed, making this function more expensive. */ function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) { unchecked { // branchless ternary works because: // b ^ (a ^ b) == a // b ^ 0 == b return b ^ ((a ^ b) * SafeCast.toUint(condition)); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return ternary(a > b, a, b); } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return ternary(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 towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. Panic.panic(Panic.DIVISION_BY_ZERO); } // The following calculation ensures accurate ceiling division without overflow. // Since a is non-zero, (a - 1) / b will not overflow. // The largest possible result occurs when (a - 1) / b is type(uint256).max, // but the largest value we can obtain is type(uint256).max - 1, which happens // when a = type(uint256).max and b = 1. unchecked { return SafeCast.toUint(a > 0) * ((a - 1) / b + 1); } } /** * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * * 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²⁵⁶ and mod 2²⁵⁶ - 1, then use // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2²⁵⁶ + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0. if (denominator <= prod1) { Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW)); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); 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²⁵⁶ / 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²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv ≡ 1 mod 2⁴. 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⁸ inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶ inverse *= 2 - denominator * inverse; // inverse mod 2³² inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴ inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸ inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶ // 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²⁵⁶. Since the preconditions guarantee that the outcome is // less than 2²⁵⁶, 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; } } /** * @dev 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) { return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0); } /** * @dev Calculate the modular multiplicative inverse of a number in Z/nZ. * * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0. * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible. * * If the input value is not inversible, 0 is returned. * * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}. */ function invMod(uint256 a, uint256 n) internal pure returns (uint256) { unchecked { if (n == 0) return 0; // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version) // Used to compute integers x and y such that: ax + ny = gcd(a, n). // When the gcd is 1, then the inverse of a modulo n exists and it's x. // ax + ny = 1 // ax = 1 + (-y)n // ax ≡ 1 (mod n) # x is the inverse of a modulo n // If the remainder is 0 the gcd is n right away. uint256 remainder = a % n; uint256 gcd = n; // Therefore the initial coefficients are: // ax + ny = gcd(a, n) = n // 0a + 1n = n int256 x = 0; int256 y = 1; while (remainder != 0) { uint256 quotient = gcd / remainder; (gcd, remainder) = ( // The old remainder is the next gcd to try. remainder, // Compute the next remainder. // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd // where gcd is at most n (capped to type(uint256).max) gcd - remainder * quotient ); (x, y) = ( // Increment the coefficient of a. y, // Decrement the coefficient of n. // Can overflow, but the result is casted to uint256 so that the // next value of y is "wrapped around" to a value between 0 and n - 1. x - y * int256(quotient) ); } if (gcd != 1) return 0; // No inverse exists. return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative. } } /** * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`. * * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that * `a**(p-2)` is the modular multiplicative inverse of a in Fp. * * NOTE: this function does NOT check that `p` is a prime greater than `2`. */ function invModPrime(uint256 a, uint256 p) internal view returns (uint256) { unchecked { return Math.modExp(a, p - 2, p); } } /** * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m) * * Requirements: * - modulus can't be zero * - underlying staticcall to precompile must succeed * * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make * sure the chain you're using it on supports the precompiled contract for modular exponentiation * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, * the underlying function will succeed given the lack of a revert, but the result may be incorrectly * interpreted as 0. */ function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) { (bool success, uint256 result) = tryModExp(b, e, m); if (!success) { Panic.panic(Panic.DIVISION_BY_ZERO); } return result; } /** * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m). * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying * to operate modulo 0 or if the underlying precompile reverted. * * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack * of a revert, but the result may be incorrectly interpreted as 0. */ function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) { if (m == 0) return (false, 0); assembly ("memory-safe") { let ptr := mload(0x40) // | Offset | Content | Content (Hex) | // |-----------|------------|--------------------------------------------------------------------| // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x60:0x7f | value of b | 0x<.............................................................b> | // | 0x80:0x9f | value of e | 0x<.............................................................e> | // | 0xa0:0xbf | value of m | 0x<.............................................................m> | mstore(ptr, 0x20) mstore(add(ptr, 0x20), 0x20) mstore(add(ptr, 0x40), 0x20) mstore(add(ptr, 0x60), b) mstore(add(ptr, 0x80), e) mstore(add(ptr, 0xa0), m) // Given the result < m, it's guaranteed to fit in 32 bytes, // so we can use the memory scratch space located at offset 0. success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20) result := mload(0x00) } } /** * @dev Variant of {modExp} that supports inputs of arbitrary length. */ function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) { (bool success, bytes memory result) = tryModExp(b, e, m); if (!success) { Panic.panic(Panic.DIVISION_BY_ZERO); } return result; } /** * @dev Variant of {tryModExp} that supports inputs of arbitrary length. */ function tryModExp( bytes memory b, bytes memory e, bytes memory m ) internal view returns (bool success, bytes memory result) { if (_zeroBytes(m)) return (false, new bytes(0)); uint256 mLen = m.length; // Encode call args in result and move the free memory pointer result = abi.encodePacked(b.length, e.length, mLen, b, e, m); assembly ("memory-safe") { let dataPtr := add(result, 0x20) // Write result on top of args to avoid allocating extra memory. success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen) // Overwrite the length. // result.length > returndatasize() is guaranteed because returndatasize() == m.length mstore(result, mLen) // Set the memory pointer after the returned data. mstore(0x40, add(dataPtr, mLen)) } } /** * @dev Returns whether the provided byte array is zero. */ function _zeroBytes(bytes memory byteArray) private pure returns (bool) { for (uint256 i = 0; i < byteArray.length; ++i) { if (byteArray[i] != 0) { return false; } } return true; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * This method is based on Newton's method for computing square roots; the algorithm is restricted to only * using integer operations. */ function sqrt(uint256 a) internal pure returns (uint256) { unchecked { // Take care of easy edge cases when a == 0 or a == 1 if (a <= 1) { return a; } // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between // the current value as `ε_n = | x_n - sqrt(a) |`. // // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is // bigger than any uint256. // // By noticing that // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)` // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar // to the msb function. uint256 aa = a; uint256 xn = 1; if (aa >= (1 << 128)) { aa >>= 128; xn <<= 64; } if (aa >= (1 << 64)) { aa >>= 64; xn <<= 32; } if (aa >= (1 << 32)) { aa >>= 32; xn <<= 16; } if (aa >= (1 << 16)) { aa >>= 16; xn <<= 8; } if (aa >= (1 << 8)) { aa >>= 8; xn <<= 4; } if (aa >= (1 << 4)) { aa >>= 4; xn <<= 2; } if (aa >= (1 << 2)) { xn <<= 1; } // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1). // // We can refine our estimation by noticing that the middle of that interval minimizes the error. // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2). // This is going to be our x_0 (and ε_0) xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2) // From here, Newton's method give us: // x_{n+1} = (x_n + a / x_n) / 2 // // One should note that: // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a // = ((x_n² + a) / (2 * x_n))² - a // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²) // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²) // = (x_n² - a)² / (2 * x_n)² // = ((x_n² - a) / (2 * x_n))² // ≥ 0 // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n // // This gives us the proof of quadratic convergence of the sequence: // ε_{n+1} = | x_{n+1} - sqrt(a) | // = | (x_n + a / x_n) / 2 - sqrt(a) | // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) | // = | (x_n - sqrt(a))² / (2 * x_n) | // = | ε_n² / (2 * x_n) | // = ε_n² / | (2 * x_n) | // // For the first iteration, we have a special case where x_0 is known: // ε_1 = ε_0² / | (2 * x_0) | // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2))) // ≤ 2**(2*e-4) / (3 * 2**(e-1)) // ≤ 2**(e-3) / 3 // ≤ 2**(e-3-log2(3)) // ≤ 2**(e-4.5) // // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n: // ε_{n+1} = ε_n² / | (2 * x_n) | // ≤ (2**(e-k))² / (2 * 2**(e-1)) // ≤ 2**(2*e-2*k) / 2**e // ≤ 2**(e-2*k) xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5 xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9 xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18 xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36 xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72 // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either // sqrt(a) or sqrt(a) + 1. return xn - SafeCast.toUint(xn > a / xn); } } /** * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; uint256 exp; unchecked { exp = 128 * SafeCast.toUint(value > (1 << 128) - 1); value >>= exp; result += exp; exp = 64 * SafeCast.toUint(value > (1 << 64) - 1); value >>= exp; result += exp; exp = 32 * SafeCast.toUint(value > (1 << 32) - 1); value >>= exp; result += exp; exp = 16 * SafeCast.toUint(value > (1 << 16) - 1); value >>= exp; result += exp; exp = 8 * SafeCast.toUint(value > (1 << 8) - 1); value >>= exp; result += exp; exp = 4 * SafeCast.toUint(value > (1 << 4) - 1); value >>= exp; result += exp; exp = 2 * SafeCast.toUint(value > (1 << 2) - 1); value >>= exp; result += exp; result += SafeCast.toUint(value > 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * 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; uint256 isGt; unchecked { isGt = SafeCast.toUint(value > (1 << 128) - 1); value >>= isGt * 128; result += isGt * 16; isGt = SafeCast.toUint(value > (1 << 64) - 1); value >>= isGt * 64; result += isGt * 8; isGt = SafeCast.toUint(value > (1 << 32) - 1); value >>= isGt * 32; result += isGt * 4; isGt = SafeCast.toUint(value > (1 << 16) - 1); value >>= isGt * 16; result += isGt * 2; result += SafeCast.toUint(value > (1 << 8) - 1); } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.20; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ```solidity * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position is the index of the value in the `values` array plus 1. // Position 0 is used to mean a value is not in the set. mapping(bytes32 value => uint256) _positions; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._positions[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We cache the value's position to prevent multiple reads from the same storage slot uint256 position = set._positions[value]; if (position != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 valueIndex = position - 1; uint256 lastIndex = set._values.length - 1; if (valueIndex != lastIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the lastValue to the index where the value to delete is set._values[valueIndex] = lastValue; // Update the tracked position of the lastValue (that was just moved) set._positions[lastValue] = position; } // Delete the slot where the moved value was stored set._values.pop(); // Delete the tracked position for the deleted slot delete set._positions[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._positions[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; assembly ("memory-safe") { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; assembly ("memory-safe") { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; assembly ("memory-safe") { result := store } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (access/extensions/IAccessControlEnumerable.sol) pragma solidity ^0.8.20; import {IAccessControl} from "../IAccessControl.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC-165 detection. */ interface IAccessControlEnumerable is IAccessControl { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/utils/Context.sol"; abstract contract OwnablePermissions is Context { function _requireCallerIsContractOwner() internal view virtual; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol) pragma solidity ^0.8.20; /** * @dev Helper library for emitting standardized panic codes. * * ```solidity * contract Example { * using Panic for uint256; * * // Use any of the declared internal constants * function foo() { Panic.GENERIC.panic(); } * * // Alternatively * function foo() { Panic.panic(Panic.GENERIC); } * } * ``` * * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil]. * * _Available since v5.1._ */ // slither-disable-next-line unused-state library Panic { /// @dev generic / unspecified error uint256 internal constant GENERIC = 0x00; /// @dev used by the assert() builtin uint256 internal constant ASSERT = 0x01; /// @dev arithmetic underflow or overflow uint256 internal constant UNDER_OVERFLOW = 0x11; /// @dev division or modulo by zero uint256 internal constant DIVISION_BY_ZERO = 0x12; /// @dev enum conversion error uint256 internal constant ENUM_CONVERSION_ERROR = 0x21; /// @dev invalid encoding in storage uint256 internal constant STORAGE_ENCODING_ERROR = 0x22; /// @dev empty array pop uint256 internal constant EMPTY_ARRAY_POP = 0x31; /// @dev array out of bounds access uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32; /// @dev resource error (too large allocation or too large array) uint256 internal constant RESOURCE_ERROR = 0x41; /// @dev calling invalid internal function uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51; /// @dev Reverts with a panic code. Recommended to use with /// the internal constants with predefined codes. function panic(uint256 code) internal pure { assembly ("memory-safe") { mstore(0x00, 0x4e487b71) mstore(0x20, code) revert(0x1c, 0x24) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (access/IAccessControl.sol) pragma solidity ^0.8.20; /** * @dev External interface of AccessControl declared to support ERC-165 detection. */ interface IAccessControl { /** * @dev The `account` is missing a role. */ error AccessControlUnauthorizedAccount(address account, bytes32 neededRole); /** * @dev The caller of a function is not the expected one. * * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}. */ error AccessControlBadConfirmation(); /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call. This account bears the admin role (for the granted role). * Expected in cases where the role was granted using the internal {AccessControl-_grantRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. */ function renounceRole(bytes32 role, address callerConfirmation) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[ERC]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; interface ITransferValidator { function applyCollectionTransferPolicy(address caller, address from, address to) external view; function validateTransfer(address caller, address from, address to) external view; function validateTransfer(address caller, address from, address to, uint256 tokenId) external view; function validateTransfer(address caller, address from, address to, uint256 tokenId, uint256 amount) external; function beforeAuthorizedTransfer(address operator, address token, uint256 tokenId) external; function afterAuthorizedTransfer(address token, uint256 tokenId) external; function beforeAuthorizedTransfer(address operator, address token) external; function afterAuthorizedTransfer(address token) external; function beforeAuthorizedTransfer(address token, uint256 tokenId) external; function beforeAuthorizedTransferWithAmount(address token, uint256 tokenId, uint256 amount) external; function afterAuthorizedTransferWithAmount(address token, uint256 tokenId) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/utils/Context.sol"; /** * @title TransferValidation * @author Limit Break, Inc. * @notice A mix-in that can be combined with ERC-721 contracts to provide more granular hooks. * Openzeppelin's ERC721 contract only provides hooks for before and after transfer. This allows * developers to validate or customize transfers within the context of a mint, a burn, or a transfer. */ abstract contract TransferValidation is Context { /// @dev Thrown when the from and to address are both the zero address. error ShouldNotMintToBurnAddress(); /*************************************************************************/ /* Transfers Without Amounts */ /*************************************************************************/ /// @dev Inheriting contracts should call this function in the _beforeTokenTransfer function to get more granular hooks. function _validateBeforeTransfer(address from, address to, uint256 tokenId) internal virtual { bool fromZeroAddress = from == address(0); bool toZeroAddress = to == address(0); if(fromZeroAddress && toZeroAddress) { revert ShouldNotMintToBurnAddress(); } else if(fromZeroAddress) { _preValidateMint(_msgSender(), to, tokenId, msg.value); } else if(toZeroAddress) { _preValidateBurn(_msgSender(), from, tokenId, msg.value); } else { _preValidateTransfer(_msgSender(), from, to, tokenId, msg.value); } } /// @dev Inheriting contracts should call this function in the _afterTokenTransfer function to get more granular hooks. function _validateAfterTransfer(address from, address to, uint256 tokenId) internal virtual { bool fromZeroAddress = from == address(0); bool toZeroAddress = to == address(0); if(fromZeroAddress && toZeroAddress) { revert ShouldNotMintToBurnAddress(); } else if(fromZeroAddress) { _postValidateMint(_msgSender(), to, tokenId, msg.value); } else if(toZeroAddress) { _postValidateBurn(_msgSender(), from, tokenId, msg.value); } else { _postValidateTransfer(_msgSender(), from, to, tokenId, msg.value); } } /// @dev Optional validation hook that fires before a mint function _preValidateMint(address caller, address to, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires after a mint function _postValidateMint(address caller, address to, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires before a burn function _preValidateBurn(address caller, address from, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires after a burn function _postValidateBurn(address caller, address from, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires before a transfer function _preValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 value) internal virtual {} /// @dev Optional validation hook that fires after a transfer function _postValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 value) internal virtual {} /*************************************************************************/ /* Transfers With Amounts */ /*************************************************************************/ /// @dev Inheriting contracts should call this function in the _beforeTokenTransfer function to get more granular hooks. function _validateBeforeTransfer(address from, address to, uint256 tokenId, uint256 amount) internal virtual { bool fromZeroAddress = from == address(0); bool toZeroAddress = to == address(0); if(fromZeroAddress && toZeroAddress) { revert ShouldNotMintToBurnAddress(); } else if(fromZeroAddress) { _preValidateMint(_msgSender(), to, tokenId, amount, msg.value); } else if(toZeroAddress) { _preValidateBurn(_msgSender(), from, tokenId, amount, msg.value); } else { _preValidateTransfer(_msgSender(), from, to, tokenId, amount, msg.value); } } /// @dev Inheriting contracts should call this function in the _afterTokenTransfer function to get more granular hooks. function _validateAfterTransfer(address from, address to, uint256 tokenId, uint256 amount) internal virtual { bool fromZeroAddress = from == address(0); bool toZeroAddress = to == address(0); if(fromZeroAddress && toZeroAddress) { revert ShouldNotMintToBurnAddress(); } else if(fromZeroAddress) { _postValidateMint(_msgSender(), to, tokenId, amount, msg.value); } else if(toZeroAddress) { _postValidateBurn(_msgSender(), from, tokenId, amount, msg.value); } else { _postValidateTransfer(_msgSender(), from, to, tokenId, amount, msg.value); } } /// @dev Optional validation hook that fires before a mint function _preValidateMint(address caller, address to, uint256 tokenId, uint256 amount, uint256 value) internal virtual {} /// @dev Optional validation hook that fires after a mint function _postValidateMint(address caller, address to, uint256 tokenId, uint256 amount, uint256 value) internal virtual {} /// @dev Optional validation hook that fires before a burn function _preValidateBurn(address caller, address from, uint256 tokenId, uint256 amount, uint256 value) internal virtual {} /// @dev Optional validation hook that fires after a burn function _postValidateBurn(address caller, address from, uint256 tokenId, uint256 amount, uint256 value) internal virtual {} /// @dev Optional validation hook that fires before a transfer function _preValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 amount, uint256 value) internal virtual {} /// @dev Optional validation hook that fires after a transfer function _postValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 amount, uint256 value) internal virtual {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; interface ITransferValidatorSetTokenType { function setTokenTypeOfCollection(address collection, uint16 tokenType) external; }
{ "optimizer": { "enabled": true, "mode": "3" }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "abi", "metadata" ], "": [ "ast" ] } }, "detectMissingLibraries": false, "forceEVMLA": false, "enableEraVMExtensions": false, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"initialOwner_","type":"address"},{"internalType":"address","name":"royaltyReceiver_","type":"address"},{"internalType":"uint96","name":"feeNumerator_","type":"uint96"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"BatchAmountMismatch","type":"error"},{"inputs":[],"name":"CreatorTokenBase__InvalidTransferValidatorContract","type":"error"},{"inputs":[{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidDefaultRoyalty","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidDefaultRoyaltyReceiver","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidTokenRoyalty","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidTokenRoyaltyReceiver","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NotCompatibleWithSpotMints","type":"error"},{"inputs":[],"name":"NotTokenOwner","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"SequentialMintExceedsLimit","type":"error"},{"inputs":[],"name":"SequentialUpToTooSmall","type":"error"},{"inputs":[],"name":"ShouldNotMintToBurnAddress","type":"error"},{"inputs":[],"name":"SpotMintTokenIdTooSmall","type":"error"},{"inputs":[],"name":"TokenAlreadyExists","type":"error"},{"inputs":[],"name":"TokenDoesNotExist","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"autoApproved","type":"bool"}],"name":"AutomaticApprovalOfTransferValidatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"DefaultRoyaltySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"TokenRoyaltySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldValidator","type":"address"},{"indexed":false,"internalType":"address","name":"newValidator","type":"address"}],"name":"TransferValidatorUpdated","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_TRANSFER_VALIDATOR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"autoApproveTransfersFromValidator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"batchBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tos","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"batchMintTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership","name":"ownership","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMembers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTransferValidationFunction","outputs":[{"internalType":"bytes4","name":"functionSignature","type":"bytes4"},{"internalType":"bool","name":"isViewFunction","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getTransferValidator","outputs":[{"internalType":"address","name":"validator","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"isApproved","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"autoApprove","type":"bool"}],"name":"setAutomaticApprovalOfTransfersFromValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"contractURI_","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"transferValidator_","type":"address"}],"name":"setTransferValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
9c4d535b000000000000000000000000000000000000000000000000000000000000000001000705fc92d2958aab601cdeb154ddc573695ade92621eb5fa72f49d40c6520000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000006000000000000000000000000017a45f80efd20594afe2c59d7e1ae7ab0c6954cc00000000000000000000000035c27582988082d04c504a8017314ff8fdba7bcd00000000000000000000000000000000000000000000000000000000000001f4
Deployed Bytecode
0x0003000000000002000900000000000200020000000103550000006003100270000006390030019d0000008004000039000000400040043f000006390330019700000001002001900000003b0000c13d000000040030008c000000650000413d000000000201043b000000e0022002700000066a0020009c000000670000a13d0000066b0020009c000000f50000a13d0000066c0020009c000001c80000a13d0000066d0020009c000003240000a13d0000066e0020009c000003c60000213d000006710020009c0000055f0000613d000006720020009c000000650000c13d0000000001000416000000000001004b000000650000c13d0000001003000039000000000203041a000000010420019000000001012002700000007f0110618f0000001f0010008c00000000050000390000000105002039000000000552013f0000000100500190000007d30000c13d000000800010043f000000000004004b000008bc0000613d000000000030043f000000000001004b0000000002000019000008c10000613d00000663030000410000000002000019000000000403041a000000a005200039000000000045043500000001033000390000002002200039000000000012004b000000330000413d000008c10000013d0000000002000416000000000002004b000000650000c13d0000001f023000390000063a022001970000008002200039000000400020043f0000001f0530018f0000063b0630019800000080026000390000004b0000613d000000000701034f000000007807043c0000000004840436000000000024004b000000470000c13d000000000005004b000000580000613d000000000161034f0000000304500210000000000502043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f0000000000120435000000600030008c000000650000413d000000800100043d0000063c0010009c000000650000213d000000a00200043d000900000002001d0000063c0020009c000000650000213d000000c00200043d000800000002001d0000063d0020009c000002560000a13d0000000001000019000018e1000104300000068c0020009c000000da0000213d0000069c0020009c000001130000213d000006a40020009c000002a20000213d000006a80020009c000006790000613d000006a90020009c000003e00000613d000006aa0020009c000000650000c13d000000440030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000402100370000000000202043b000006430020009c000000650000213d0000002304200039000000000034004b000000650000813d0000000404200039000000000441034f000000000404043b000600000004001d000006430040009c000000650000213d000500240020003d000000060200002900000005022002100000000502200029000000000032004b000000650000213d0000002402100370000000000202043b000006430020009c000000650000213d0000002304200039000000000034004b000000650000813d0000000404200039000000000141034f000000000101043b000900000001001d000006430010009c000000650000213d000400240020003d000000090100002900000005011002100000000401100029000000000031004b000000650000213d00000000010004110000063c01100197000000000010043f000006d601000041000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000ff00100190000002f00000613d0000000902000029000000060020006b00000e5d0000c13d000000060000006b000009610000613d000900000000001d00000009010000290000000502100210000800050020002d00000002030003670000000801300360000000000101043b0000063c0010009c000000650000213d000700040020002d0000000702300360000000000202043b18df16200000040f00000002010003670000000802100360000000000502043b0000063c0050009c000000650000213d0000000701100360000000000601043b0000000001000414000006390010009c0000063901008041000000c0011002100000064b011001c70000800d020000390000000303000039000006d70400004118df18d50000040f0000000100200190000000650000613d00000009020000290000000102200039000900000002001d000000060020006c000000b60000413d000009610000013d0000068d0020009c000001240000213d000006950020009c000002cb0000213d000006990020009c000006800000613d0000069a0020009c000003f40000613d0000069b0020009c000000650000c13d000000440030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000002402100370000000000302043b0000063c0030009c000000650000213d0000000002000411000000000023004b000008dc0000c13d0000000401100370000000000101043b18df17c00000040f0000000001000019000018e00001042e0000067d0020009c000001f10000213d000006850020009c000003600000213d000006890020009c000006af0000613d0000068a0020009c000006c40000613d0000068b0020009c000000650000c13d000000240030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000401100370000000000101043b0000063c0010009c000000650000213d000000000200041a000000000002004b000008d20000613d00040001002000940000093f0000c13d000000800300003900000060020000390000000001030019000900000003001d18df11260000040f000008c80000013d0000069d0020009c000002fe0000213d000006a10020009c000006cb0000613d000006a20020009c000004340000613d000006a30020009c000000650000c13d0000000001000416000000000001004b000000650000c13d000006dd01000041000000800010043f0000000101000039000000a00010043f000006de01000041000018e00001042e0000068e0020009c000003130000213d000006920020009c000006da0000613d000006930020009c0000043b0000613d000006940020009c000000650000c13d000000240030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000402100370000000000202043b000006430020009c000000650000213d0000002304200039000000000034004b000000650000813d000800040020003d0000000804100360000000000504043b000006430050009c000000650000213d000000050450021000000000024200190000002402200039000000000032004b000000650000213d000000800050043f000000a002400039000000400020043f000000000005004b0000016e0000c13d00000020010000390000000001120436000000800300043d00000000003104350000004001200039000000000003004b000008c90000613d000000800400003900000000050000190000002004400039000000000604043300000000870604340000063c07700197000000000771043600000000080804330000064308800197000000000087043500000040076000390000000007070433000000000007004b0000000007000039000000010700c0390000004008100039000000000078043500000060066000390000000006060433000006d1066001970000006007100039000000000067043500000080011000390000000105500039000000000035004b000001500000413d000008c90000013d000000200460008c00000080036000390000000000230435000000400200043d000001470000613d00000000060400190000000803400029000000000331034f000000000403043b000006cb0020009c00000b5f0000213d0000008003200039000000400030043f0000006003200039000000000003043500000040032000390000000000030435000000200320003900000000000304350000000000020435000000000004004b000001690000613d000000000300041a000000000043004b000001690000a13d000700000006001d000900000004001d000000000040043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000000001004b000001970000c13d0000000904000029000000010440008a000001830000013d000000400100043d000006cb0010009c000000090300002900000b5f0000213d0000008002100039000000400020043f0000006002100039000000000002043500000040021000390000000000020435000000200210003900000000000204350000000000010435000000000030043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000400200043d000006cb0020009c000000070600002900000b5f0000213d000000000301034f0000000201000367000000000303043b000000000303041a0000008004200039000000400040043f0000006004200039000000e8053002700000000000540435000006ae003001980000000004000039000000010400c039000000400520003900000000004504350000063c043001970000000004420436000000a00330027000000643033001970000000000340435000001690000013d000006760020009c000003490000213d0000067a0020009c0000074c0000613d0000067b0020009c000004690000613d0000067c0020009c000000650000c13d000000840030008c000000650000413d0000000402100370000000000202043b000900000002001d0000063c0020009c000000650000213d0000002402100370000000000202043b000800000002001d0000063c0020009c000000650000213d0000006402100370000000000402043b000006430040009c000000650000213d0000002302400039000000000032004b000000650000813d0000000402400039000000000121034f000000000201043b000000240140003918df10db0000040f00000044020000390000000202200367000000000302043b00000000040100190000000901000029000000080200002918df12f80000040f0000000001000019000018e00001042e0000067e0020009c0000037d0000213d000006820020009c000007760000613d000006830020009c000007c50000613d000006840020009c000000650000c13d000000640030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000402100370000000000202043b000500000002001d0000063c0020009c000000650000213d0000004402100370000000000202043b0000002401100370000000000301043b000000000023004b000008d20000813d000000000100041a000000000012004b0000000002018019000400000002001d000000010030008c000000010300a0390000000501000029000000000001004b000009410000613d000800000003001d000000000010043f0000000501000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000200600000003d000000000101043b0000000803000029000000040230006b00000edd0000a13d000000000101041a000006430110019800000edd0000613d000000000012004b0000000002018019000300000002001d0000000501200210000000400200043d000200000002001d00000000012100190000002001100039000000400010043f000700000001001d000006cb0010009c00000b5f0000213d00000007020000290000008001200039000000400010043f0000006001200039000000000001043500000040012000390000000000010435000000200120003900000000000104350000000000020435000000000100041a000000000031004b000000000100001900000c9a0000a13d0000000801000029000900000001001d000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000000001004b00000df10000c13d0000000901000029000000010110008a000002420000013d000000400500043d0000063e0050009c00000b5f0000813d0000004002500039000000400020043f000000100200003900000000082504360000063f020000410000000000280435000000400300043d000006400030009c00000b5f0000213d0000004002300039000000400020043f0000000302000039000000000423043600000641060000410000000000640435000000400e00043d0000064000e0009c00000b5f0000213d0000004006e00039000000400060043f0000001606000039000000000f6e0436000006420700004100000000007f0435000000400c00043d0000064000c0009c00000b5f0000213d0000004009c00039000000400090043f000000000d6c043600000000007d04350000000007050433000006430070009c00000b5f0000213d0000000206000039000000000906041a000000010a90019000000001099002700000007f0990618f0000001f0090008c000000000b000039000000010b0020390000000000ba004b000007d30000c13d000000200090008c000002960000413d000000000060043f0000001f0a700039000000050aa00270000006440aa0009a000000200070008c000006450a0040410000001f099000390000000509900270000006440990009a00000000009a004b000002960000813d00000000000a041b000000010aa0003900000000009a004b000002920000413d0000001f0070008c00000a7c0000a13d00070000000f001d000000000f0e0019000000000e0d0019000000000d0c0019000000000060043f000006f20a70019800000b3f0000c13d0000002009000039000006450800004100000b4b0000013d000006a50020009c000007d90000613d000006a60020009c0000048f0000613d000006a70020009c000000650000c13d000000240030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000401100370000000000201043b000000000002004b00000a1b0000613d000000000100041a000000000021004b00000a1b0000a13d000800000002001d000900000002001d000000000020043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000000001004b00000a0f0000c13d0000000902000029000000000002004b000000010220008a000002b50000c13d000008d60000013d000006960020009c000008030000613d000006970020009c000004ae0000613d000006980020009c000000650000c13d000000440030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000402100370000000000202043b000900000002001d0000063c0020009c000000650000213d0000002401100370000000000101043b000800000001001d00000000010004110000063c01100197000000000010043f000006d601000041000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000ff00100190000009450000c13d000000400100043d000000240210003900000656030000410000000000320435000006cd020000410000000000210435000000040210003900000000030004110000000000320435000006390010009c0000063901008041000000400110021000000653011001c7000018e1000104300000069e0020009c000008130000613d0000069f0020009c000005110000613d000006a00020009c000000650000c13d000000240030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000401100370000000000101043b000000000010043f0000000a01000039000000200010043f0000004002000039000000000100001918df18c00000040f00000001011000390000035c0000013d0000068f0020009c0000081e0000613d000006900020009c000005160000613d000006910020009c000000650000c13d000000240030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000401100370000000000101043b0000063c0010009c000000650000213d18df12e00000040f0000089f0000013d000006730020009c000008290000613d000006740020009c000005200000613d000006750020009c000000650000c13d0000000001000416000000000001004b000000650000c13d0000000f03000039000000000203041a000000010420019000000001012002700000007f0110618f0000001f0010008c00000000050000390000000105002039000000000552013f0000000100500190000007d30000c13d000000800010043f000000000004004b000008bc0000613d000000000030043f000000000001004b0000000002000019000008c10000613d00000660030000410000000002000019000000000403041a000000a005200039000000000045043500000001033000390000002002200039000000000012004b000003410000413d000008c10000013d000006770020009c000008300000613d000006780020009c0000053b0000613d000006790020009c000000650000c13d000000240030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000401100370000000000101043b000000000010043f0000000b01000039000000200010043f0000004002000039000000000100001918df18c00000040f000000000101041a000000800010043f000006b601000041000018e00001042e000006860020009c000008410000613d000006870020009c0000084a0000613d000006880020009c000000650000c13d000000440030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000002402100370000000000202043b000900000002001d0000063c0020009c000000650000213d0000000401100370000000000101043b000000000010043f0000000a01000039000000200010043f0000004002000039000000000100001918df18c00000040f000000090200002918df113f0000040f000000000101041a000000ff001001900000089d0000013d0000067f0020009c000008630000613d000006800020009c000008870000613d000006810020009c000000650000c13d000000440030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000402100370000000000202043b000900000002001d0000063c0020009c000000650000213d0000002401100370000000000201043b000000000002004b0000000001000039000000010100c039000800000002001d000000000012004b000000650000c13d0000000001000411000000000010043f0000000701000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b0000000902000029000000000020043f000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000201041a000006f3022001970000000803000029000000000232019f000000000021041b000000400100043d0000000000310435000006390010009c000006390100804100000040011002100000000002000414000006390020009c0000063902008041000000c002200210000000000112019f00000654011001c70000800d020000390000000303000039000006c604000041000000000500041100000009060000290000095e0000013d0000066f0020009c0000088d0000613d000006700020009c000000650000c13d000000240030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000401100370000000000601043b0000063c0060009c000000650000213d0000000901000039000000000201041a0000063c032001970000000005000411000000000053004b000008a60000c13d000000000006004b000009530000c13d0000066901000041000000800010043f000000840000043f000006ac01000041000018e100010430000000240030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000401100370000000000201043b000006e500200198000000650000c13d0000000101000039000006e602200197000006e70020009c000008e00000213d000006ed0020009c000009630000213d000006f00020009c000009a10000613d000006f10020009c000009a10000613d0000099a0000013d000000440030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000402100370000000000202043b000900000002001d0000002401100370000000000101043b000800000001001d0000063c0010009c000000650000213d0000000901000029000000000010043f0000000a01000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b0000000101100039000000000101041a000700000001001d000000000010043f0000000a01000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d0000000002000411000000000101043b0000063c02200197000000000020043f000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000ff0010019000000a8f0000c13d000000400100043d00000024021000390000000703000029000002f30000013d0000000001000416000000000001004b000000650000c13d18df11350000040f000000800010043f000006b601000041000018e00001042e000000640030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000402100370000000000202043b000900000002001d0000002402100370000000000202043b000800000002001d0000063c0020009c000000650000213d0000004401100370000000000101043b000700000001001d0000063d0010009c000000650000213d00000000010004110000063c01100197000000000010043f000006cc01000041000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000400300043d000000000101043b000000000101041a000000ff0010019000000a590000c13d000000240130003900000659020000410000000000210435000006cd01000041000000000013043500000004013000390000000002000411000000000021043500000b2f0000013d000000240030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000401100370000000000101043b000900000001001d0000063c0010009c000000650000213d0000000901000039000000000101041a0000063c021001970000000001000411000000000012004b000008e70000c13d00000650010000410000000000100443000000090100002900000004001004430000000001000414000006390010009c0000063901008041000000c00110021000000651011001c7000080020200003918df18da0000040f000000010020019000000f410000613d0000000904000029000000000004004b000009a50000613d000000000101043b000000000001004b000009a50000c13d000000400100043d000006c30200004100000a890000013d0000000001000416000000000001004b000000650000c13d0000000203000039000000000203041a000000010420019000000001012002700000007f0110618f0000001f0010008c00000000050000390000000105002039000000000552013f0000000100500190000007d30000c13d000000800010043f000000000004004b000008bc0000613d000000000030043f000000000001004b0000000002000019000008c10000613d00000645030000410000000002000019000000000403041a000000a005200039000000000045043500000001033000390000002002200039000000000012004b000004a60000413d000008c10000013d000000240030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000401100370000000000101043b000000000001004b000006d60000613d000800000001001d000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000000001004b000004df0000c13d000000000100041a0000000802000029000000000021004b000006d60000a13d000000010220008a000900000002001d000000000020043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000000001004b0000000902000029000004cc0000613d000006ae001001980000000802000029000006d60000c13d0000063c011001970000000003000411000000000031004b00000a870000c13d000000000020043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000900000001001d000000000001004b00000c830000c13d000000000100041a0000000802000029000000000021004b000006d60000a13d000900000002001d0000000901000029000000010110008a000900000001001d000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000000001004b000004fc0000613d000900000001001d00000c840000013d000000000103001918df10ac0000040f18df114f0000040f0000000001000019000018e00001042e000000240030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000401100370000000000101043b18df178c0000040f0000063c011001970000089f0000013d000000440030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000002402100370000000000202043b000900000002001d0000063c0020009c000000650000213d0000000401100370000000000101043b000800000001001d000000000010043f0000000a01000039000000200010043f0000004002000039000000000100001918df18c00000040f0000000101100039000000000101041a18df15ef0000040f0000000801000029000000090200002918df17c00000040f0000000001000019000018e00001042e000000240030008c000000650000413d0000000002000416000000000002004b000000650000c13d00000080030000390000000401100370000000000201043b000000000002004b00000a3e0000613d000000000100041a000000000021004b00000a3e0000a13d000800000002001d000900000002001d000000000020043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000000001004b00000a1f0000c13d0000000902000029000000000002004b000000010220008a000005490000c13d000008d60000013d000000240030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000402100370000000000202043b000006430020009c000000650000213d0000002304200039000000000034004b000000650000813d0000000404200039000000000141034f000000000101043b000300000001001d000006430010009c000000650000213d000200240020003d000000030100002900000005011002100000000201100029000000000031004b000000650000213d000000030000006b000009610000613d000700000000001d000000070100002900000005011002100000000201100029000600000001001d0000000201100367000000000101043b000000000001004b000006d60000613d000900000001001d000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000000001004b000005aa0000c13d000000000100041a0000000902000029000000000021004b000006d60000a13d000000010220008a000900000002001d000000000020043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000000001004b0000000902000029000005970000613d000006ae00100198000006d60000c13d0000063c011001970000000002000411000000000021004b00000a870000c13d00000006010000290000000201100367000000000101043b000800000001001d000000000001004b000006d60000613d0000000801000029000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000000001004b000005de0000c13d000000000100041a0000000802000029000000000021004b000006d60000a13d000000010220008a000900000002001d000000000020043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000000001004b0000000902000029000005cb0000613d000006ae00100198000006d60000c13d000900000001001d0000000801000029000000000010043f0000000601000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d00000009020000290000063c03200198000000000101043b00000c970000613d000000000201041a000000000002004b000005f60000613d000000000001041b000500000003001d000000000030043f0000000501000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000201041a000006af0220009a000000000021041b000006b00100004100000000001004430000000001000414000006390010009c0000063901008041000000c001100210000006b1011001c70000800b0200003918df18da0000040f000000010020019000000f410000613d000000000101043b000400000001001d0000000801000029000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d0000000402000029000000a0022002100000000505000029000000000252019f000006b2022001c7000000000101043b000000000021041b0000000901000029000006b300100198000006530000c13d00000008010000290000000101100039000400000001001d000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000000001004b0000000505000029000006530000c13d000000000100041a000000040010006b000006530000613d0000000401000029000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b0000000902000029000000000021041b00000005050000290000000001000414000006390010009c0000063901008041000000c0011002100000064b011001c70000800d020000390000000403000039000006b4040000410000000006000019000000080700002918df18d50000040f0000000100200190000000650000613d0000000102000039000000000102041a0000000101100039000000000012041b00000006010000290000000201100367000000000601043b0000000001000414000006390010009c0000063901008041000000c0011002100000064b011001c70000800d020000390000000303000039000006b504000041000000000500041118df18d50000040f0000000100200190000000650000613d00000007020000290000000102200039000700000002001d000000030020006c0000057a0000413d000009610000013d0000000001000416000000000001004b000000650000c13d0000064d01000041000000800010043f000006b601000041000018e00001042e000000440030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000002402100370000000000202043b000900000002001d0000000401100370000000000101043b000000000010043f0000000e01000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000201041a0000063c012001980000069d0000c13d0000000d01000039000000000201041a0000063c01200197000000a003200270000000090400002900000000024300a9000000000004004b000006a50000613d00000000044200d9000000000043004b000008d60000c13d000027100220011a000000400300043d000000200430003900000000002404350000000000130435000006390030009c00000639030080410000004001300210000006dc011001c7000018e00001042e0000000001000416000000000001004b000000650000c13d0000000901000039000000000201041a0000063c032001970000000005000411000000000053004b000008a60000c13d0000064a02200197000000000021041b0000000001000414000006390010009c0000063901008041000000c0011002100000064b011001c70000800d0200003900000003030000390000064c0400004100000000060000190000095e0000013d0000000001000416000000000001004b000000650000c13d0000065901000041000000800010043f000006b601000041000018e00001042e000000440030008c000000650000413d0000000402100370000000000202043b000800000002001d0000063c0020009c000000650000213d0000002401100370000000000101043b000000000001004b000008ec0000c13d000006e101000041000000000010043f000006c101000041000018e100010430000000240030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000402100370000000000402043b000006430040009c000000650000213d0000002302400039000000000032004b000000650000813d0000000405400039000000000251034f000000000202043b000006430020009c00000b5f0000213d0000001f06200039000006f2066001970000003f06600039000006f206600197000006cb0060009c00000b5f0000213d00000024044000390000008006600039000000400060043f000000800020043f0000000004420019000000000034004b000000650000213d0000002003500039000000000331034f000006f2042001980000001f0520018f000000a001400039000007040000613d000000a006000039000000000703034f000000007807043c0000000006860436000000000016004b000007000000c13d000000000005004b000007110000613d000000000343034f0000000304500210000000000501043300000000054501cf000000000545022f000000000303043b0000010004400089000000000343022f00000000034301cf000000000353019f0000000000310435000000a001200039000000000001043500000000010004110000063c01100197000000000010043f000006cc01000041000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000ff00100190000007c10000613d000000800200043d000006430020009c00000b5f0000213d0000000f01000039000000000401041a000000010040019000000001034002700000007f0330618f0000001f0030008c00000000050000390000000105002039000000000454013f0000000100400190000007d30000c13d000000200030008c000007440000413d000000000010043f0000001f0420003900000005044002700000065f0440009a000000200020008c00000660040040410000001f0330003900000005033002700000065f0330009a000000000034004b000007440000813d000000000004041b0000000104400039000000000034004b000007400000413d0000001f0020008c00000e220000a13d000000000010043f000006f20420019800000ee10000c13d000000a005000039000006600300004100000efd0000013d000000240030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000401100370000000000101043b000000000010043f0000000b01000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000301041a000000400200043d000800000002001d000900000003001d0000000002320436000700000002001d000000000010043f0000000001000414000006390010009c0000063901008041000000c00110021000000654011001c7000080100200003918df18da0000040f0000000100200190000000650000613d0000000905000029000000000005004b000009680000c13d00000008060000290000000704000029000009720000013d000000240030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000402100370000000000402043b000006430040009c000000650000213d0000002302400039000000000032004b000000650000813d0000000405400039000000000251034f000000000202043b000006430020009c00000b5f0000213d0000001f06200039000006f2066001970000003f06600039000006f206600197000006cb0060009c00000b5f0000213d00000024044000390000008006600039000000400060043f000000800020043f0000000004420019000000000034004b000000650000213d0000002003500039000000000331034f000006f2042001980000001f0520018f000000a001400039000007a00000613d000000a006000039000000000703034f000000007807043c0000000006860436000000000016004b0000079c0000c13d000000000005004b000007ad0000613d000000000343034f0000000304500210000000000501043300000000054501cf000000000545022f000000000303043b0000010004400089000000000343022f00000000034301cf000000000353019f0000000000310435000000a001200039000000000001043500000000010004110000063c01100197000000000010043f000006cc01000041000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000ff0010019000000beb0000c13d000000400100043d00000024021000390000065903000041000002f30000013d0000000001000416000000000001004b000000650000c13d0000000303000039000000000203041a000000010420019000000001012002700000007f0110618f0000001f0010008c00000000050000390000000105002039000000000552013f0000000100500190000008ab0000613d000006e201000041000000000010043f0000002201000039000000040010043f0000066701000041000018e100010430000000440030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000402100370000000000202043b000900000002001d0000063c0020009c000000650000213d0000002401100370000000000101043b000800000001001d0000063d0010009c000000650000213d00000000010004110000063c01100197000000000010043f000006cc01000041000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000400200043d000000000101043b000000000101041a000000ff0010019000000a6c0000c13d000000240120003900000659030000410000000000310435000006cd0100004100000000001204350000000401200039000000000300041100000a760000013d000000000103001918df10ac0000040f000900000001001d000800000002001d000700000003001d000000400100043d000600000001001d18df10be0000040f0000000604000029000000000004043500000009010000290000000802000029000000070300002918df12f80000040f0000000001000019000018e00001042e0000000001000416000000000001004b000000650000c13d0000000101000039000000000101041a000006f401100167000000000200041a0000000001120019000000800010043f000006b601000041000018e00001042e0000000001000416000000000001004b000000650000c13d0000000c01000039000000000101041a000006d0001001980000000001000039000000010100c039000000800010043f000006b601000041000018e00001042e0000000001000416000000000001004b000000650000c13d0000065601000041000000800010043f000006b601000041000018e00001042e000000240030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000401100370000000000101043b18df154e0000040f000000400200043d000900000002001d18df11130000040f0000000901000029000006390010009c00000639010080410000004001100210000006c2011001c7000018e00001042e0000000001000416000000000001004b000000650000c13d0000000901000039000000000101041a0000063c01100197000000800010043f000006b601000041000018e00001042e000000440030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000402100370000000000202043b000000000020043f0000000b02000039000000200020043f0000002401100370000000000101043b000900000001001d0000004002000039000000000100001918df18c00000040f000000090200002918df18a40000040f0000000302200210000000000101041a000000000121022f0000063c01100197000000ff0020008c00000000010020190000089f0000013d000000240030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000401100370000000000101043b000000000001004b0000000002000039000000010200c039000000000021004b000000650000c13d0000000902000039000000000202041a0000063c032001970000000002000411000000000023004b0000093a0000c13d0000000c02000039000000000302041a000006c703300197000000000001004b0000000004000019000006c80400c041000000000343019f000000000032041b000000800010043f0000000001000414000006390010009c0000063901008041000000c001100210000006c9011001c70000800d020000390000000103000039000006ca040000410000095e0000013d0000000001000416000000000001004b000000650000c13d000000800000043f000006b601000041000018e00001042e000000440030008c000000650000413d0000000002000416000000000002004b000000650000c13d0000000402100370000000000302043b0000063c0030009c000000650000213d0000002401100370000000000201043b0000063c0020009c000000650000213d000000000103001918df15ba0000040f000000000001004b0000000001000039000000010100c039000000400200043d0000000000120435000006390020009c00000639020080410000004001200210000006ad011001c7000018e00001042e000006ab01000041000000800010043f000000840050043f000006ac01000041000018e100010430000000800010043f000000000004004b000008bc0000613d000000000030043f000000000001004b0000000002000019000008c10000613d00000648030000410000000002000019000000000403041a000000a005200039000000000045043500000001033000390000002002200039000000000012004b000008b40000413d000008c10000013d000006f302200197000000a00020043f000000000001004b000000200200003900000000020060390000002002200039000000800100003918df10c90000040f000000400100043d000900000001001d000000800200003918df10970000040f00000009020000290000000001210049000006390010009c00000639010080410000006001100210000006390020009c00000639020080410000004002200210000000000121019f000018e00001042e000006ce01000041000000000010043f000006c101000041000018e100010430000006e201000041000000000010043f0000001101000039000000040010043f0000066701000041000018e100010430000006da01000041000000800010043f000006db01000041000018e100010430000006e80020009c000009960000213d000006eb0020009c000009a10000613d000006ec0020009c000009a10000613d0000099a0000013d000006ab02000041000000800020043f000000840010043f000006ac01000041000018e100010430000700000001001d000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000000001004b000009150000c13d000000000100041a0000000702000029000000000021004b000006d60000a13d000900000002001d0000000901000029000000010110008a000900000001001d000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000000001004b000009020000613d000006ae00100198000006d60000c13d0009063c0010019b0000000002000411000000090020006c00000bbb0000c13d0000000701000029000000000010043f0000000601000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d00000008020000290000063c06200197000000000101043b000000000201041a0000064a02200197000000000262019f000000000021041b0000000001000414000006390010009c0000063901008041000000c0011002100000064b011001c70000800d020000390000000403000039000006e004000041000000090500002900000007070000290000095e0000013d000006ab01000041000000800010043f000000840020043f000006ac01000041000018e100010430000000000001004b00000a450000c13d000006cf01000041000000000010043f000006c101000041000018e1000104300000000901000029000000080200002918df16200000040f0000000001000414000006390010009c0000063901008041000000c0011002100000064b011001c70000800d020000390000000303000039000006d704000041000000090500002900000008060000290000095e0000013d0000064a02200197000000000262019f000000000021041b0000000001000414000006390010009c0000063901008041000000c0011002100000064b011001c70000800d0200003900000003030000390000064c0400004118df18d50000040f0000000100200190000000650000613d0000000001000019000018e00001042e000006ee0020009c000009a10000613d000006ef0020009c000009a10000613d0000099a0000013d000000000101043b000000000200001900000008060000290000000704000029000000000301041a000000000434043600000001011000390000000102200039000000000052004b0000096c0000413d00000000016400490000001f01100039000006f2021001970000000001620019000000000021004b00000000020000390000000102004039000006430010009c00000b5f0000213d000000010020019000000b5f0000c13d000000400010043f00000020020000390000000002210436000000000306043300000000003204350000004002100039000000000003004b0000098d0000613d0000000004000019000000200660003900000000050604330000063c0550019700000000025204360000000104400039000000000034004b000009860000413d0000000002120049000006390020009c00000639020080410000006002200210000006390010009c00000639010080410000004001100210000000000112019f000018e00001042e000006e90020009c000009a10000613d000006ea0020009c000009a10000613d000006f00020009c00000000010000390000000101006039000006eb0020009c00000001011061bf000006ee0020009c00000001011061bf000000010110018f000000800010043f000006b601000041000018e00001042e0000000c01000039000000000201041a00000008012002700000063c01100198000009ad0000c13d000000ff0020019000000000010000190000064d01006041000000400200043d000000200320003900000000004304350000000000120435000006390020009c000006390200804100000040012002100000000002000414000006390020009c0000063902008041000000c002200210000000000112019f0000064e011001c70000800d0200003900000001030000390000064f0400004118df18d50000040f0000000100200190000000650000613d0000000c04000039000000000104041a000006c40110019700000009030000290000000802300210000006c502200197000000000112019f00000001011001bf000000000014041b000000000003004b000009610000613d00000650010000410000000000100443000000090100002900000004001004430000000001000414000006390010009c0000063901008041000000c00110021000000651011001c7000080020200003918df18da0000040f000000010020019000000f410000613d000000000101043b000000000001004b000009610000613d00000650010000410000000000100443000000090100002900000004001004430000000001000414000006390010009c0000063901008041000000c00110021000000651011001c7000080020200003918df18da0000040f000000010020019000000f410000613d000000000101043b000000000001004b000000650000613d000000400300043d0000002401300039000002d102000039000000000021043500000652010000410000000000130435000800000003001d00000004013000390000000002000410000000000021043500000000010004140000000902000029000000040020008c00000a080000613d0000000802000029000006390020009c00000639020080410000004002200210000006390010009c0000063901008041000000c001100210000000000121019f00000653011001c7000000090200002918df18d50000040f0000006001100270000106390010019d0000000100200190000009610000613d0000000801000029000006430010009c00000b5f0000213d0000000801000029000000400010043f0000000001000019000018e00001042e000006ae00100198000000080100002900000a1b0000c13d000000000010043f0000000601000039000000200010043f0000004002000039000000000100001918df18c00000040f000000000101041a0000063c011001970000089f0000013d000006e301000041000000000010043f000006c101000041000018e100010430000000400300043d000006ae0010019800000a3e0000c13d0000000f05000039000000000405041a000000010640019000000001014002700000007f0110618f0000001f0010008c00000000020000390000000102002039000000000224013f0000000100200190000007d30000c13d0000000002130436000000000006004b00000c6a0000613d000000000050043f000000000001004b000000000400001900000c6f0000613d000006600500004100000000040000190000000006420019000000000705041a000000000076043500000001055000390000002004400039000000000014004b00000a360000413d00000c6f0000013d000006c0010000410000000000130435000006390030009c00000639030080410000004001300210000006c1011001c7000018e100010430000700000002001d000000000010043f0000000501000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000400300043d000000000101043b000000000101041a000006430110019800000b8c0000c13d00000060020000390000010f0000013d0000000701000029000027110010008c00000b260000413d000000440130003900002710020000390000000000210435000000240130003900000007020000290000000000210435000006d4010000410000000000130435000000040130003900000009020000290000000000210435000006390030009c00000639030080410000004001300210000006d5011001c7000018e1000104300000000801000029000027110010008c00000b340000413d00000024012000390000271003000039000000000031043500000668010000410000000000120435000000040120003900000008030000290000000000310435000006390020009c0000063902008041000000400120021000000653011001c7000018e100010430000000000007004b000000000500001900000b5b0000613d0000000305700210000006f40550027f000006f4055001670000000008080433000000000558016f0000000107700210000000000575019f00000b5b0000013d000000400100043d000006d8020000410000000000210435000006390010009c00000639010080410000004001100210000006c1011001c7000018e1000104300000000901000029000000000010043f0000000a01000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b0000000802000029000000000020043f000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000ff00100190000009610000c13d0000000901000029000000000010043f0000000a01000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b0000000802000029000000000020043f000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000201041a000006f30220019700000001022001bf000000000021041b0000000001000414000006390010009c0000063901008041000000c0011002100000064b011001c70000800d0200003900000004030000390000065c0400004100000009050000290000000806000029000000000700041118df18d50000040f0000000100200190000000650000613d0000000901000029000000000010043f0000000b01000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000201043b0000000801000029000000000010043f000900000002001d0000000101200039000700000001001d000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000000001004b000009610000c13d0000000901000029000000000101041a000600000001001d000006430010009c00000b5f0000213d000000060100002900000001011000390000000902000029000000000012041b000000000020043f0000000001000414000006390010009c0000063901008041000000c00110021000000654011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b00000006011000290000000802000029000000000021041b0000000901000029000000000101041a000900000001001d000000000020043f0000000701000029000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b0000000902000029000000000021041b0000000001000019000018e00001042e000000080000006b00000c120000c13d000006d301000041000000000013043500000004013000390000000902000029000000000021043500000024013000390000000000010435000006390030009c0000063903008041000000400130021000000653011001c7000018e100010430000000090000006b00000c430000c13d0000066601000041000000000012043500000004012000390000000000010435000006390020009c0000063902008041000000400120021000000667011001c7000018e10001043000000645080000410000002009000039000000010ba0008a000000050bb00270000006460bb0009a000000000c590019000000000c0c04330000000000c8041b000000200990003900000001088000390000000000b8004b00000b440000c13d00000000007a004b00000b550000813d000000030a700210000000f80aa0018f000006f40aa0027f000006f40aa00167000000000559001900000000050504330000000005a5016f000000000058041b000000010570021000000001055001bf000000000c0d0019000000000d0e0019000000000e0f0019000000070f000029000000000056041b0000000005030433000006430050009c00000b650000a13d000006e201000041000000000010043f0000004101000039000000040010043f0000066701000041000018e100010430000000000702041a000000010070019000000001067002700000007f0660618f0000001f0060008c00000000080000390000000108002039000000000787013f0000000100700190000007d30000c13d00070000000f001d00050000000e001d00030000000d001d00040000000c001d000000200060008c00000b840000413d000000000020043f0000001f075000390000000507700270000006470770009a000000200050008c00000648070040410000001f066000390000000506600270000006470660009a000000000067004b00000b840000813d000000000007041b0000000107700039000000000067004b00000b800000413d000000200050008c00000c5f0000413d000000000020043f000006f20750019800000ce70000c13d0000002006000039000006480400004100000cf30000013d000000040010006b00000000020100190000000402004029000400000002001d0000000501200210000300000003001d00000000011300190000002001100039000000400010043f000600000001001d000006cb0010009c00000b5f0000213d00000006020000290000008001200039000000400010043f0000006001200039000000000001043500000040012000390000000000010435000000200120003900000000000104350000000000020435000000000100041a000000020010008c000000000100001900000d520000413d0000000101000039000900000001001d000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000000001004b00000e2c0000c13d0000000901000029000000010110008a00000ba70000013d0000000901000029000000000010043f0000000701000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b00000000020004110000063c02200197000600000002001d000000000020043f000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000ff001001900000091b0000c13d0000000c01000039000000000101041a000006d00010019800000be70000613d00000008021002700000063c0220019800000be50000c13d000000ff0010019000000000020000190000064d02006041000000060020006b0000091b0000613d000006df01000041000000000010043f000006c101000041000018e100010430000000800200043d000006430020009c00000b5f0000213d0000001001000039000000000401041a000000010040019000000001034002700000007f0330618f0000001f0030008c00000000050000390000000105002039000000000454013f0000000100400190000007d30000c13d000000200030008c00000c0a0000413d000000000010043f0000001f042000390000000504400270000006620440009a000000200020008c00000663040040410000001f033000390000000503300270000006620330009a000000000034004b00000c0a0000813d000000000004041b0000000104400039000000000034004b00000c060000413d0000001f0020008c00000e220000a13d000000000010043f000006f20420019800000eef0000c13d000000a005000039000006630300004100000efd0000013d000600000003001d000006400030009c00000b5f0000213d00000006020000290000004001200039000000400010043f000000080100002900000000021204360000000701000029000500000002001d00000000001204350000000901000029000000000010043f0000000e01000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000060200002900000000020204330000063c0220019700000005030000290000000003030433000000a003300210000000000223019f000000000101043b000000000021041b000000400100043d00000007020000290000000000210435000006390010009c000006390100804100000040011002100000000002000414000006390020009c0000063902008041000000c002200210000000000112019f00000654011001c70000800d020000390000000303000039000006d204000041000009500000013d000006400020009c00000b5f0000213d0000004001200039000000400010043f00000020012000390000000803000029000000000031043500000009050000290000000000520435000000a001300210000000000151019f0000000d02000039000000000012041b000000400100043d0000000000310435000006390010009c000006390100804100000040011002100000000002000414000006390020009c0000063902008041000000c002200210000000000112019f00000654011001c70000800d0200003900000002030000390000065504000041000008860000013d000000000005004b000000000300001900000cff0000613d0000000303500210000006f40330027f000006f4033001670000000004040433000000000334016f0000000104500210000000000343019f00000cff0000013d000006f3044001970000000000420435000000000001004b000000200400003900000000040060390000003f01400039000006f2011001970000000004310019000000000014004b00000000010000390000000101004039000900000004001d000006430040009c00000b5f0000213d000000010010019000000b5f0000c13d0000000901000029000000400010043f0000000801000029000006b70010009c00000da40000413d00000040010000390000000804000029000006b70440012a00000dad0000013d0000000901000029000006ae001001980000000801000029000006d60000c13d000000000010043f0000000601000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d00000009020000290007063c0020019c000000000101043b00000e600000c13d000000400100043d000006d90200004100000a890000013d000900000001001d0000000001000019000600000000001d000000080500002900000ca40000013d000900000000001d0000000701000029000000400010043f00000001055000390000000101000039000000010010019000000cab0000613d000000040050006c00000eda0000613d0000000602000029000000030020006c00000eda0000613d000000400100043d000006cb0010009c00000b5f0000213d0000008002100039000000400020043f0000006002100039000000000002043500000040021000390000000000020435000000200210003900000000000204350000000000010435000800000005001d000000000050043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000400200043d000006cb0020009c000000080500002900000b5f0000213d000000000101043b000000000101041a0000006003200039000000e80410027000000000004304350000004003200039000006ae001001980000000004000039000000010400c0390000000000430435000000a0031002700000064303300197000000200420003900000000003404350000063c01100197000000000012043500000c9f0000c13d000000000001004b00000000020100190000000902006029000900000002001d000000050120014f0000063c0010019800000ca00000c13d00000006010000290000000101100039000600000001001d00000005011002100000000201100029000000000051043500000ca00000013d00000648040000410000002006000039000000010870008a0000000508800270000006490880009a00000000093600190000000009090433000000000094041b00000020066000390000000104400039000000000084004b00000cec0000c13d000000000057004b00000cfd0000813d0000000307500210000000f80770018f000006f40770027f000006f40770016700000000033600190000000003030433000000000373016f000000000034041b000000010350021000000001033001bf000000000032041b0000000102000039000000000020041b0006063c0010019c00000d0e0000c13d000000400100043d0000066902000041000000000021043500000004021000390000000000020435000006390010009c0000063901008041000000400110021000000667011001c7000018e1000104300000000901000039000000000201041a0000064a032001970000000606000029000000000363019f000000000031041b00000000010004140000063c05200197000006390010009c0000063901008041000000c0011002100000064b011001c70000800d0200003900000003030000390000064c0400004118df18d50000040f0000000100200190000000650000613d000000400100043d00000020021000390000064d0300004100000000003204350000000000010435000006390010009c000006390100804100000040011002100000000002000414000006390020009c0000063902008041000000c002200210000000000112019f0000064e011001c70000800d020000390000000103000039000200000003001d0000064f0400004118df18d50000040f0000000100200190000000650000613d000006500100004100000000001004430000064d0100004100000004001004430000000001000414000006390010009c0000063901008041000000c00110021000000651011001c7000080020200003918df18da0000040f000000010020019000000f410000613d000000000101043b000000000001004b00000f110000c13d000000400100043d00000008020000290000063d02200197000027110020008c00000f420000413d0000002403100039000027100400003900000000004304350000066803000041000000000031043500000004031000390000000000230435000002f90000013d000800000001001d0000000105000039000500000000001d0000000001000019000000070200002900000d5e0000013d000800000000001d00000007020000290000000601000029000000400010043f00000001055000390000000101000039000000010010019000000d650000613d000000000025004b00000f0c0000613d0000000502000029000000040020006c00000f0c0000613d000000400100043d000006cb0010009c00000b5f0000213d0000008002100039000000400020043f0000006002100039000000000002043500000040021000390000000000020435000000200210003900000000000204350000000000010435000900000005001d000000000050043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000400200043d000006cb0020009c000000090500002900000b5f0000213d000000000101043b000000000101041a0000006003200039000000e80410027000000000004304350000004003200039000006ae001001980000000004000039000000010400c0390000000000430435000000a0031002700000064303300197000000200420003900000000003404350000063c01100197000000000012043500000d580000c13d000000000001004b0000000002010019000000080200602900000004010000390000000201100367000000000101043b000800000002001d000000000121013f0000063c0010019800000d590000c13d00000005010000290000000101100039000500000001001d00000005011002100000000301100029000000000051043500000d590000013d0000000804000029000006b90040009c000006b80440212a00000000010000390000002001002039000006ba0040009c00000010011081bf000006bb04408197000006ba0440812a000006bc0040009c00000008011080390000064304408197000006bc0440812a000027100040008c00000004011080390000063904408197000027100440811a000000640040008c00000002011080390000ffff0440818f000000640440811a000000090040008c0000000101102039000006f2051001970000005f04500039000006f2044001970000000904400029000006430040009c00000b5f0000213d000000400040043f0000000104100039000000090600002900000000044604360000002006500039000006f2056001980000001f0260018f00000dd00000613d000000000554001900000000060000310000000206600367000000006706043c0000000004740436000000000054004b00000dcc0000c13d000000000002004b000000090110002900000021011000390000000805000029000000090050008c0000000a2550011a0000000302200210000000010110008a0000000004010433000006bd04400197000006be0220021f000006bf02200197000000000242019f000000000021043500000dd40000213d000000400100043d000800000001001d0000002002100039000000000103001918df15ac0000040f0000000002010019000000090100002918df15ac0000040f00000008030000290000000002310049000000200120008a0000000000130435000000000103001918df10c90000040f000000400100043d000900000001001d0000000802000029000008c70000013d000000400100043d000006cb0010009c00000b5f0000213d0000008002100039000000400020043f00000060021000390000000000020435000000400210003900000000000204350000002002100039000000000002043500000000000104350000000901000029000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000400200043d000006cb0020009c00000b5f0000213d000000000101043b000000000101041a0000008003200039000000400030043f0000006003200039000000e80410027000000000004304350000004003200039000006ae001001980000000004000039000000010400c0390000000000430435000000a0031002700000064303300197000000200420003900000000003404350000063c011001970000000000120435000900000000001d000900000001601d00000c9b0000013d000000000002004b000000000300001900000e260000613d000000a00300043d0000000304200210000006f40440027f000006f404400167000000000443016f000000010320021000000f080000013d000000400100043d000006cb0010009c00000b5f0000213d0000008002100039000000400020043f00000060021000390000000000020435000000400210003900000000000204350000002002100039000000000002043500000000000104350000000901000029000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000400200043d000006cb0020009c00000b5f0000213d000000000101043b000000000101041a0000008003200039000000400030043f0000006003200039000000e80410027000000000004304350000004003200039000006ae001001980000000004000039000000010400c0390000000000430435000000a0031002700000064303300197000000200420003900000000003404350000063c011001970000000000120435000800000000001d000800000001601d00000d530000013d000000400100043d000006e40200004100000a890000013d000000000201041a000000000002004b00000e640000613d000000000001041b0000000701000029000000000010043f0000000501000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000201041a000006af0220009a000000000021041b000006b00100004100000000001004430000000001000414000006390010009c0000063901008041000000c001100210000006b1011001c70000800b0200003918df18da0000040f000000010020019000000f410000613d000000000101043b000600000001001d0000000801000029000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d0000000602000029000000a00220021000000007022001af000006b2022001c7000000000101043b000000000021041b0000000901000029000006b30010019800000ebe0000c13d00000008010000290000000101100039000600000001001d000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000000001004b00000ebe0000c13d000000000100041a000000060010006b00000ebe0000613d0000000601000029000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b0000000902000029000000000021041b0000000001000414000006390010009c0000063901008041000000c0011002100000064b011001c70000800d020000390000000403000039000006b40400004100000007050000290000000006000019000000080700002918df18d50000040f0000000100200190000000650000613d0000000101000039000000000201041a0000000102200039000000000021041b0000000001000414000006390010009c0000063901008041000000c0011002100000064b011001c70000800d020000390000000303000039000006b5040000410000000005000411000009510000013d000000020100002900000006020000290000000000210435000000400100043d000900000001001d0000000202000029000001110000013d00000660030000410000002006000039000000010540008a0000000505500270000006610550009a000000000706001900000080066000390000000006060433000000000063041b00000020067000390000000103300039000000000053004b00000ee60000c13d00000efc0000013d00000663030000410000002006000039000000010540008a0000000505500270000006640550009a000000000706001900000080066000390000000006060433000000000063041b00000020067000390000000103300039000000000053004b00000ef40000c13d000000a005700039000000000024004b00000f060000813d0000000304200210000000f80440018f000006f40440027f000006f4044001670000000005050433000000000445016f000000000043041b00000001030000390000000104200210000000000234019f000000000021041b0000000001000019000018e00001042e000000030200002900000005010000290000000000120435000000400300043d0000010f0000013d000006500100004100000000001004430000064d0100004100000004001004430000000001000414000006390010009c0000063901008041000000c00110021000000651011001c7000080020200003918df18da0000040f000000010020019000000f410000613d000000000101043b000000000001004b000000650000613d000000400300043d0000002401300039000002d102000039000000000021043500000652010000410000000000130435000000040130003900000000020004100000000000210435000006390030009c000100000003001d0000063901000041000000000103401900000040011002100000000002000414000006390020009c0000063902008041000000c002200210000000000112019f00000653011001c70000064d0200004118df18d50000040f0000006001100270000106390010019d000000010020019000000d450000613d0000000101000029000006430010009c00000b5f0000213d0000000101000029000000400010043f00000d450000013d000000000001042f00000009030000290000063c0530019800000f470000c13d000006660200004100000d060000013d000006400010009c00000b5f0000213d0000004003100039000000400030043f0000002003100039000000000023043500000000005104350000000801000029000000a001100210000000000151019f0000000d03000039000000000013041b000000400100043d0000000000210435000006390010009c000006390100804100000040011002100000000002000414000006390020009c0000063902008041000000c002200210000000000112019f00000654011001c70000800d020000390000000203000039000006550400004118df18d50000040f0000000100200190000000650000613d0000065601000041000000000010043f0000000a01000039000000200010043f0000065701000041000000000601041a000000000001041b0000000001000414000006390010009c0000063901008041000000c0011002100000064b011001c70000800d02000039000000040300003900000658040000410000065605000041000000000700001918df18d50000040f0000000100200190000000650000613d0000065901000041000000000010043f0000000a01000039000000200010043f0000065a01000041000000000601041a000000000001041b0000000001000414000006390010009c0000063901008041000000c0011002100000064b011001c70000800d02000039000000040300003900000658040000410000065905000041000000000700001918df18d50000040f0000000100200190000000650000613d0000000601000029000000000010043f0000065b01000041000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000ff0010019000000ff60000c13d0000000601000029000000000010043f0000065b01000041000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000201041a000006f30220019700000001022001bf000000000021041b0000000001000414000006390010009c0000063901008041000000c0011002100000064b011001c70000800d02000039000000040300003900000000070004110000065c040000410000000005000019000000060600002918df18d50000040f0000000100200190000000650000613d0000000601000029000000000010043f0000065d01000041000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b000000000101041a000000000001004b00000ff60000c13d0000065e01000041000000000201041a000900000002001d000006430020009c00000b5f0000213d00000009020000290000000102200039000000000021041b000000000010043f0000000001000414000006390010009c0000063901008041000000c00110021000000654011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b00000009011000290000000602000029000000000021041b0000065e01000041000000000101041a000900000001001d000000000020043f0000065d01000041000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000000650000613d000000000101043b0000000902000029000000000021041b00000005010000290000000002010433000006430020009c00000b5f0000213d0000000f01000039000000000401041a000000010040019000000001034002700000007f0330618f0000001f0030008c00000000050000390000000105002039000000000454013f0000000100400190000007d30000c13d000000200030008c000010160000413d000000000010043f0000001f0420003900000005044002700000065f0440009a000000200020008c00000660040040410000001f0330003900000005033002700000065f0330009a000000000034004b000010160000813d000000000004041b0000000104400039000000000034004b000010120000413d000000200020008c0000101e0000413d000000000010043f000006f2052001980000102a0000c13d00000020040000390000066003000041000010370000013d000000000002004b0000000003000019000010430000613d0000000303200210000006f40330027f000006f40330016700000007040000290000000004040433000000000334016f0000000102200210000000000323019f000010430000013d00000660030000410000002004000039000000010650008a0000000506600270000006610660009a000000050800002900000000078400190000000007070433000000000073041b00000020044000390000000103300039000000000063004b000010300000c13d000000000025004b000010410000813d0000000305200210000000f80550018f000006f40550027f000006f40550016700000005044000290000000004040433000000000454016f000000000043041b000000010220021000000001032001bf000000000031041b00000004010000290000000001010433000006430010009c000000100200003900000b5f0000213d000000000302041a000000010030019000000001023002700000007f0220618f0000001f0020008c00000000040000390000000104002039000000000343013f0000000100300190000007d30000c13d000000200020008c000010650000413d0000001003000039000000000030043f0000001f031000390000000503300270000006620330009a000000200010008c00000663030040410000001f022000390000000502200270000006620220009a000000000023004b000010650000813d000000000003041b0000000103300039000000000023004b000010610000413d000000200010008c0000002002000039000010860000413d0000001003000039000000000030043f000006f2051001980000066303000041000000000402001900000004080000290000107a0000613d0000002004000039000000010650008a0000000506600270000006640660009a00000000078400190000000007070433000000000073041b00000020044000390000000103300039000000000063004b000010730000c13d000000000015004b000010840000813d0000000305100210000000f80550018f000006f40550027f000006f40550016700000004044000290000000004040433000000000454016f000000000043041b0000000103100210000010900000013d000000000001004b0000000003000019000010910000613d0000000303100210000006f40330027f000006f40330016700000003040000290000000004040433000000000334016f000200010010021800000002033001af0000001001000039000000000031041b000001000020044300000120000004430000066501000041000018e00001042e00000020030000390000000004310436000000003202043400000000002404350000004001100039000000000002004b000010a60000613d000000000400001900000000051400190000000006430019000000000606043300000000006504350000002004400039000000000024004b0000109f0000413d000000000312001900000000000304350000001f02200039000006f2022001970000000001120019000000000001042d000006f50010009c000010bc0000213d000000630010008c000010bc0000a13d00000002030003670000000401300370000000000101043b0000063c0010009c000010bc0000213d0000002402300370000000000202043b0000063c0020009c000010bc0000213d0000004403300370000000000303043b000000000001042d0000000001000019000018e100010430000006f60010009c000010c30000813d0000002001100039000000400010043f000000000001042d000006e201000041000000000010043f0000004101000039000000040010043f0000066701000041000018e1000104300000001f02200039000006f2022001970000000001120019000000000021004b00000000020000390000000102004039000006430010009c000010d50000213d0000000100200190000010d50000c13d000000400010043f000000000001042d000006e201000041000000000010043f0000004101000039000000040010043f0000066701000041000018e100010430000006f70020009c0000110b0000813d00000000040100190000001f01200039000006f2011001970000003f01100039000006f205100197000000400100043d0000000005510019000000000015004b00000000070000390000000107004039000006430050009c0000110b0000213d00000001007001900000110b0000c13d000000400050043f00000000052104360000000007420019000000000037004b000011110000213d000006f2062001980000001f0720018f00000002044003670000000003650019000010fb0000613d000000000804034f0000000009050019000000008a08043c0000000009a90436000000000039004b000010f70000c13d000000000007004b000011080000613d000000000464034f0000000306700210000000000703043300000000076701cf000000000767022f000000000404043b0000010006600089000000000464022f00000000046401cf000000000474019f000000000043043500000000022500190000000000020435000000000001042d000006e201000041000000000010043f0000004101000039000000040010043f0000066701000041000018e1000104300000000001000019000018e10001043000000000430104340000063c03300197000000000332043600000000040404330000064304400197000000000043043500000040031000390000000003030433000000000003004b0000000003000039000000010300c03900000040042000390000000000340435000000600220003900000060011000390000000001010433000006d1011001970000000000120435000000000001042d00000020030000390000000004310436000000000302043300000000003404350000004001100039000000000003004b000011340000613d00000000040000190000002002200039000000000502043300000000015104360000000104400039000000000034004b0000112e0000413d000000000001042d0000000c01000039000000000201041a00000008012002700000063c011001980000113b0000613d000000000001042d000000ff0020019000000000010000190000064d01006041000000000001042d0000063c02200197000000000020043f000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f00000001002001900000114d0000613d000000000101043b000000000001042d0000000001000019000018e1000104300008000000000002000400000002001d000600000001001d000700000003001d000000000003004b000012a20000613d0000000701000029000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000012a00000613d000000000101043b000000000101041a000000000001004b0000117d0000c13d000000000100041a000000070010006c000012a20000a13d0000000702000029000000010220008a000800000002001d000000000020043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000012a00000613d000000000101043b000000000101041a000000000001004b00000008020000290000116a0000613d000006ae00100198000012a20000c13d00000006020000290000063c02200197000500000001001d0000063c01100197000600000002001d000000000021004b000012a70000c13d0000000701000029000000000010043f0000000601000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000012a00000613d000000000301043b000000000503041a00000000070004110000063c067001970000000604000029000000000046004b000011cd0000613d000000000056004b000011cd0000613d000100000005001d000200000003001d000000000040043f0000000701000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c70000801002000039000300000006001d18df18da0000040f00000003030000290000000100200190000012a00000613d000000000101043b000000000030043f000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f00000003060000290000000100200190000012a00000613d000000000101043b000000000101041a000000ff001001900000000604000029000000020300002900000001050000290000000007000411000011cd0000c13d0000000c01000039000000000101041a000006d000100198000012af0000613d00000008021002700000063c02200198000011cb0000c13d000000ff0010019000000000020000190000064d02006041000000000026004b000012af0000c13d00000004010000290000063c01100197000000000004004b000800000001001d000012180000613d000000000001004b0000121a0000613d0000000c01000039000000000101041a00000008021002700000063c022001980000129a0000613d000000000027004b0000121a0000613d000300000006001d000100000005001d000200000003001d00000650010000410000000000100443000400000002001d00000004002004430000000001000414000006390010009c0000063901008041000000c00110021000000651011001c7000080020200003918df18da0000040f0000000100200190000012a60000613d000000000101043b000000000001004b0000000303000029000012a00000613d000000400500043d000000640150003900000007020000290000000000210435000000440150003900000008020000290000000000210435000000240150003900000006040000290000000000410435000006dd0100004100000000001504350000000401500039000000000031043500000000010004140000000402000029000000040020008c000012120000613d000006390050009c000006390300004100000000030540190000004003300210000006390010009c0000063901008041000000c001100210000000000131019f000006fa011001c7000400000005001d18df18da0000040f000000040500002900000006040000290000006003100270000106390030019d0000000100200190000012c10000613d000006f70050009c000012bb0000813d000000400050043f000000020300002900000001050000290000121a0000013d000000000001004b000012b30000613d000000000005004b0000121d0000613d000000000003041b000000000040043f0000000501000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000012a00000613d000000000101043b000000000201041a000000010220008a000000000021041b0000000801000029000000000010043f0000000501000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000012a00000613d000000000101043b000000000201041a0000000102200039000000000021041b000006b00100004100000000001004430000000001000414000006390010009c0000063901008041000000c001100210000006b1011001c70000800b0200003918df18da0000040f0000000100200190000012a60000613d000000000101043b000400000001001d0000000701000029000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000012a00000613d0000000402000029000000a0022002100000000806000029000000000262019f000006b3022001c7000000000101043b000000000021041b0000000501000029000006b3001001980000128a0000c13d00000007010000290000000101100039000400000001001d000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000012a00000613d000000000101043b000000000101041a000000000001004b00000008060000290000128a0000c13d000000000100041a000000040010006b0000128a0000613d0000000401000029000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000012a00000613d000000000101043b0000000502000029000000000021041b00000008060000290000000001000414000006390010009c0000063901008041000000c0011002100000064b011001c70000800d020000390000000403000039000006b4040000410000000605000029000000070700002918df18d50000040f0000000100200190000012a00000613d000000080000006b000012ab0000613d000000000001042d000000ff001001900000121a0000c13d0000064d02000041000000000027004b000011db0000c13d0000121a0000013d0000000001000019000018e100010430000006e101000041000000000010043f000006c101000041000018e100010430000000000001042f000006f801000041000000000010043f000006c101000041000018e100010430000006fb01000041000000000010043f000006c101000041000018e100010430000006f901000041000000000010043f000006c101000041000018e100010430000000400100043d000006d9020000410000000000210435000006390010009c00000639010080410000004001100210000006c1011001c7000018e100010430000006e201000041000000000010043f0000004101000039000000040010043f0000066701000041000018e10001043000000639033001970000001f0530018f0000063b06300198000000400200043d0000000004620019000012cd0000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000012c90000c13d000000000005004b000012da0000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f00000000001404350000006001300210000006390020009c00000639020080410000004002200210000000000112019f000018e1000104300000063c01100198000012f20000613d000000000010043f0000000501000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000012f60000613d000000000101043b000000000101041a0000064301100197000000000001042d000006cf01000041000000000010043f000006c101000041000018e1000104300000000001000019000018e100010430000c000000000002000300000004001d000600000002001d000800000001001d000900000003001d000000000003004b000014d50000613d0000000901000029000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000014d30000613d000000000101043b000000000101041a000000000001004b000013270000c13d000000000100041a000000090010006c000014d50000a13d0000000902000029000000010220008a000a00000002001d000000000020043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000014d30000613d000000000101043b000000000101041a000000000001004b0000000a02000029000013140000613d000006ae00100198000014d50000c13d00000008020000290000063c02200197000500000001001d0000063c01100197000a00000002001d000000000021004b000014da0000c13d0000000901000029000000000010043f0000000601000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000014d30000613d000000000301043b000000000403041a00000000050004110000063c02500197000700000002001d0000000a0020006c000013750000613d000000070040006b000013750000613d000200000004001d000400000003001d0000000a01000029000000000010043f0000000701000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000014d30000613d000000000101043b0000000702000029000000000020043f000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000014d30000613d000000000101043b000000000101041a000000ff00100190000000040300002900000002040000290000000005000411000013750000c13d0000000c01000039000000000101041a000006d000100198000014e20000613d00000008021002700000063c02200198000013730000c13d000000ff0010019000000000020000190000064d02006041000000070020006b000014e20000c13d00000006010000290000063c021001970000000a0000006b000800000002001d000013be0000613d000000000002004b000013c00000613d0000000c01000039000000000101041a00000008021002700000063c02200198000014cd0000613d000000000025004b000013c00000613d000200000004001d000400000003001d00000650010000410000000000100443000100000002001d00000004002004430000000001000414000006390010009c0000063901008041000000c00110021000000651011001c7000080020200003918df18da0000040f0000000100200190000014d90000613d000000000101043b000000000001004b000014d30000613d000000400400043d00000064014000390000000902000029000000000021043500000044014000390000000802000029000000000021043500000024014000390000000a020000290000000000210435000006dd01000041000000000014043500000004014000390000000702000029000000000021043500000000010004140000000102000029000000040020008c000013b80000613d000006390040009c000006390300004100000000030440190000004003300210000006390010009c0000063901008041000000c001100210000000000131019f000006fa011001c7000100000004001d18df18da0000040f00000001040000290000006003100270000106390030019d00000001002001900000152f0000613d000006f70040009c000015200000813d000000400040043f00000004030000290000000204000029000013c00000013d000000000002004b000014e60000613d000000000004004b000013c30000613d000000000003041b0000000a01000029000000000010043f0000000501000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000014d30000613d000000000101043b000000000201041a000000010220008a000000000021041b0000000801000029000000000010043f0000000501000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000014d30000613d000000000101043b000000000201041a0000000102200039000000000021041b000006b00100004100000000001004430000000001000414000006390010009c0000063901008041000000c001100210000006b1011001c70000800b0200003918df18da0000040f0000000100200190000014d90000613d000000000101043b000400000001001d0000000901000029000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000014d30000613d0000000402000029000000a0022002100000000806000029000000000262019f000006b3022001c7000000000101043b000000000021041b0000000501000029000006b300100198000014310000c13d00000009010000290000000101100039000400000001001d000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000014d30000613d000000000101043b000000000101041a000000000001004b0000000806000029000014310000c13d000000000100041a000000040010006b000014310000613d0000000401000029000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000014d30000613d000000000101043b0000000502000029000000000021041b00000008060000290000000001000414000006390010009c0000063901008041000000c0011002100000064b011001c70000800d020000390000000403000039000006b4040000410000000a05000029000000090700002918df18d50000040f0000000100200190000014d30000613d000000080000006b000014de0000613d00000650010000410000000000100443000000060100002900000004001004430000000001000414000006390010009c0000063901008041000000c00110021000000651011001c7000080020200003918df18da0000040f0000000100200190000014d90000613d000000000101043b000000000001004b000014cc0000613d0000000008000415000000400b00043d0000006401b00039000000800700003900000000007104350000004401b00039000000090200002900000000002104350000002401b000390000000a020000290000000000210435000006fc0100004100000000001b04350000000401b00039000000070200002900000000002104350000008403b00039000000030100002900000000210104340000000000130435000000a403b00039000000000001004b0000146f0000613d000000000400001900000000053400190000000006420019000000000606043300000000006504350000002004400039000000000014004b000014680000413d0000000002310019000000000002043500000000040004140000000802000029000000040020008c0000147d0000c13d00000000050004150000000c0550008a00000005055002100000000103000031000000200030008c00000020040000390000000004034019000014b40000013d000900000008001d000700000007001d0000001f01100039000006f201100197000000a401100039000006390010009c000006390100804100000060011002100000063900b0009c000006390300004100000000030b40190000004003300210000000000131019f000006390040009c0000063904008041000000c003400210000000000113019f000a0000000b001d18df18d50000040f0000000a0b00002900000060031002700000063903300197000000200030008c000000200400003900000000040340190000001f0640018f000000200740019000000000057b0019000014a00000613d000000000801034f00000000090b0019000000008a08043c0000000009a90436000000000059004b0000149c0000c13d000000000006004b000014ad0000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000100000003001f00000000050004150000000b0550008a00000005055002100000000100200190000014ee0000613d00000009080000290000001f01400039000000600210018f0000000001b20019000000000021004b00000000020000390000000102004039000006430010009c000015200000213d0000000100200190000015200000c13d000000400010043f000000200030008c000014d30000413d00000000010b0433000006e500100198000014d30000c13d0000000502500270000000000201001f000000000200041500000000022800490000000002000002000006e601100197000006fc0010009c0000151c0000c13d000000000001042d000000ff00100190000013c00000c13d0000064d02000041000000000025004b000013830000c13d000013c00000013d0000000001000019000018e100010430000006e101000041000000000010043f000006c101000041000018e100010430000000000001042f000006f801000041000000000010043f000006c101000041000018e100010430000006fb01000041000000000010043f000006c101000041000018e100010430000006f901000041000000000010043f000006c101000041000018e100010430000000400100043d000006d9020000410000000000210435000006390010009c00000639010080410000004001100210000006c1011001c7000018e100010430000000000003004b000014f20000c13d0000006002000039000015190000013d0000001f023000390000063a022001970000003f02200039000006fd04200197000000400200043d0000000004420019000000000024004b00000000050000390000000105004039000006430040009c000015200000213d0000000100500190000015200000c13d000000400040043f0000001f0430018f00000000063204360000063b05300198000700000006001d00000000035600190000150c0000613d000000000601034f0000000707000029000000006806043c0000000007870436000000000037004b000015080000c13d000000000004004b000015190000613d000000000151034f0000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f00000000001304350000000001020433000000000001004b000015260000c13d000006fe01000041000000000010043f000006c101000041000018e100010430000006e201000041000000000010043f0000004101000039000000040010043f0000066701000041000018e1000104300000000702000029000006390020009c00000639020080410000004002200210000006390010009c00000639010080410000006001100210000000000121019f000018e10001043000000639033001970000001f0530018f0000063b06300198000000400200043d00000000046200190000153b0000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000015370000c13d000000000005004b000015480000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f00000000001404350000006001300210000006390020009c00000639020080410000004002200210000000000112019f000018e10001043000010000000000020000000003010019000000400100043d000006ff0010009c000015a60000813d0000008002100039000000400020043f0000006002100039000000000002043500000040021000390000000000020435000000200210003900000000000204350000000000010435000000000003004b000015a30000613d000000000200041a000000000032004b000015a30000a13d000100000003001d000000000030043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000015a40000613d000000000101043b000000000101041a000000000001004b000015750000c13d0000000103000029000000010330008a000015610000013d000000400100043d000006cb0010009c0000000103000029000015a60000213d0000008002100039000000400020043f0000006002100039000000000002043500000040021000390000000000020435000000200210003900000000000204350000000000010435000000000030043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000015a40000613d000000000301034f000000400100043d000006cb0010009c000015a60000213d000000000203043b000000000202041a0000008003100039000000400030043f0000006003100039000000e8042002700000000000430435000006ae002001980000000003000039000000010300c039000000400410003900000000003404350000063c032001970000000003310436000000a00220027000000643022001970000000000230435000000000001042d0000000001000019000018e100010430000006e201000041000000000010043f0000004101000039000000040010043f0000066701000041000018e1000104300000000031010434000000000001004b000015b70000613d000000000400001900000000052400190000000006430019000000000606043300000000006504350000002004400039000000000014004b000015b00000413d00000000012100190000000000010435000000000001042d0001000000000002000100000002001d0000063c01100197000000000010043f0000000701000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000015ed0000613d000000000101043b00000001020000290000063c02200197000100000002001d000000000020043f000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000015ed0000613d000000000101043b000000000101041a000000ff01100190000015dd0000613d000000000001042d0000000c01000039000000000201041a000006d000200198000015eb0000613d00000008012002700000063c01100198000015e70000c13d000000ff0020019000000000010000190000064d01006041000000010010006b00000000010000390000000101006039000000000001042d0000000001000019000000000001042d0000000001000019000018e1000104300001000000000002000100000001001d000000000010043f0000000a01000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000016100000613d0000000002000411000000000101043b0000063c02200197000000000020043f000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000016100000613d000000000101043b000000000101041a000000ff00100190000016120000613d000000000001042d0000000001000019000018e100010430000000400100043d000000240210003900000001030000290000000000320435000006cd020000410000000000210435000000040210003900000000030004110000000000320435000006390010009c0000063901008041000000400110021000000653011001c7000018e100010430000c000000000002000000400300043d000500000003001d000006f60030009c000017790000813d00000005030000290000002006300039000000400060043f0000000000030435000000000002004b000017800000613d0000063c03100198000017840000613d000000000400041a000600000004001d000006f4054001670000000004000019000000000054004b0000173c0000213d0000000104400039000000000024004b000016310000413d000200000005001d000800000002001d000300000001001d000900000003001d000400000006001d000006b00100004100000000001004430000000001000414000006390010009c0000063901008041000000c001100210000006b1011001c70000800b0200003918df18da0000040f00000001002001900000177f0000613d000000000101043b000a00000001001d0000000601000029000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f000000010020019000000008030000290000173a0000613d0000000a02000029000000a002200210000000010030008c0000000003000019000006b303006041000000000223019f0000000903000029000000000232019f000000000101043b000000000021041b000000000030043f0000000501000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f000000080400002900000001002001900000173a0000613d000000000101043b00000700024000d1000000000301041a0000000002230019000000000021041b000700060040002d000a00060000002d0000000001000019000016870000013d0000000a070000290000000001000414000006390010009c0000063901008041000000c0011002100000064b011001c70000800d020000390000000403000039000006b40400004100000000050000190000000906000029000a00000007001d18df18d50000040f0000000804000029000000010020019000000001010000390000173a0000613d0000000100100190000016760000613d0000000a070000290000000107700039000000070070006c000016770000c13d0000000701000029000000000010041b000000000100001900000003020000290000000203000029000000000031004b0000173c0000213d0000000101100039000000000041004b000016920000413d0000065001000041000000000010044300000004002004430000000001000414000006390010009c0000063901008041000000c00110021000000651011001c7000080020200003918df18da0000040f00000001002001900000177f0000613d000000000101043b000000000001004b000017390000613d00000001010000390000008007000039000006fc0800004100000000020004110000063c092001970000000603000029000100000007001d000200000009001d000000070030006c000000000a000039000000010a00403900000001001001900000000406000029000017360000613d000000000b000415000000400c00043d0000006401c00039000000000071043500000000008c04350000000401c0003900000000009104350000004401c00039000600000003001d00000000003104350000002401c000390000000000010435000000050100002900000000010104330000008402c000390000000000120435000000a402c00039000000000001004b000016cf0000613d000000000300001900000000042300190000000005630019000000000505043300000000005404350000002003300039000000000013004b000016c80000413d0000000002210019000000000002043500000000040004140000000902000029000000040020008c000016dd0000c13d00000000050004150000000c0550008a00000005055002100000000103000031000000200030008c00000020040000390000000004034019000017170000013d00080000000b001d000a0000000a001d0000001f01100039000006f201100197000000a401100039000006390010009c000006390100804100000060011002100000063900c0009c000006390300004100000000030c40190000004003300210000000000131019f000006390040009c0000063904008041000000c003400210000000000113019f00030000000c001d18df18d50000040f000000030c00002900000060031002700000063903300197000000200030008c00000020040000390000000004034019000000200640019000000000056c0019000016ff0000613d000000000701034f00000000080c0019000000007907043c0000000008980436000000000058004b000016fb0000c13d0000001f074001900000170c0000613d000000000661034f0000000307700210000000000805043300000000087801cf000000000878022f000000000606043b0000010007700089000000000676022f00000000067601cf000000000686019f0000000000650435000100000003001f00000000050004150000000b0550008a0000000505500210000000010020019000000002090000290000000a0a000029000000080b000029000017420000613d0000008007000039000006fc080000410000001f01400039000000600210018f0000000001c20019000000000021004b00000000020000390000000102004039000006430010009c000017790000213d0000000100200190000017790000c13d000000400010043f000000200030008c0000173a0000413d00000000010c0433000006e5001001980000173a0000c13d000000060300002900000001033000390000000502500270000000000201001f000000000200041500000000022b00490000000002000002000006e601100197000006fc0010009c00000000010a0019000016ae0000613d000006fe01000041000000000010043f000006c101000041000018e100010430000000000100041a000000070010006c0000173a0000c13d000000000001042d0000000001000019000018e100010430000006e201000041000000000010043f0000001101000039000000040010043f0000066701000041000018e100010430000000000003004b000017460000c13d00000060020000390000176d0000013d0000001f023000390000063a022001970000003f02200039000006fd04200197000000400200043d0000000004420019000000000024004b00000000050000390000000105004039000006430040009c000017790000213d0000000100500190000017790000c13d000000400040043f0000001f0430018f00000000063204360000063b05300198000100000006001d0000000003560019000017600000613d000000000601034f0000000107000029000000006806043c0000000007870436000000000037004b0000175c0000c13d000000000004004b0000176d0000613d000000000151034f0000000304400210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f00000000001304350000000001020433000000000001004b0000000102000029000017320000613d000006390020009c00000639020080410000004002200210000006390010009c00000639010080410000006001100210000000000121019f000018e100010430000006e201000041000000000010043f0000004101000039000000040010043f0000066701000041000018e100010430000000000001042f0000070101000041000000000010043f000006c101000041000018e100010430000000400100043d000006d9020000410000000000210435000006390010009c00000639010080410000004001100210000006c1011001c7000018e1000104300001000000000002000000000001004b000017bc0000613d000100000001001d000000000010043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000017ba0000613d000000000101043b000000000101041a000000000001004b000017b70000c13d000000000100041a0000000102000029000000000021004b000017bc0000a13d000000010220008a000100000002001d000000000020043f0000000401000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000017ba0000613d000000000101043b000000000101041a000000000001004b0000000102000029000017a40000613d000006ae00100198000017bc0000c13d000000000001042d0000000001000019000018e100010430000006e101000041000000000010043f000006c101000041000018e1000104300006000000000002000600000002001d000500000001001d000000000010043f0000000a01000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000018900000613d000000000101043b00000006020000290000063c02200197000600000002001d000000000020043f000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000018900000613d000000000101043b000000000101041a000000ff001001900000188f0000613d0000000501000029000000000010043f0000000a01000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000018900000613d000000000101043b0000000602000029000000000020043f000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000018900000613d000000000101043b000000000201041a000006f302200197000000000021041b0000000001000414000006390010009c0000063901008041000000c0011002100000064b011001c70000800d020000390000000403000039000000000700041100000702040000410000000505000029000000060600002918df18d50000040f0000000100200190000018900000613d0000000501000029000000000010043f0000000b01000039000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000018900000613d000000000201043b0000000601000029000000000010043f000500000002001d0000000101200039000300000001001d000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000018900000613d0000000503000029000000000101043b000000000101041a000000000001004b0000188f0000613d000000000203041a000000000002004b000018920000613d000000000021004b000400000001001d0000186f0000613d000200000002001d000000000030043f0000000001000414000006390010009c0000063901008041000000c00110021000000654011001c7000080100200003918df18da0000040f0000000100200190000018900000613d00000004020000290001000100200092000000000101043b0000000504000029000000000204041a000000010020006c000018980000a13d0000000202000029000000010220008a0000000001120019000000000101041a000200000001001d000000000040043f0000000001000414000006390010009c0000063901008041000000c00110021000000654011001c7000080100200003918df18da0000040f0000000100200190000018900000613d000000000101043b00000001011000290000000202000029000000000021041b000000000020043f0000000301000029000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000018900000613d000000000101043b0000000402000029000000000021041b0000000503000029000000000103041a000400000001001d000000000001004b0000189e0000613d000000000030043f0000000001000414000006390010009c0000063901008041000000c00110021000000654011001c7000080100200003918df18da0000040f0000000100200190000018900000613d0000000402000029000000010220008a000000000101043b0000000001210019000000000001041b0000000501000029000000000021041b0000000601000029000000000010043f0000000301000029000000200010043f0000000001000414000006390010009c0000063901008041000000c0011002100000064e011001c7000080100200003918df18da0000040f0000000100200190000018900000613d000000000101043b000000000001041b000000000001042d0000000001000019000018e100010430000006e201000041000000000010043f0000001101000039000000040010043f0000066701000041000018e100010430000006e201000041000000000010043f0000003201000039000000040010043f0000066701000041000018e100010430000006e201000041000000000010043f0000003101000039000000040010043f0000066701000041000018e1000104300001000000000002000000000301041a000100000002001d000000000023004b000018b70000a13d000000000010043f0000000001000414000006390010009c0000063901008041000000c00110021000000654011001c7000080100200003918df18da0000040f0000000100200190000018bd0000613d000000000101043b00000001011000290000000002000019000000000001042d000006e201000041000000000010043f0000003201000039000000040010043f0000066701000041000018e1000104300000000001000019000018e100010430000000000001042f000006390010009c00000639010080410000004001100210000006390020009c00000639020080410000006002200210000000000112019f0000000002000414000006390020009c0000063902008041000000c002200210000000000112019f0000064b011001c7000080100200003918df18da0000040f0000000100200190000018d30000613d000000000101043b000000000001042d0000000001000019000018e100010430000018d8002104210000000102000039000000000001042d0000000002000019000000000001042d000018dd002104230000000102000039000000000001042d0000000002000019000000000001042d000018df00000432000018e00001042e000018e1000104300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff00000000000000000000000000000000000000000000000000000001ffffffe000000000000000000000000000000000000000000000000000000000ffffffe0000000000000000000000000ffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000ffffffffffffffc04368726f6e6f466f726765205065747300000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffbf434650000000000000000000000000000000000000000000000000000000000068747470733a2f2f6368726f6e6f666f7267652e676700000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffbfa87805ed57dc1f0d489ce33be4c4577d74ccde357eeeee058a32c55c44a532405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acebfa87805ed57dc1f0d489ce33be4c4577d74ccde357eeeee058a32c55c44a5313da8a5f161a6c3ff06a60736d0ed24d7963cc6a5c4fafd2fa1dae9bb908e07a5c2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b3da8a5f161a6c3ff06a60736d0ed24d7963cc6a5c4fafd2fa1dae9bb908e07a4ffffffffffffffffffffffff000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000008be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0000000000000000000000000721c002b0059009a671d00ad1700c9748146cd1b0200000000000000000000000000000000000040000000000000000000000000cc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac1806aa1896bbf26568e884a7374b41e002500962caba6a15023a8d90e8508b830200000200000000000000000000000000000024000000000000000000000000fb2de5d700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004400000000000000000000000002000000000000000000000000000000000000200000000000000000000000008a8bae378cb731c5c40b632330c6836c2f916f48edb967699c86736f9a6a76ef9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6aa1d7351356c4ddc11907b1ee0660f579cfdf507235af2ae01ecd22a4b7ceaafbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ffa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217754f5f35b2b01f07f9be0651f033d30422e26500d4938fa8e284ae4c3c59221e5813da86008ba1c6922daee3e07db95305ef49ebced9f5467a0b8613fcc6b343e32f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0ddf7de25b7f1fd6d0b5205f0e18f1f35bd7b8d84cce336588d184533ce43a6f77df7de25b7f1fd6d0b5205f0e18f1f35bd7b8d84cce336588d184533ce43a6f7672eef71ef43483d822203fd126296c5f8bfc62fd930b15bdbf4bf082a7e537fe8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac80272eef71ef43483d822203fd126296c5f8bfc62fd930b15bdbf4bf082a7e537fde497b8238be5e4f32f72d877ba0627e627848cb8a6504aa01d21a347d565198e1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae672e497b8238be5e4f32f72d877ba0627e627848cb8a6504aa01d21a347d565198d0000000200000000000000000000000000000040000001000000000000000000b6d9900a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000006f483d09000000000000000000000000000000000000000000000000000000001e4fbdf70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000715018a500000000000000000000000000000000000000000000000000000000a3246ad200000000000000000000000000000000000000000000000000000000d539139200000000000000000000000000000000000000000000000000000000dc8e92e900000000000000000000000000000000000000000000000000000000e985e9c400000000000000000000000000000000000000000000000000000000e985e9c500000000000000000000000000000000000000000000000000000000f2fde38b00000000000000000000000000000000000000000000000000000000dc8e92ea00000000000000000000000000000000000000000000000000000000e8a3d48500000000000000000000000000000000000000000000000000000000d539139300000000000000000000000000000000000000000000000000000000d547741f00000000000000000000000000000000000000000000000000000000d547cfb700000000000000000000000000000000000000000000000000000000c23dc68e00000000000000000000000000000000000000000000000000000000c23dc68f00000000000000000000000000000000000000000000000000000000c87b56dd00000000000000000000000000000000000000000000000000000000ca15c87300000000000000000000000000000000000000000000000000000000a3246ad300000000000000000000000000000000000000000000000000000000a9fc664e00000000000000000000000000000000000000000000000000000000b88d4fde00000000000000000000000000000000000000000000000000000000938e3d7a000000000000000000000000000000000000000000000000000000009e05d23f000000000000000000000000000000000000000000000000000000009e05d24000000000000000000000000000000000000000000000000000000000a217fddf00000000000000000000000000000000000000000000000000000000a22cb46500000000000000000000000000000000000000000000000000000000938e3d7b0000000000000000000000000000000000000000000000000000000095d89b410000000000000000000000000000000000000000000000000000000099a2557a000000000000000000000000000000000000000000000000000000008da5cb5a000000000000000000000000000000000000000000000000000000008da5cb5b000000000000000000000000000000000000000000000000000000009010d07c0000000000000000000000000000000000000000000000000000000091d1485400000000000000000000000000000000000000000000000000000000715018a60000000000000000000000000000000000000000000000000000000075b238fc000000000000000000000000000000000000000000000000000000008462151c000000000000000000000000000000000000000000000000000000002a5520590000000000000000000000000000000000000000000000000000000055f804b2000000000000000000000000000000000000000000000000000000006221d13b000000000000000000000000000000000000000000000000000000006221d13c000000000000000000000000000000000000000000000000000000006352211e0000000000000000000000000000000000000000000000000000000070a082310000000000000000000000000000000000000000000000000000000055f804b3000000000000000000000000000000000000000000000000000000005944c753000000000000000000000000000000000000000000000000000000005bbb21770000000000000000000000000000000000000000000000000000000042842e0d0000000000000000000000000000000000000000000000000000000042842e0e0000000000000000000000000000000000000000000000000000000042966c6800000000000000000000000000000000000000000000000000000000449a52f8000000000000000000000000000000000000000000000000000000002a55205a000000000000000000000000000000000000000000000000000000002f2ff15d0000000000000000000000000000000000000000000000000000000036568abe00000000000000000000000000000000000000000000000000000000095ea7b20000000000000000000000000000000000000000000000000000000018160ddc0000000000000000000000000000000000000000000000000000000018160ddd0000000000000000000000000000000000000000000000000000000023b872dd00000000000000000000000000000000000000000000000000000000248a9ca300000000000000000000000000000000000000000000000000000000095ea7b300000000000000000000000000000000000000000000000000000000098144d4000000000000000000000000000000000000000000000000000000000d705df60000000000000000000000000000000000000000000000000000000004634d8c0000000000000000000000000000000000000000000000000000000004634d8d0000000000000000000000000000000000000000000000000000000006fdde0300000000000000000000000000000000000000000000000000000000081812fc00000000000000000000000000000000000000000000000000000000014635460000000000000000000000000000000000000000000000000000000001ffc9a7000000000000000000000000000000000000000000000000000000000379b1d0118cdaa700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002400000080000000000000000000000000000000000000000000000000000000200000000000000000000000000000000100000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffff00000000000000000000000000000001796b89b91644bc98cd93958e4c9038275d622183e25ac5af08cc6b5d95539132020000020000000000000000000000000000000400000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca500000000000000000000000000000000000000200000008000000000000000000000000000184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000000000000000000000000000000000000000004ee2d6d415b85acef810000000000000000000000000000000000000000000004ee2d6d415b85acef80ffffffff000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000ffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000005f5e10000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff30313233343536373839616263646566000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000ceea21b6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000032483afb00000000000000000000000000000000000000000000000000000000ffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffff0017307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31ffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff000000000000000000000100000000000000000000000000000000000000000002000000000000000000000000000000000000200000008000000000000000006787c7f9a80aa0f5ceddab2c54f1f5169c0b88e75dd5e19d5e858a64144c7dbc000000000000000000000000000000000000000000000000ffffffffffffff7f4f5f35b2b01f07f9be0651f033d30422e26500d4938fa8e284ae4c3c59221e57e2517d3f0000000000000000000000000000000000000000000000000000000032c1995a000000000000000000000000000000000000000000000000000000008f4eb6040000000000000000000000000000000000000000000000000000000000000000000000000000ff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffff7f5b076c952c0ec86e5425963c1326dd0f03a3595c19f81d765e8ff559a6e33c969f085200000000000000000000000000000000000000000000000000000000dfd1fc1b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064000000000000000000000000aa1d7351356c4ddc11907b1ee0660f579cfdf507235af2ae01ecd22a4b7ceaae0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688559dc379f000000000000000000000000000000000000000000000000000000005cbd9441000000000000000000000000000000000000000000000000000000006697b2320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000008000000000000000000000000000000000000000000000000000000040000000000000000000000000caee23ea000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000800000000000000000cfb3b942000000000000000000000000000000000000000000000000000000008c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925df2d9b42000000000000000000000000000000000000000000000000000000004e487b7100000000000000000000000000000000000000000000000000000000cf4700e400000000000000000000000000000000000000000000000000000000734364d00000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000007965db0affffffffffffffffffffffffffffffffffffffffffffffffffffffffa07d2299ffffffffffffffffffffffffffffffffffffffffffffffffffffffffa07d229a00000000000000000000000000000000000000000000000000000000ad0d7f6c000000000000000000000000000000000000000000000000000000007965db0b0000000000000000000000000000000000000000000000000000000080ac58cd000000000000000000000000000000000000000000000000000000005a05180effffffffffffffffffffffffffffffffffffffffffffffffffffffff5a05180f000000000000000000000000000000000000000000000000000000005b5e139f0000000000000000000000000000000000000000000000000000000001ffc9a7000000000000000000000000000000000000000000000000000000002a55205a00000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000ffffffffffffffe00000000000000000000000000000000000000000000000010000000000000000a11481000000000000000000000000000000000000000000000000000000000059c896be000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084000000000000000000000000ea553b3400000000000000000000000000000000000000000000000000000000150b7a020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ffffffe0d1a57ed600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff800000000000000000000000000000000000000000000000010000000000000001b562e8dd00000000000000000000000000000000000000000000000000000000f6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b0000000000000000000000000000000000000000000000000000000000000000cc3522fd09855572dc3102806875b0aa03488c98fcf729a6585f966993fe75a5
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000017a45f80efd20594afe2c59d7e1ae7ab0c6954cc00000000000000000000000035c27582988082d04c504a8017314ff8fdba7bcd00000000000000000000000000000000000000000000000000000000000001f4
-----Decoded View---------------
Arg [0] : initialOwner_ (address): 0x17A45F80eFd20594afE2c59D7e1Ae7AB0c6954Cc
Arg [1] : royaltyReceiver_ (address): 0x35c27582988082d04C504A8017314FF8FdbA7BCd
Arg [2] : feeNumerator_ (uint96): 500
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000017a45f80efd20594afe2c59d7e1ae7ab0c6954cc
Arg [1] : 00000000000000000000000035c27582988082d04c504a8017314ff8fdba7bcd
Arg [2] : 00000000000000000000000000000000000000000000000000000000000001f4
[ 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.