Token Music-Collection
Overview ERC-1155
Total Supply:
0 LNQ-Music
Holders:
32 addresses
Transfers:
-
Profile Summary
Contract:
[ Download CSV Export ]
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
ERC1155SlabsMusicCollection
Compiler Version
v0.8.11+commit.d7f03943
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: None pragma solidity ^0.8.11; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/metatx/ERC2771Context.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "../utils/Whitelist.sol"; import "../utils/Authorizable.sol"; import "../MarketPlace/interfaces/IRoyaltyFeeRegistry.sol"; /** * @title ERC1155SlabsMusicCollection * @notice ERC721Collection NFT MusicCollection contract. */ contract ERC1155SlabsMusicCollection is ERC1155Supply, ERC2771Context, Authorizable, Whitelist, ERC2981 { using Strings for uint256; using Address for address; uint256 private _currentTokenID = 1; uint256 public maxRoyalty; // Contract name string public name; // Contract symbol string public symbol; // Optional base URI string private _baseURI = ""; // Optional mapping for token URIs mapping(uint256 => string) private _tokenURIs; mapping(uint256 => address) public creators; address public royaltyRegistry; //event event SetRoyaltyRegistry(address indexed _address); event RoyalityLimitChanged( address _owner, uint256 _oldLimit, uint256 _newLimit ); constructor( string memory _name, string memory _symbol, address _trustedForwarder, address _royaltyRegistry ) ERC1155("") ERC2771Context(_trustedForwarder) { require( _royaltyRegistry != address(0) && _trustedForwarder != address(0), "ERC1155-MusicCollection: invalid zero address" ); name = _name; symbol = _symbol; royaltyRegistry = _royaltyRegistry; maxRoyalty = 2000; } /** * @dev modifer to check only valid address can mint token */ modifier onlyValidOwner() { require( isAuthorized(msg.sender) || owner() == _msgSender(), "ERC1155-MusicCollection: caller is not valid for call" ); _; } /** * @dev modifer to check only creator owner can set royality * @param _tokenId token id of the collection */ modifier onlyCreatorOwner(uint256 _tokenId) { require( creators[_tokenId] == _msgSender(), "ERC1155-MusicCollection: only initial owner can set the royality" ); _; } /** * @dev Sets the royalty info for any token. * @param _tokenId token id of the collection NFT * @param _receiver royalty receiver address * @param _feeNumerator percentage of royalty fee */ function setRoyaltyforToken( uint256 _tokenId, address _receiver, uint96 _feeNumerator ) external onlyCreatorOwner(_tokenId) { require( _feeNumerator <= maxRoyalty, "ERC1155-MusicCollection: royalty for token must be less than maxRoyalty" ); _setTokenRoyalty(_tokenId, _receiver, _feeNumerator); } /** * @dev Deletes the royalty info for any token. * @param _tokenId token id of the collection */ function resetTokenRoyalty(uint256 _tokenId) external onlyCreatorOwner(_tokenId) { _resetTokenRoyalty(_tokenId); } /** * @dev change the royality limit. * @param _limit limit of the royalty percentage */ function changeLimitOfRoyality(uint256 _limit) external onlyOwner { require( _limit <= _feeDenominator(), "ERC1155-MusicCollection: royalty must be less than equal to 100%" ); uint256 _oldLimit = maxRoyalty; require( _limit != _oldLimit, "ERC1155-MusicCollection: limit must be different" ); maxRoyalty = _limit; emit RoyalityLimitChanged(_msgSender(), _oldLimit, _limit); } /** * @dev Creates batch tokens type and assigns _amount to an address * NOTE: remove onlyOwner if you want third parties to create new tokens on your contract (which may change your IDs) * @param _to address of the first owner of the token * @param _amounts amount to supply the first owner * @param _uris Optional URI for this token type * @param _feeNumerator single user fee for the first owner * @param _receivers addresses of factional royalty receivers * @param _fees percentage of fees for receivers */ function batchCreate( address _to, uint256[] memory _amounts, string[] calldata _uris, uint96 _feeNumerator, address[] memory _receivers, uint256[] memory _fees ) external onlyValidOwner { require( _amounts.length == _uris.length, "ERC1155-MusicCollection: _amount length must be equal to uri" ); for (uint8 i = 0; i < _amounts.length; i += 1) { create( _to, _amounts[i], _uris[i], _feeNumerator, _receivers, _fees ); } } /** * @dev Creates a new token type and assigns _initialSupply to an address * NOTE: remove onlyOwner if you want third parties to create new tokens on your contract (which may change your IDs) * @param _to address of the first owner of the token * @param _amount amount to supply the first owner * @param _uri Optional URI for this token type * @param _feeNumerator single user fee for the first owner * @param _receivers addresses of factional royalty receivers * @param _fees percentage of fees for receivers * @return The newly created token ID */ function create( address _to, uint256 _amount, string calldata _uri, uint96 _feeNumerator, address[] memory _receivers, uint256[] memory _fees ) public onlyValidOwner returns (uint256) { uint256 _id = _currentTokenID; _setCreator(_to, _id); _mint(_to, _id, _amount, ""); _setURI(_id, _uri); if (_feeNumerator != 0) { _setTokenRoyalty(_id, _to, _feeNumerator); } if (_receivers.length > 0) { IRoyaltyFeeRegistry(royaltyRegistry).updateRoyaltyInfoForNFT( address(this), _id, _receivers, _fees ); } _currentTokenID = _currentTokenID + 1; return _id; } /** * @dev disable owner to set approve for those operator not in whitelist. */ function setApprovalForAll(address operator, bool approved) public override { if (operator.isContract()) { require( isWhitelisted(operator) || isPublicSale, "ERC1155-MusicCollection: Only whitelist is allowed" ); } super.setApprovalForAll(operator, approved); } /** * @dev change the royalty registory address. * @param _address royalty registry address */ function setRoyaltyRegistry(address _address) external onlyOwner { require( _address != address(0), "ERC1155-MusicCollection: invalid address" ); require( _address != royaltyRegistry, "ERC1155-MusicCollection: same address already" ); royaltyRegistry = _address; emit SetRoyaltyRegistry(_address); } function _msgSender() internal view override(Context, ERC2771Context) returns (address sender) { sender = ERC2771Context._msgSender(); } function _msgData() internal view override(Context, ERC2771Context) returns (bytes memory) { return ERC2771Context._msgData(); } /** * @dev Change the creator address for given token * @param _to Address of the new creator * @param _id Token IDs to change creator of */ function _setCreator(address _to, uint256 _id) internal { creators[_id] = _to; } /** * @dev counterId */ function counterId() external view returns (uint256) { return _currentTokenID; } function burn( address account, uint256 id, uint256 value ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155-MusicCollection: caller is not token owner or approved" ); _burn(account, id, value); } function burnBatch( address account, uint256[] memory ids, uint256[] memory values ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155-MusicCollection: caller is not token owner or approved" ); _burnBatch(account, ids, values); } /** * @dev returns true if the contract supports the interface with entered bytecode. * @dev 0x2a55205a to test eip 2981 * @param interfaceId interface id of the contract */ function supportsInterface(bytes4 interfaceId) public view override(ERC1155, ERC2981) returns (bool) { return super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the concatenation of the `_baseURI` * and the token-specific uri if the latter is set * * This enables the following behaviors: * * - if `_tokenURIs[tokenId]` is set, then the result is the concatenation * of `_baseURI` and `_tokenURIs[tokenId]` (keep in mind that `_baseURI` * is empty per default); * * - if `_tokenURIs[tokenId]` is NOT set then we fallback to `super.uri()` * which in most cases will contain `ERC1155._uri`; * * - if `_tokenURIs[tokenId]` is NOT set, and if the parents do not have a * uri value set, then the result is empty. */ function uri(uint256 tokenId) public view virtual override returns (string memory) { string memory tokenURI = _tokenURIs[tokenId]; // If token URI is set, concatenate base URI and tokenURI (via abi.encodePacked). return bytes(tokenURI).length > 0 ? string(abi.encodePacked(_baseURI, tokenURI)) : super.uri(tokenId); } /** * @dev return initial owner of token ID. * @param tokenId token ID of asset */ function initialOwner(uint256 tokenId) external view returns (address) { return creators[tokenId]; } /** * @dev Sets `tokenURI` as the tokenURI of `tokenId`. */ function _setURI(uint256 tokenId, string memory tokenURI) internal virtual { _tokenURIs[tokenId] = tokenURI; emit URI(uri(tokenId), tokenId); } }
// SPDX-License-Identifier: None pragma solidity 0.8.11; import "@openzeppelin/contracts/access/Ownable.sol"; import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; contract Authorizable is Ownable { using EnumerableSet for EnumerableSet.AddressSet; EnumerableSet.AddressSet private authorized; event AddAuthorized(address indexed _address); event RemoveAuthorized(address indexed _address); modifier onlyAuthorized() { require( isAuthorized(_msgSender()) || owner() == _msgSender(), "Authorizable: caller is not the SuperAdmin or Admin" ); _; } function addAuthorized(address _toAdd) external onlyOwner { require( _toAdd != address(0), "Authorizable: _toAdd isn't vaild address" ); require( !authorized.contains(_toAdd), "Authorizable: _toAdd is already added" ); authorized.add(_toAdd); emit AddAuthorized(_toAdd); } function removeAuthorized(address _toRemove) external onlyOwner { require( _toRemove != address(0), "Authorizable: _toRemove isn't vaild address" ); require( authorized.contains(_toRemove), "Authorizable: address already removed" ); authorized.remove(_toRemove); emit RemoveAuthorized(_toRemove); } /** * @notice Returns if an _address is in the whitelisted * @param _address address of the strategy */ function isAuthorized(address _address) public view returns (bool) { return authorized.contains(_address); } /** * @notice View number of authorized */ function viewCountAuthorized() external view returns (uint256) { return authorized.length(); } /** * @notice See authorized in the system * @param cursor cursor (should start at 0 for first request) * @param size size of the response (e.g., 50) */ function viewAuthorized(uint256 cursor, uint256 size) external view returns (address[] memory, uint256) { uint256 length = size; if (length > authorized.length() - cursor) { length = authorized.length() - cursor; } address[] memory _authorized = new address[](length); for (uint256 i = 0; i < length; i++) { _authorized[i] = authorized.at(cursor + i); } return (_authorized, cursor + length); } }
// SPDX-License-Identifier: None pragma solidity ^0.8.1; import "@openzeppelin/contracts/access/Ownable.sol"; import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; contract Whitelist is Ownable { using EnumerableSet for EnumerableSet.AddressSet; EnumerableSet.AddressSet private whitelistedMap; bool public isPublicSale; event Whitelisted(address indexed account, bool isWhitelisted); event ChangeSaleType(bool _isPublicSale); /** * @dev Whitelist MarketPlace address and any contract address to approve. * @param _address address want to whitelist */ function addAddress(address _address) external onlyOwner { require( !whitelistedMap.contains(_address), "WhiteList: address already whitelisted" ); whitelistedMap.add(_address); emit Whitelisted(_address, true); } /** * @dev remove from Whitelist. */ function removeAddress(address _address) external onlyOwner { require( whitelistedMap.contains(_address), "WhiteList: address already removed" ); whitelistedMap.remove(_address); emit Whitelisted(_address, false); } /** * @dev chnage sale type is public or not. */ function changeSaleType(bool _isPublicSale) external onlyOwner { require(_isPublicSale != isPublicSale, " already set"); isPublicSale = _isPublicSale; emit ChangeSaleType(_isPublicSale); } /** * @notice Returns if an _address is in the whitelisted * @param _address address of the strategy */ function isWhitelisted(address _address) public view returns (bool) { return whitelistedMap.contains(_address); } /** * @notice View number of whitelisted */ function viewCountWhitelisted() external view returns (uint256) { return whitelistedMap.length(); } /** * @notice See whitelisted in the system * @param cursor cursor (should start at 0 for first request) * @param size size of the response (e.g., 50) */ function viewWhitelisted(uint256 cursor, uint256 size) external view returns (address[] memory, uint256) { uint256 length = size; if (length > whitelistedMap.length() - cursor) { length = whitelistedMap.length() - cursor; } address[] memory whitelisted = new address[](length); for (uint256 i = 0; i < length; i++) { whitelisted[i] = whitelistedMap.at(cursor + i); } return (whitelisted, cursor + length); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IRoyaltyFeeRegistry { function updateRoyaltyFeeLimitForERC721(uint256 _royaltyFeeLimit) external; function updateRoyaltyFeeLimitForERC1155(uint256 _royaltyFeeLimit) external; function updateRoyaltyReceiverLimit(uint256 newMaxNumberOfReceivers) external; function updateRoyaltyInfoForNFT( address collection, uint256 tokenId, address[] memory receivers, uint256[] memory fees ) external; function royaltyFeeInfoCollection(address collection) external view returns (address, uint256); function royaltyFeeInfoCollection(address collection, uint256 tokenId) external view returns (address[] memory, uint256[] memory); function removeRoyaltyInfoForNFT(address collection, uint256 tokenId) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol) pragma solidity ^0.8.9; import "../utils/Context.sol"; /** * @dev Context variant with ERC2771 support. */ abstract contract ERC2771Context is Context { /// @custom:oz-upgrades-unsafe-allow state-variable-immutable address private immutable _trustedForwarder; /// @custom:oz-upgrades-unsafe-allow constructor constructor(address trustedForwarder) { _trustedForwarder = trustedForwarder; } function isTrustedForwarder(address forwarder) public view virtual returns (bool) { return forwarder == _trustedForwarder; } function _msgSender() internal view virtual override returns (address sender) { if (isTrustedForwarder(msg.sender)) { // The assembly code is more direct than the Solidity version using `abi.decode`. /// @solidity memory-safe-assembly assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) } } else { return super._msgSender(); } } function _msgData() internal view virtual override returns (bytes calldata) { if (isTrustedForwarder(msg.sender)) { return msg.data[:msg.data.length - 20]; } else { return super._msgData(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981.sol"; import "../../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 EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @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 override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, 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 { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _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 { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _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 // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/extensions/ERC1155Supply.sol) pragma solidity ^0.8.0; import "../ERC1155.sol"; /** * @dev Extension of ERC1155 that adds tracking of total supply per id. * * Useful for scenarios where Fungible and Non-fungible tokens have to be * clearly identified. Note: While a totalSupply of 1 might mean the * corresponding is an NFT, there is no guarantees that no other token with the * same id are not going to be minted. */ abstract contract ERC1155Supply is ERC1155 { mapping(uint256 => uint256) private _totalSupply; /** * @dev Total amount of tokens in with a given id. */ function totalSupply(uint256 id) public view virtual returns (uint256) { return _totalSupply[id]; } /** * @dev Indicates whether any token exist with a given id, or not. */ function exists(uint256 id) public view virtual returns (bool) { return ERC1155Supply.totalSupply(id) > 0; } /** * @dev See {ERC1155-_beforeTokenTransfer}. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); if (from == address(0)) { for (uint256 i = 0; i < ids.length; ++i) { _totalSupply[ids[i]] += amounts[i]; } } if (to == address(0)) { for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 supply = _totalSupply[id]; require(supply >= amount, "ERC1155: burn amount exceeds totalSupply"); unchecked { _totalSupply[id] = supply - amount; } } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol) pragma solidity ^0.8.0; /** * @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. * * ``` * 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 of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @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._indexes[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 read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 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 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[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._indexes[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) { return _values(set._inner); } // 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; /// @solidity memory-safe-assembly assembly { 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 on 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; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../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. * * _Available since v4.5._ */ 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. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "./IERC1155.sol"; import "./IERC1155Receiver.sol"; import "./extensions/IERC1155MetadataURI.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: address zero is not a valid owner"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner nor approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner nor approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, to, ids, amounts, data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Emits a {TransferSingle} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn( address from, uint256 id, uint256 amount ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `ids` and `amounts` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_trustedForwarder","type":"address"},{"internalType":"address","name":"_royaltyRegistry","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_address","type":"address"}],"name":"AddAuthorized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","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":"_isPublicSale","type":"bool"}],"name":"ChangeSaleType","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_address","type":"address"}],"name":"RemoveAuthorized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"_oldLimit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_newLimit","type":"uint256"}],"name":"RoyalityLimitChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_address","type":"address"}],"name":"SetRoyaltyRegistry","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bool","name":"isWhitelisted","type":"bool"}],"name":"Whitelisted","type":"event"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"addAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_toAdd","type":"address"}],"name":"addAuthorized","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"string[]","name":"_uris","type":"string[]"},{"internalType":"uint96","name":"_feeNumerator","type":"uint96"},{"internalType":"address[]","name":"_receivers","type":"address[]"},{"internalType":"uint256[]","name":"_fees","type":"uint256[]"}],"name":"batchCreate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_limit","type":"uint256"}],"name":"changeLimitOfRoyality","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isPublicSale","type":"bool"}],"name":"changeSaleType","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"counterId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"uint96","name":"_feeNumerator","type":"uint96"},{"internalType":"address[]","name":"_receivers","type":"address[]"},{"internalType":"uint256[]","name":"_fees","type":"uint256[]"}],"name":"create","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"creators","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"initialOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"isAuthorized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPublicSale","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"isWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxRoyalty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"removeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_toRemove","type":"address"}],"name":"removeAuthorized","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"resetTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyRegistry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setRoyaltyRegistry","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":"setRoyaltyforToken","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":"id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"cursor","type":"uint256"},{"internalType":"uint256","name":"size","type":"uint256"}],"name":"viewAuthorized","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"viewCountAuthorized","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"viewCountWhitelisted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"cursor","type":"uint256"},{"internalType":"uint256","name":"size","type":"uint256"}],"name":"viewWhitelisted","outputs":[{"internalType":"address[]","name":"","type":"address[]"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6001600c5560c06040819052600060a0819052620000209160109162000235565b503480156200002e57600080fd5b5060405162003f6638038062003f668339810160408190526200005191620003c5565b60408051602081019091526000815282906200006d8162000171565b506001600160a01b03166080526200008e620000886200018a565b620001a6565b6001600160a01b03811615801590620000af57506001600160a01b03821615155b620001165760405162461bcd60e51b815260206004820152602d60248201527f455243313135352d4d75736963436f6c6c656374696f6e3a20696e76616c696460448201526c207a65726f206164647265737360981b606482015260840160405180910390fd5b83516200012b90600e90602087019062000235565b5082516200014190600f90602086019062000235565b50601380546001600160a01b0319166001600160a01b039290921691909117905550506107d0600d555062000491565b80516200018690600290602084019062000235565b5050565b6000620001a1620001f860201b6200198e1760201c565b905090565b600480546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6080516000906001600160a01b03163314156200021c575060131936013560601c90565b620001a16200023160201b620019d61760201c565b3390565b828054620002439062000454565b90600052602060002090601f016020900481019282620002675760008555620002b2565b82601f106200028257805160ff1916838001178555620002b2565b82800160010185558215620002b2579182015b82811115620002b257825182559160200191906001019062000295565b50620002c0929150620002c4565b5090565b5b80821115620002c05760008155600101620002c5565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200030357600080fd5b81516001600160401b0380821115620003205762000320620002db565b604051601f8301601f19908116603f011681019082821181831017156200034b576200034b620002db565b816040528381526020925086838588010111156200036857600080fd5b600091505b838210156200038c57858201830151818301840152908201906200036d565b838211156200039e5760008385830101525b9695505050505050565b80516001600160a01b0381168114620003c057600080fd5b919050565b60008060008060808587031215620003dc57600080fd5b84516001600160401b0380821115620003f457600080fd5b6200040288838901620002f1565b955060208701519150808211156200041957600080fd5b506200042887828801620002f1565b9350506200043960408601620003a8565b91506200044960608601620003a8565b905092959194509250565b600181811c908216806200046957607f821691505b602082108114156200048b57634e487b7160e01b600052602260045260246000fd5b50919050565b608051613ab2620004b46000396000818161042701526119920152613ab26000f3fe608060405234801561001057600080fd5b506004361061025d5760003560e01c806384a608e211610146578063cd53d08e116100c3578063ef9b750711610087578063ef9b7507146105e7578063f242432a146105fa578063f2fde38b1461060d578063f5298aca14610620578063fbe90b4d14610633578063fe9fbb801461063b57600080fd5b8063cd53d08e14610546578063cf1c316a1461056f578063d0a5e51e14610582578063d31883021461058a578063e985e9c5146105ab57600080fd5b80639b5342ab1161010a5780639b5342ab146104e0578063a11b0712146104f3578063a22cb46514610506578063a5a865dc14610519578063bd85b0391461052657600080fd5b806384a608e21461048e5780638a616bc0146104a15780638da5cb5b146104b457806394db6b07146104c557806395d89b41146104d857600080fd5b806338eada1c116101df5780634f558e79116101a35780634f558e79146103f5578063572b6c0514610417578063674a12c7146104575780636b20c45414610460578063715018a614610473578063807e9bae1461047b57600080fd5b806338eada1c146103895780633af32abf1461039c578063485d7d94146103af5780634ba79dfe146103c25780634e1273f4146103d557600080fd5b806312b73af41161022657806312b73af4146102e8578063207ce2fe146102f05780632a55205a146103315780632eb2c2d614610363578063315a403d1461037657600080fd5b8062fdd58e1461026257806301ffc9a71461028857806306fdde03146102ab5780630e89341c146102c05780630fee7d2a146102d3575b600080fd5b610275610270366004612b67565b61064e565b6040519081526020015b60405180910390f35b61029b610296366004612ba7565b6106e7565b604051901515815260200161027f565b6102b36106f2565b60405161027f9190612c1c565b6102b36102ce366004612c2f565b610780565b6102e66102e1366004612c2f565b610860565b005b6102756109a8565b6103196102fe366004612c2f565b6000908152601260205260409020546001600160a01b031690565b6040516001600160a01b03909116815260200161027f565b61034461033f366004612c48565b6109b9565b604080516001600160a01b03909316835260208301919091520161027f565b6102e6610371366004612db3565b610a67565b6102e6610384366004612e6c565b610ac5565b6102e6610397366004612e87565b610b5c565b61029b6103aa366004612e87565b610c1a565b6102e66103bd366004612e87565b610c27565b6102e66103d0366004612e87565b610d41565b6103e86103e3366004612f0f565b610df3565b60405161027f9190612fad565b61029b610403366004612c2f565b600090815260036020526040902054151590565b61029b610425366004612e87565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b610275600d5481565b6102e661046e366004612fc0565b610f1c565b6102e6610f76565b6102e661048936600461304a565b610f8a565b6102e661049c366004612e87565b61106e565b6102e66104af366004612c2f565b61119b565b6004546001600160a01b0316610319565b6102756104d3366004613086565b6111f3565b6102b361137a565b6102e66104ee3660046131ae565b611387565b601354610319906001600160a01b031681565b6102e6610514366004613230565b6114d2565b60095461029b9060ff1681565b610275610534366004612c2f565b60009081526003602052604090205490565b610319610554366004612c2f565b6012602052600090815260409020546001600160a01b031681565b6102e661057d366004612e87565b611569565b600c54610275565b61059d610598366004612c48565b611681565b60405161027f92919061329c565b61029b6105b93660046132be565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b61059d6105f5366004612c48565b611775565b6102e66106083660046132e8565b611850565b6102e661061b366004612e87565b6118a7565b6102e661062e36600461334c565b611920565b610275611975565b61029b610649366004612e87565b611981565b60006001600160a01b0383166106be5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006106e1826119da565b600e80546106ff9061337f565b80601f016020809104026020016040519081016040528092919081815260200182805461072b9061337f565b80156107785780601f1061074d57610100808354040283529160200191610778565b820191906000526020600020905b81548152906001019060200180831161075b57829003601f168201915b505050505081565b60008181526011602052604081208054606092919061079e9061337f565b80601f01602080910402602001604051908101604052809291908181526020018280546107ca9061337f565b80156108175780601f106107ec57610100808354040283529160200191610817565b820191906000526020600020905b8154815290600101906020018083116107fa57829003601f168201915b50505050509050600081511161083557610830836119ff565b610859565b6010816040516020016108499291906133d6565b6040516020818303038152906040525b9392505050565b610868611a93565b6127108111156108e2576040805162461bcd60e51b81526020600482015260248101919091527f455243313135352d4d75736963436f6c6c656374696f6e3a20726f79616c747960448201527f206d757374206265206c657373207468616e20657175616c20746f203130302560648201526084016106b5565b600d548181141561094e5760405162461bcd60e51b815260206004820152603060248201527f455243313135352d4d75736963436f6c6c656374696f6e3a206c696d6974206d60448201526f1d5cdd08189948191a5999995c995b9d60821b60648201526084016106b5565b600d8290557f24e9ac82874a292ce9f8cd8bab098623c61cf4c32301b7a050722aa0dd765e8561097c611b0c565b604080516001600160a01b03909216825260208201849052810184905260600160405180910390a15050565b60006109b46005611b16565b905090565b6000828152600b602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610a2e575060408051808201909152600a546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610a4d906001600160601b031687613493565b610a5791906134b2565b91519350909150505b9250929050565b610a6f611b0c565b6001600160a01b0316856001600160a01b03161480610a955750610a95856105b9611b0c565b610ab15760405162461bcd60e51b81526004016106b5906134d4565b610abe8585858585611b20565b5050505050565b610acd611a93565b60095460ff1615158115151415610b155760405162461bcd60e51b815260206004820152600c60248201526b08185b1c9958591e481cd95d60a21b60448201526064016106b5565b6009805460ff19168215159081179091556040519081527f91fc31429831c0c8ac26b9e7b1f6e2755d47bdfb3e8a18d8a7e37bca99b5a4849060200160405180910390a150565b610b64611a93565b610b6f600782611cd5565b15610bcb5760405162461bcd60e51b815260206004820152602660248201527f57686974654c6973743a206164647265737320616c72656164792077686974656044820152651b1a5cdd195960d21b60648201526084016106b5565b610bd6600782611cf7565b50604051600181526001600160a01b038216907fa54714518c5d275fdcd3d2a461e4858e4e8cb04fb93cd0bca9d6d34115f26440906020015b60405180910390a250565b60006106e1600783611cd5565b610c2f611a93565b6001600160a01b038116610c995760405162461bcd60e51b815260206004820152602b60248201527f417574686f72697a61626c653a205f746f52656d6f76652069736e277420766160448201526a696c64206164647265737360a81b60648201526084016106b5565b610ca4600582611cd5565b610cfe5760405162461bcd60e51b815260206004820152602560248201527f417574686f72697a61626c653a206164647265737320616c72656164792072656044820152641b5bdd995960da1b60648201526084016106b5565b610d09600582611d0c565b506040516001600160a01b038216907f6cb2a178f9ae3629708944a9acf87ec4168299dbe69adce578a7186a14902adf90600090a250565b610d49611a93565b610d54600782611cd5565b610dab5760405162461bcd60e51b815260206004820152602260248201527f57686974654c6973743a206164647265737320616c72656164792072656d6f76604482015261195960f21b60648201526084016106b5565b610db6600782611d0c565b50604051600081526001600160a01b038216907fa54714518c5d275fdcd3d2a461e4858e4e8cb04fb93cd0bca9d6d34115f2644090602001610c0f565b60608151835114610e585760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016106b5565b600083516001600160401b03811115610e7357610e73612c6a565b604051908082528060200260200182016040528015610e9c578160200160208202803683370190505b50905060005b8451811015610f1457610ee7858281518110610ec057610ec0613523565b6020026020010151858381518110610eda57610eda613523565b602002602001015161064e565b828281518110610ef957610ef9613523565b6020908102919091010152610f0d81613539565b9050610ea2565b509392505050565b610f24611b0c565b6001600160a01b0316836001600160a01b03161480610f4a5750610f4a836105b9611b0c565b610f665760405162461bcd60e51b81526004016106b590613554565b610f71838383611d21565b505050565b610f7e611a93565b610f886000611ec4565b565b82610f93611b0c565b6000828152601260205260409020546001600160a01b03908116911614610fcc5760405162461bcd60e51b81526004016106b5906135b1565b600d54826001600160601b0316111561105d5760405162461bcd60e51b815260206004820152604760248201527f455243313135352d4d75736963436f6c6c656374696f6e3a20726f79616c747960448201527f20666f7220746f6b656e206d757374206265206c657373207468616e206d6178606482015266526f79616c747960c81b608482015260a4016106b5565b611068848484611f16565b50505050565b611076611a93565b6001600160a01b0381166110dd5760405162461bcd60e51b815260206004820152602860248201527f455243313135352d4d75736963436f6c6c656374696f6e3a20696e76616c6964604482015267206164647265737360c01b60648201526084016106b5565b6013546001600160a01b03828116911614156111515760405162461bcd60e51b815260206004820152602d60248201527f455243313135352d4d75736963436f6c6c656374696f6e3a2073616d6520616460448201526c647265737320616c726561647960981b60648201526084016106b5565b601380546001600160a01b0319166001600160a01b0383169081179091556040517f43e78472550a1cafa06f3703ee455b86a8e0f3159f466f22e31112458e8da25390600090a250565b806111a4611b0c565b6000828152601260205260409020546001600160a01b039081169116146111dd5760405162461bcd60e51b81526004016106b5906135b1565b506000908152600b6020526040812055565b5050565b60006111fe33611981565b80611232575061120c611b0c565b6001600160a01b03166112276004546001600160a01b031690565b6001600160a01b0316145b61124e5760405162461bcd60e51b81526004016106b59061360f565b600c54600081815260126020526040902080546001600160a01b0319166001600160a01b038b1617905561129389828a60405180602001604052806000815250612024565b6112d38188888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061215292505050565b6001600160601b038516156112ed576112ed818a87611f16565b83511561135d57601354604051631a90740560e31b81526001600160a01b039091169063d483a0289061132a903090859089908990600401613664565b600060405180830381600087803b15801561134457600080fd5b505af1158015611358573d6000803e3d6000fd5b505050505b600c5461136b9060016136a8565b600c5598975050505050505050565b600f80546106ff9061337f565b61139033611981565b806113c4575061139e611b0c565b6001600160a01b03166113b96004546001600160a01b031690565b6001600160a01b0316145b6113e05760405162461bcd60e51b81526004016106b59061360f565b855184146114565760405162461bcd60e51b815260206004820152603c60248201527f455243313135352d4d75736963436f6c6c656374696f6e3a205f616d6f756e7460448201527f206c656e677468206d75737420626520657175616c20746f207572690000000060648201526084016106b5565b60005b86518160ff1610156114c8576114b588888360ff168151811061147e5761147e613523565b602002602001015188888560ff1681811061149b5761149b613523565b90506020028101906114ad91906136c0565b8888886111f3565b506114c1600182613706565b9050611459565b5050505050505050565b6001600160a01b0382163b1561155f576114eb82610c1a565b806114f8575060095460ff165b61155f5760405162461bcd60e51b815260206004820152603260248201527f455243313135352d4d75736963436f6c6c656374696f6e3a204f6e6c792077686044820152711a5d195b1a5cdd081a5cc8185b1b1bddd95960721b60648201526084016106b5565b6111ef82826121b6565b611571611a93565b6001600160a01b0381166115d85760405162461bcd60e51b815260206004820152602860248201527f417574686f72697a61626c653a205f746f4164642069736e2774207661696c64604482015267206164647265737360c01b60648201526084016106b5565b6115e3600582611cd5565b1561163e5760405162461bcd60e51b815260206004820152602560248201527f417574686f72697a61626c653a205f746f41646420697320616c726561647920604482015264185919195960da1b60648201526084016106b5565b611649600582611cf7565b506040516001600160a01b038216907fa6f04ef390ee5829dc9be99664fd8d9aeea059278dbda4f988499726455801ce90600090a250565b6060600082846116916007611b16565b61169b919061372b565b8111156116ba57846116ad6007611b16565b6116b7919061372b565b90505b6000816001600160401b038111156116d4576116d4612c6a565b6040519080825280602002602001820160405280156116fd578160200160208202803683370190505b50905060005b8281101561175c5761172061171882896136a8565b6007906121c8565b82828151811061173257611732613523565b6001600160a01b03909216602092830291909101909101528061175481613539565b915050611703565b508061176883886136a8565b9350935050509250929050565b6060600082846117856005611b16565b61178f919061372b565b8111156117ae57846117a16005611b16565b6117ab919061372b565b90505b6000816001600160401b038111156117c8576117c8612c6a565b6040519080825280602002602001820160405280156117f1578160200160208202803683370190505b50905060005b8281101561175c5761181461180c82896136a8565b6005906121c8565b82828151811061182657611826613523565b6001600160a01b03909216602092830291909101909101528061184881613539565b9150506117f7565b611858611b0c565b6001600160a01b0316856001600160a01b0316148061187e575061187e856105b9611b0c565b61189a5760405162461bcd60e51b81526004016106b5906134d4565b610abe85858585856121d4565b6118af611a93565b6001600160a01b0381166119145760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106b5565b61191d81611ec4565b50565b611928611b0c565b6001600160a01b0316836001600160a01b0316148061194e575061194e836105b9611b0c565b61196a5760405162461bcd60e51b81526004016106b590613554565b610f71838383612317565b60006109b46007611b16565b60006106e1600583611cd5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163314156119ce575060131936013560601c90565b503390565b90565b3390565b60006001600160e01b0319821663152a902d60e11b14806106e157506106e18261243a565b606060028054611a0e9061337f565b80601f0160208091040260200160405190810160405280929190818152602001828054611a3a9061337f565b8015611a875780601f10611a5c57610100808354040283529160200191611a87565b820191906000526020600020905b815481529060010190602001808311611a6a57829003601f168201915b50505050509050919050565b611a9b611b0c565b6001600160a01b0316611ab66004546001600160a01b031690565b6001600160a01b031614610f885760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106b5565b60006109b461198e565b60006106e1825490565b8151835114611b415760405162461bcd60e51b81526004016106b590613742565b6001600160a01b038416611b675760405162461bcd60e51b81526004016106b59061378a565b6000611b71611b0c565b9050611b8181878787878761248a565b60005b8451811015611c67576000858281518110611ba157611ba1613523565b602002602001015190506000858381518110611bbf57611bbf613523565b602090810291909101810151600084815280835260408082206001600160a01b038e168352909352919091205490915081811015611c0f5760405162461bcd60e51b81526004016106b5906137cf565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611c4c9084906136a8565b9250508190555050505080611c6090613539565b9050611b84565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611cb7929190613819565b60405180910390a4611ccd818787878787612603565b505050505050565b6001600160a01b03811660009081526001830160205260408120541515610859565b6000610859836001600160a01b03841661275f565b6000610859836001600160a01b0384166127ae565b6001600160a01b038316611d475760405162461bcd60e51b81526004016106b59061383e565b8051825114611d685760405162461bcd60e51b81526004016106b590613742565b6000611d72611b0c565b9050611d928185600086866040518060200160405280600081525061248a565b60005b8351811015611e57576000848281518110611db257611db2613523565b602002602001015190506000848381518110611dd057611dd0613523565b602090810291909101810151600084815280835260408082206001600160a01b038c168352909352919091205490915081811015611e205760405162461bcd60e51b81526004016106b590613881565b6000928352602083815260408085206001600160a01b038b1686529091529092209103905580611e4f81613539565b915050611d95565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611ea8929190613819565b60405180910390a4604080516020810190915260009052611068565b600480546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6127106001600160601b0382161115611f845760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084016106b5565b6001600160a01b038216611fda5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d6574657273000000000060448201526064016106b5565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182526000968752600b90529190942093519051909116600160a01b029116179055565b6001600160a01b0384166120845760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016106b5565b600061208e611b0c565b9050600061209b856128a1565b905060006120a8856128a1565b90506120b98360008985858961248a565b6000868152602081815260408083206001600160a01b038b168452909152812080548792906120e99084906136a8565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612149836000898989896128ec565b50505050505050565b6000828152601160209081526040909120825161217192840190612ab2565b50817f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b61219d84610780565b6040516121aa9190612c1c565b60405180910390a25050565b6111ef6121c1611b0c565b83836129a7565b60006108598383612a88565b6001600160a01b0384166121fa5760405162461bcd60e51b81526004016106b59061378a565b6000612204611b0c565b90506000612211856128a1565b9050600061221e856128a1565b905061222e83898985858961248a565b6000868152602081815260408083206001600160a01b038c1684529091529020548581101561226f5760405162461bcd60e51b81526004016106b5906137cf565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906122ac9084906136a8565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461230c848a8a8a8a8a6128ec565b505050505050505050565b6001600160a01b03831661233d5760405162461bcd60e51b81526004016106b59061383e565b6000612347611b0c565b90506000612354846128a1565b90506000612361846128a1565b90506123818387600085856040518060200160405280600081525061248a565b6000858152602081815260408083206001600160a01b038a168452909152902054848110156123c25760405162461bcd60e51b81526004016106b590613881565b6000868152602081815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052612149565b60006001600160e01b03198216636cdb3d1360e11b148061246b57506001600160e01b031982166303a24d0760e21b145b806106e157506301ffc9a760e01b6001600160e01b03198316146106e1565b6001600160a01b0385166125115760005b835181101561250f578281815181106124b6576124b6613523565b6020026020010151600360008684815181106124d4576124d4613523565b6020026020010151815260200190815260200160002060008282546124f991906136a8565b90915550612508905081613539565b905061249b565b505b6001600160a01b038416611ccd5760005b835181101561214957600084828151811061253f5761253f613523565b60200260200101519050600084838151811061255d5761255d613523565b60200260200101519050600060036000848152602001908152602001600020549050818110156125e05760405162461bcd60e51b815260206004820152602860248201527f455243313135353a206275726e20616d6f756e74206578636565647320746f74604482015267616c537570706c7960c01b60648201526084016106b5565b600092835260036020526040909220910390556125fc81613539565b9050612522565b6001600160a01b0384163b15611ccd5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061264790899089908890889088906004016138c5565b6020604051808303816000875af1925050508015612682575060408051601f3d908101601f1916820190925261267f91810190613923565b60015b61272f5761268e613940565b806308c379a014156126c857506126a361395b565b806126ae57506126ca565b8060405162461bcd60e51b81526004016106b59190612c1c565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016106b5565b6001600160e01b0319811663bc197c8160e01b146121495760405162461bcd60e51b81526004016106b5906139e4565b60008181526001830160205260408120546127a6575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556106e1565b5060006106e1565b600081815260018301602052604081205480156128975760006127d260018361372b565b85549091506000906127e69060019061372b565b905081811461284b57600086600001828154811061280657612806613523565b906000526020600020015490508087600001848154811061282957612829613523565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061285c5761285c613a2c565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506106e1565b60009150506106e1565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106128db576128db613523565b602090810291909101015292915050565b6001600160a01b0384163b15611ccd5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906129309089908990889088908890600401613a42565b6020604051808303816000875af192505050801561296b575060408051601f3d908101601f1916820190925261296891810190613923565b60015b6129775761268e613940565b6001600160e01b0319811663f23a6e6160e01b146121495760405162461bcd60e51b81526004016106b5906139e4565b816001600160a01b0316836001600160a01b03161415612a1b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016106b5565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000826000018281548110612a9f57612a9f613523565b9060005260206000200154905092915050565b828054612abe9061337f565b90600052602060002090601f016020900481019282612ae05760008555612b26565b82601f10612af957805160ff1916838001178555612b26565b82800160010185558215612b26579182015b82811115612b26578251825591602001919060010190612b0b565b50612b32929150612b36565b5090565b5b80821115612b325760008155600101612b37565b80356001600160a01b0381168114612b6257600080fd5b919050565b60008060408385031215612b7a57600080fd5b612b8383612b4b565b946020939093013593505050565b6001600160e01b03198116811461191d57600080fd5b600060208284031215612bb957600080fd5b813561085981612b91565b60005b83811015612bdf578181015183820152602001612bc7565b838111156110685750506000910152565b60008151808452612c08816020860160208601612bc4565b601f01601f19169290920160200192915050565b6020815260006108596020830184612bf0565b600060208284031215612c4157600080fd5b5035919050565b60008060408385031215612c5b57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715612ca557612ca5612c6a565b6040525050565b60006001600160401b03821115612cc557612cc5612c6a565b5060051b60200190565b600082601f830112612ce057600080fd5b81356020612ced82612cac565b604051612cfa8282612c80565b83815260059390931b8501820192828101915086841115612d1a57600080fd5b8286015b84811015612d355780358352918301918301612d1e565b509695505050505050565b600082601f830112612d5157600080fd5b81356001600160401b03811115612d6a57612d6a612c6a565b604051612d81601f8301601f191660200182612c80565b818152846020838601011115612d9657600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215612dcb57600080fd5b612dd486612b4b565b9450612de260208701612b4b565b935060408601356001600160401b0380821115612dfe57600080fd5b612e0a89838a01612ccf565b94506060880135915080821115612e2057600080fd5b612e2c89838a01612ccf565b93506080880135915080821115612e4257600080fd5b50612e4f88828901612d40565b9150509295509295909350565b80358015158114612b6257600080fd5b600060208284031215612e7e57600080fd5b61085982612e5c565b600060208284031215612e9957600080fd5b61085982612b4b565b600082601f830112612eb357600080fd5b81356020612ec082612cac565b604051612ecd8282612c80565b83815260059390931b8501820192828101915086841115612eed57600080fd5b8286015b84811015612d3557612f0281612b4b565b8352918301918301612ef1565b60008060408385031215612f2257600080fd5b82356001600160401b0380821115612f3957600080fd5b612f4586838701612ea2565b93506020850135915080821115612f5b57600080fd5b50612f6885828601612ccf565b9150509250929050565b600081518084526020808501945080840160005b83811015612fa257815187529582019590820190600101612f86565b509495945050505050565b6020815260006108596020830184612f72565b600080600060608486031215612fd557600080fd5b612fde84612b4b565b925060208401356001600160401b0380821115612ffa57600080fd5b61300687838801612ccf565b9350604086013591508082111561301c57600080fd5b5061302986828701612ccf565b9150509250925092565b80356001600160601b0381168114612b6257600080fd5b60008060006060848603121561305f57600080fd5b8335925061306f60208501612b4b565b915061307d60408501613033565b90509250925092565b600080600080600080600060c0888a0312156130a157600080fd5b6130aa88612b4b565b96506020880135955060408801356001600160401b03808211156130cd57600080fd5b818a0191508a601f8301126130e157600080fd5b8135818111156130f057600080fd5b8b602082850101111561310257600080fd5b602083019750955061311660608b01613033565b945060808a013591508082111561312c57600080fd5b6131388b838c01612ea2565b935060a08a013591508082111561314e57600080fd5b5061315b8a828b01612ccf565b91505092959891949750929550565b60008083601f84011261317c57600080fd5b5081356001600160401b0381111561319357600080fd5b6020830191508360208260051b8501011115610a6057600080fd5b600080600080600080600060c0888a0312156131c957600080fd5b6131d288612b4b565b965060208801356001600160401b03808211156131ee57600080fd5b6131fa8b838c01612ccf565b975060408a013591508082111561321057600080fd5b61321c8b838c0161316a565b909750955085915061311660608b01613033565b6000806040838503121561324357600080fd5b61324c83612b4b565b915061325a60208401612e5c565b90509250929050565b600081518084526020808501945080840160005b83811015612fa25781516001600160a01b031687529582019590820190600101613277565b6040815260006132af6040830185613263565b90508260208301529392505050565b600080604083850312156132d157600080fd5b6132da83612b4b565b915061325a60208401612b4b565b600080600080600060a0868803121561330057600080fd5b61330986612b4b565b945061331760208701612b4b565b9350604086013592506060860135915060808601356001600160401b0381111561334057600080fd5b612e4f88828901612d40565b60008060006060848603121561336157600080fd5b61336a84612b4b565b95602085013595506040909401359392505050565b600181811c9082168061339357607f821691505b602082108114156133b457634e487b7160e01b600052602260045260246000fd5b50919050565b600081516133cc818560208601612bc4565b9290920192915050565b600080845481600182811c9150808316806133f257607f831692505b602080841082141561341257634e487b7160e01b86526022600452602486fd5b818015613426576001811461343757613464565b60ff19861689528489019650613464565b60008b81526020902060005b8681101561345c5781548b820152908501908301613443565b505084890196505b50505050505061347481856133ba565b95945050505050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156134ad576134ad61347d565b500290565b6000826134cf57634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602f908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526e195c881b9bdc88185c1c1c9bdd9959608a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b600060001982141561354d5761354d61347d565b5060010190565b6020808252603e908201527f455243313135352d4d75736963436f6c6c656374696f6e3a2063616c6c65722060408201527f6973206e6f7420746f6b656e206f776e6572206f7220617070726f7665640000606082015260800190565b602080825260409082018190527f455243313135352d4d75736963436f6c6c656374696f6e3a206f6e6c7920696e908201527f697469616c206f776e65722063616e207365742074686520726f79616c697479606082015260800190565b60208082526035908201527f455243313135352d4d75736963436f6c6c656374696f6e3a2063616c6c6572206040820152741a5cc81b9bdd081d985b1a5908199bdc8818d85b1b605a1b606082015260800190565b60018060a01b038516815283602082015260806040820152600061368b6080830185613263565b828103606084015261369d8185612f72565b979650505050505050565b600082198211156136bb576136bb61347d565b500190565b6000808335601e198436030181126136d757600080fd5b8301803591506001600160401b038211156136f157600080fd5b602001915036819003821315610a6057600080fd5b600060ff821660ff84168060ff038211156137235761372361347d565b019392505050565b60008282101561373d5761373d61347d565b500390565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b60408152600061382c6040830185612f72565b82810360208401526134748185612f72565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6001600160a01b0386811682528516602082015260a0604082018190526000906138f190830186612f72565b82810360608401526139038186612f72565b905082810360808401526139178185612bf0565b98975050505050505050565b60006020828403121561393557600080fd5b815161085981612b91565b600060033d11156119d35760046000803e5060005160e01c90565b600060443d10156139695790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561399857505050505090565b82850191508151818111156139b05750505050505090565b843d87010160208285010111156139ca5750505050505090565b6139d960208286010187612c80565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061369d90830184612bf056fea2646970667358221220a63a1c28fd2730082a653d1b1f4005e0e81285baf6c2503d230432a34a334dfb64736f6c634300080b0033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000003de6b7eea508d747a0fa14a3809cff3ced60f89c0000000000000000000000005c0b0afa0d59fb9c8176f9715c98b3492af9ca3e00000000000000000000000000000000000000000000000000000000000000104d757369632d436f6c6c656374696f6e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000094c4e512d4d757369630000000000000000000000000000000000000000000000
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000003de6b7eea508d747a0fa14a3809cff3ced60f89c0000000000000000000000005c0b0afa0d59fb9c8176f9715c98b3492af9ca3e00000000000000000000000000000000000000000000000000000000000000104d757369632d436f6c6c656374696f6e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000094c4e512d4d757369630000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _name (string): Music-Collection
Arg [1] : _symbol (string): LNQ-Music
Arg [2] : _trustedForwarder (address): 0x3de6b7eea508d747a0fa14a3809cff3ced60f89c
Arg [3] : _royaltyRegistry (address): 0x5c0b0afa0d59fb9c8176f9715c98b3492af9ca3e
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 0000000000000000000000003de6b7eea508d747a0fa14a3809cff3ced60f89c
Arg [3] : 0000000000000000000000005c0b0afa0d59fb9c8176f9715c98b3492af9ca3e
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000010
Arg [5] : 4d757369632d436f6c6c656374696f6e00000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000009
Arg [7] : 4c4e512d4d757369630000000000000000000000000000000000000000000000