Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
107558362 | 494 days ago | 0 ETH | ||||
107558361 | 494 days ago | 0 ETH | ||||
107558358 | 494 days ago | 0 ETH | ||||
107558300 | 494 days ago | 0 ETH | ||||
107558276 | 494 days ago | 0 ETH | ||||
107558230 | 494 days ago | 0 ETH | ||||
107558213 | 494 days ago | 0 ETH | ||||
107558177 | 494 days ago | 0 ETH | ||||
107558091 | 494 days ago | 0 ETH | ||||
107558086 | 494 days ago | 0 ETH | ||||
107558074 | 494 days ago | 0 ETH | ||||
107558060 | 494 days ago | 0 ETH | ||||
107557956 | 494 days ago | 0 ETH | ||||
107557811 | 494 days ago | 0 ETH | ||||
107557810 | 494 days ago | 0 ETH | ||||
107557792 | 494 days ago | 0 ETH | ||||
107557789 | 494 days ago | 0 ETH | ||||
107557777 | 494 days ago | 0 ETH | ||||
107557767 | 494 days ago | 0 ETH | ||||
107557723 | 494 days ago | 0 ETH | ||||
107557646 | 494 days ago | 0 ETH | ||||
107557638 | 494 days ago | 0 ETH | ||||
107557634 | 494 days ago | 0 ETH | ||||
107557632 | 494 days ago | 0 ETH | ||||
107557626 | 494 days ago | 0 ETH |
Loading...
Loading
Contract Name:
ERC1155CreatorImplementation
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 250 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@manifoldxyz/libraries-solidity/contracts/access/AdminControlUpgradeable.sol"; import "./core/ERC1155CreatorCore.sol"; import "./token/ERC1155/ERC1155Upgradeable.sol"; /** * @dev ERC1155Creator implementation */ contract ERC1155CreatorImplementation is AdminControlUpgradeable, ERC1155Upgradeable, ERC1155CreatorCore { using EnumerableSet for EnumerableSet.AddressSet; mapping(uint256 => uint256) private _totalSupply; /** * Initializer */ function initialize(string memory _name, string memory _symbol) public initializer { __ERC1155_init(_name, _symbol); __Ownable_init(); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155Core, ERC1155CreatorCore, AdminControlUpgradeable) returns (bool) { return ERC1155CreatorCore.supportsInterface(interfaceId) || ERC1155Core.supportsInterface(interfaceId) || AdminControlUpgradeable.supportsInterface(interfaceId); } function _beforeTokenTransfer(address, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory) internal virtual override { _approveTransfer(from, to, ids, amounts); } /** * @dev See {ICreatorCore-registerExtension}. */ function registerExtension(address extension, string calldata baseURI) external override adminRequired { requireNonBlacklist(extension); _registerExtension(extension, baseURI, false); } /** * @dev See {ICreatorCore-registerExtension}. */ function registerExtension(address extension, string calldata baseURI, bool baseURIIdentical) external override adminRequired { requireNonBlacklist(extension); _registerExtension(extension, baseURI, baseURIIdentical); } /** * @dev See {ICreatorCore-unregisterExtension}. */ function unregisterExtension(address extension) external override adminRequired { _unregisterExtension(extension); } /** * @dev See {ICreatorCore-blacklistExtension}. */ function blacklistExtension(address extension) external override adminRequired { _blacklistExtension(extension); } /** * @dev See {ICreatorCore-setBaseTokenURIExtension}. */ function setBaseTokenURIExtension(string calldata uri_) external override { requireExtension(); _setBaseTokenURIExtension(uri_, false); } /** * @dev See {ICreatorCore-setBaseTokenURIExtension}. */ function setBaseTokenURIExtension(string calldata uri_, bool identical) external override { requireExtension(); _setBaseTokenURIExtension(uri_, identical); } /** * @dev See {ICreatorCore-setTokenURIPrefixExtension}. */ function setTokenURIPrefixExtension(string calldata prefix) external override { requireExtension(); _setTokenURIPrefixExtension(prefix); } /** * @dev See {ICreatorCore-setTokenURIExtension}. */ function setTokenURIExtension(uint256 tokenId, string calldata uri_) external override { requireExtension(); _setTokenURIExtension(tokenId, uri_); } /** * @dev See {ICreatorCore-setTokenURIExtension}. */ function setTokenURIExtension(uint256[] calldata tokenIds, string[] calldata uris) external override { requireExtension(); require(tokenIds.length == uris.length, "Invalid input"); for (uint i; i < tokenIds.length;) { _setTokenURIExtension(tokenIds[i], uris[i]); unchecked { ++i; } } } /** * @dev See {ICreatorCore-setBaseTokenURI}. */ function setBaseTokenURI(string calldata uri_) external override adminRequired { _setBaseTokenURI(uri_); } /** * @dev See {ICreatorCore-setTokenURIPrefix}. */ function setTokenURIPrefix(string calldata prefix) external override adminRequired { _setTokenURIPrefix(prefix); } /** * @dev See {ICreatorCore-setTokenURI}. */ function setTokenURI(uint256 tokenId, string calldata uri_) external override adminRequired { _setTokenURI(tokenId, uri_); } /** * @dev See {ICreatorCore-setTokenURI}. */ function setTokenURI(uint256[] calldata tokenIds, string[] calldata uris) external override adminRequired { require(tokenIds.length == uris.length, "Invalid input"); for (uint i; i < tokenIds.length;) { _setTokenURI(tokenIds[i], uris[i]); unchecked { ++i; } } } /** * @dev See {ICreatorCore-setMintPermissions}. */ function setMintPermissions(address extension, address permissions) external override adminRequired { _setMintPermissions(extension, permissions); } /** * @dev See {IERC1155CreatorCore-mintBaseNew}. */ function mintBaseNew(address[] calldata to, uint256[] calldata amounts, string[] calldata uris) public virtual override nonReentrant adminRequired returns(uint256[] memory) { return _mintNew(address(0), to, amounts, uris); } /** * @dev See {IERC1155CreatorCore-mintBaseExisting}. */ function mintBaseExisting(address[] calldata to, uint256[] calldata tokenIds, uint256[] calldata amounts) public virtual override nonReentrant adminRequired { for (uint i; i < tokenIds.length;) { uint256 tokenId = tokenIds[i]; require(tokenId > 0 && tokenId <= _tokenCount, "Invalid token"); require(_tokenExtension(tokenId) == address(0), "Token created by extension"); unchecked { ++i; } } _mintExisting(address(0), to, tokenIds, amounts); } /** * @dev See {IERC1155CreatorCore-mintExtensionNew}. */ function mintExtensionNew(address[] calldata to, uint256[] calldata amounts, string[] calldata uris) public virtual override nonReentrant returns(uint256[] memory tokenIds) { requireExtension(); return _mintNew(msg.sender, to, amounts, uris); } /** * @dev See {IERC1155CreatorCore-mintExtensionExisting}. */ function mintExtensionExisting(address[] calldata to, uint256[] calldata tokenIds, uint256[] calldata amounts) public virtual override nonReentrant { requireExtension(); for (uint i; i < tokenIds.length;) { require(_tokenExtension(tokenIds[i]) == address(msg.sender), "Token not created by this extension"); unchecked { ++i; } } _mintExisting(msg.sender, to, tokenIds, amounts); } /** * @dev Mint new tokens */ function _mintNew(address extension, address[] calldata to, uint256[] calldata amounts, string[] calldata uris) internal returns(uint256[] memory tokenIds) { if (to.length > 1) { // Multiple receiver. Give every receiver the same new token tokenIds = new uint256[](1); require(uris.length <= 1 && (amounts.length == 1 || to.length == amounts.length), "Invalid input"); } else { // Single receiver. Generating multiple tokens tokenIds = new uint256[](amounts.length); require(uris.length == 0 || amounts.length == uris.length, "Invalid input"); } // Assign tokenIds for (uint i; i < tokenIds.length;) { ++_tokenCount; tokenIds[i] = _tokenCount; // Track the extension that minted the token _tokensExtension[_tokenCount] = extension; unchecked { ++i; } } if (extension != address(0)) { _checkMintPermissions(to, tokenIds, amounts); } if (to.length == 1 && tokenIds.length == 1) { // Single mint _mint(to[0], tokenIds[0], amounts[0], new bytes(0)); } else if (to.length > 1) { // Multiple receivers. Receiving the same token if (amounts.length == 1) { // Everyone receiving the same amount for (uint i; i < to.length;) { _mint(to[i], tokenIds[0], amounts[0], new bytes(0)); unchecked { ++i; } } } else { // Everyone receiving different amounts for (uint i; i < to.length;) { _mint(to[i], tokenIds[0], amounts[i], new bytes(0)); unchecked { ++i; } } } } else { _mintBatch(to[0], tokenIds, amounts, new bytes(0)); } for (uint i; i < tokenIds.length;) { if (i < uris.length && bytes(uris[i]).length > 0) { _tokenURIs[tokenIds[i]] = uris[i]; } unchecked { ++i; } } } /** * @dev Mint existing tokens */ function _mintExisting(address extension, address[] calldata to, uint256[] calldata tokenIds, uint256[] calldata amounts) internal { if (extension != address(0)) { _checkMintPermissions(to, tokenIds, amounts); } if (to.length == 1 && tokenIds.length == 1 && amounts.length == 1) { // Single mint _mint(to[0], tokenIds[0], amounts[0], new bytes(0)); } else if (to.length == 1 && tokenIds.length == amounts.length) { // Batch mint to same receiver _mintBatch(to[0], tokenIds, amounts, new bytes(0)); } else if (tokenIds.length == 1 && amounts.length == 1) { // Mint of the same token/token amounts to various receivers for (uint i; i < to.length;) { _mint(to[i], tokenIds[0], amounts[0], new bytes(0)); unchecked { ++i; } } } else if (tokenIds.length == 1 && to.length == amounts.length) { // Mint of the same token with different amounts to different receivers for (uint i; i < to.length;) { _mint(to[i], tokenIds[0], amounts[i], new bytes(0)); unchecked { ++i; } } } else if (to.length == tokenIds.length && to.length == amounts.length) { // Mint of different tokens and different amounts to different receivers for (uint i; i < to.length;) { _mint(to[i], tokenIds[i], amounts[i], new bytes(0)); unchecked { ++i; } } } else { revert("Invalid input"); } } /** * @dev See {IERC1155CreatorCore-tokenExtension}. */ function tokenExtension(uint256 tokenId) public view virtual override returns (address extension) { extension = _tokenExtension(tokenId); require(extension != address(0), "No extension for token"); require(!_blacklistedExtensions.contains(extension), "Extension blacklisted"); } /** * @dev See {IERC1155CreatorCore-burn}. */ function burn(address account, uint256[] calldata tokenIds, uint256[] calldata amounts) public virtual override nonReentrant { require(account == msg.sender || isApprovedForAll(account, msg.sender), "Caller is not owner or approved"); require(tokenIds.length == amounts.length, "Invalid input"); if (tokenIds.length == 1) { _burn(account, tokenIds[0], amounts[0]); } else { _burnBatch(account, tokenIds, amounts); } _postBurn(account, tokenIds, amounts); } /** * @dev See {ICreatorCore-setRoyalties}. */ function setRoyalties(address payable[] calldata receivers, uint256[] calldata basisPoints) external override adminRequired { _setRoyaltiesExtension(address(0), receivers, basisPoints); } /** * @dev See {ICreatorCore-setRoyalties}. */ function setRoyalties(uint256 tokenId, address payable[] calldata receivers, uint256[] calldata basisPoints) external override adminRequired { _setRoyalties(tokenId, receivers, basisPoints); } /** * @dev See {ICreatorCore-setRoyaltiesExtension}. */ function setRoyaltiesExtension(address extension, address payable[] calldata receivers, uint256[] calldata basisPoints) external override adminRequired { _setRoyaltiesExtension(extension, receivers, basisPoints); } /** * @dev See {ICreatorCore-getRoyalties}. */ function getRoyalties(uint256 tokenId) external view virtual override returns (address payable[] memory, uint256[] memory) { return _getRoyalties(tokenId); } /** * @dev See {ICreatorCore-getFees}. */ function getFees(uint256 tokenId) external view virtual override returns (address payable[] memory, uint256[] memory) { return _getRoyalties(tokenId); } /** * @dev See {ICreatorCore-getFeeRecipients}. */ function getFeeRecipients(uint256 tokenId) external view virtual override returns (address payable[] memory) { return _getRoyaltyReceivers(tokenId); } /** * @dev See {ICreatorCore-getFeeBps}. */ function getFeeBps(uint256 tokenId) external view virtual override returns (uint[] memory) { return _getRoyaltyBPS(tokenId); } /** * @dev See {ICreatorCore-royaltyInfo}. */ function royaltyInfo(uint256 tokenId, uint256 value) external view virtual override returns (address, uint256) { return _getRoyaltyInfo(tokenId, value); } /** * @dev See {IERC1155MetadataURI-uri}. */ function uri(uint256 tokenId) public view virtual override returns (string memory) { return _tokenURI(tokenId); } /** * @dev Total amount of tokens in with a given id. */ function totalSupply(uint256 tokenId) external view virtual override returns (uint256) { return _totalSupply[tokenId]; } /** * @dev See {ERC1155-_mint}. */ function _mint(address account, uint256 id, uint256 amount, bytes memory data) internal virtual override { super._mint(account, id, amount, data); _totalSupply[id] += amount; } /** * @dev See {ERC1155-_mintBatch}. */ function _mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal virtual override { super._mintBatch(to, ids, amounts, data); for (uint i; i < ids.length;) { _totalSupply[ids[i]] += amounts[i]; unchecked { ++i; } } } /** * @dev See {ERC1155-_burn}. */ function _burn(address account, uint256 id, uint256 amount) internal virtual override { super._burn(account, id, amount); _totalSupply[id] -= amount; } /** * @dev See {ERC1155-_burnBatch}. */ function _burnBatch(address account, uint256[] memory ids, uint256[] memory amounts) internal virtual override { super._burnBatch(account, ids, amounts); for (uint i; i < ids.length;) { _totalSupply[ids[i]] -= amounts[i]; unchecked { ++i; } } } /** * @dev See {ICreatorCore-setApproveTransfer}. */ function setApproveTransfer(address extension) external override adminRequired { _setApproveTransferBase(extension); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "./IAdminControl.sol"; abstract contract AdminControlUpgradeable is OwnableUpgradeable, IAdminControl, ERC165 { using EnumerableSet for EnumerableSet.AddressSet; // Track registered admins EnumerableSet.AddressSet private _admins; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IAdminControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Only allows approved admins to call the specified function */ modifier adminRequired() { require(owner() == msg.sender || _admins.contains(msg.sender), "AdminControl: Must be owner or admin"); _; } /** * @dev See {IAdminControl-getAdmins}. */ function getAdmins() external view override returns (address[] memory admins) { admins = new address[](_admins.length()); for (uint i = 0; i < _admins.length(); i++) { admins[i] = _admins.at(i); } return admins; } /** * @dev See {IAdminControl-approveAdmin}. */ function approveAdmin(address admin) external override onlyOwner { if (!_admins.contains(admin)) { emit AdminApproved(admin, msg.sender); _admins.add(admin); } } /** * @dev See {IAdminControl-revokeAdmin}. */ function revokeAdmin(address admin) external override onlyOwner { if (_admins.contains(admin)) { emit AdminRevoked(admin, msg.sender); _admins.remove(admin); } } /** * @dev See {IAdminControl-isAdmin}. */ function isAdmin(address admin) public override view returns (bool) { return (owner() == admin || _admins.contains(admin)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "../extensions/ERC1155/IERC1155CreatorExtensionApproveTransfer.sol"; import "../extensions/ERC1155/IERC1155CreatorExtensionBurnable.sol"; import "../permissions/ERC1155/IERC1155CreatorMintPermissions.sol"; import "./IERC1155CreatorCore.sol"; import "./CreatorCore.sol"; /** * @dev Core ERC1155 creator implementation */ abstract contract ERC1155CreatorCore is CreatorCore, IERC1155CreatorCore { uint256 constant public VERSION = 3; using EnumerableSet for EnumerableSet.AddressSet; // Track registered extensions data mapping (address => bool) internal _extensionApproveTransfers; mapping (address => address) internal _extensionPermissions; // For tracking which extension a token was minted by mapping (uint256 => address) internal _tokensExtension; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(CreatorCore, IERC165) returns (bool) { return interfaceId == type(IERC1155CreatorCore).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {CreatorCore-_setApproveTransferExtension} */ function _setApproveTransferExtension(address extension, bool enabled) internal override { if (ERC165Checker.supportsInterface(extension, type(IERC1155CreatorExtensionApproveTransfer).interfaceId)) { _extensionApproveTransfers[extension] = enabled; emit ExtensionApproveTransferUpdated(extension, enabled); } } /** * @dev Set mint permissions for an extension */ function _setMintPermissions(address extension, address permissions) internal { require(_extensions.contains(extension), "Invalid extension"); require(permissions == address(0) || ERC165Checker.supportsInterface(permissions, type(IERC1155CreatorMintPermissions).interfaceId), "Invalid address"); if (_extensionPermissions[extension] != permissions) { _extensionPermissions[extension] = permissions; emit MintPermissionsUpdated(extension, permissions, msg.sender); } } /** * If mint permissions have been set for an extension (extensions can mint by default), * check if an extension can mint via the permission contract's approveMint function. */ function _checkMintPermissions(address[] memory to, uint256[] memory tokenIds, uint256[] memory amounts) internal { if (_extensionPermissions[msg.sender] != address(0)) { IERC1155CreatorMintPermissions(_extensionPermissions[msg.sender]).approveMint(msg.sender, to, tokenIds, amounts); } } /** * Post burn actions */ function _postBurn(address owner, uint256[] calldata tokenIds, uint256[] calldata amounts) internal virtual { require(tokenIds.length > 0, "Invalid input"); address extension = _tokensExtension[tokenIds[0]]; for (uint i; i < tokenIds.length;) { require(_tokensExtension[tokenIds[i]] == extension, "Mismatched token originators"); unchecked { ++i; } } // Callback to originating extension if needed if (extension != address(0)) { if (ERC165Checker.supportsInterface(extension, type(IERC1155CreatorExtensionBurnable).interfaceId)) { IERC1155CreatorExtensionBurnable(extension).onBurn(owner, tokenIds, amounts); } } } /** * Approve a transfer */ function _approveTransfer(address from, address to, uint256[] memory tokenIds, uint256[] memory amounts) internal { // Do not need to approve mints if (from == address(0)) return; address extension = _tokensExtension[tokenIds[0]]; for (uint i; i < tokenIds.length;) { require(_tokensExtension[tokenIds[i]] == extension, "Mismatched token originators"); unchecked { ++i; } } if (extension != address(0) && _extensionApproveTransfers[extension]) { require(IERC1155CreatorExtensionApproveTransfer(extension).approveTransfer(msg.sender, from, to, tokenIds, amounts), "Extension approval failure"); } else if (_approveTransferBase != address(0)) { require(IERC1155CreatorExtensionApproveTransfer(_approveTransferBase).approveTransfer(msg.sender, from, to, tokenIds, amounts), "Extension approval failure"); } } function _tokenExtension(uint256 tokenId) internal view override returns(address) { return _tokensExtension[tokenId]; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC1155Core.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-1155[ERC1155] Non-Fungible Token Standard, */ abstract contract ERC1155Upgradeable is Initializable, ERC1155Core { /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ function __ERC1155_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC1155_init_unchained(name_, symbol_); } function __ERC1155_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _name = name_; _symbol = symbol_; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. 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) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @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 in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// 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.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _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); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /** * @dev Interface for admin control */ interface IAdminControl is IERC165 { event AdminApproved(address indexed account, address indexed sender); event AdminRevoked(address indexed account, address indexed sender); /** * @dev gets address of all admins */ function getAdmins() external view returns (address[] memory); /** * @dev add an admin. Can only be called by contract owner. */ function approveAdmin(address admin) external; /** * @dev remove an admin. Can only be called by contract owner. */ function revokeAdmin(address admin) external; /** * @dev checks whether or not given address is an admin * Returns True if they are */ function isAdmin(address admin) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /** * Implement this if you want your extension to approve a transfer */ interface IERC1155CreatorExtensionApproveTransfer is IERC165 { /** * @dev Set whether or not the creator contract will check the extension for approval of token transfer */ function setApproveTransfer(address creator, bool enabled) external; /** * @dev Called by creator contract to approve a transfer */ function approveTransfer(address operator, address from, address to, uint256[] calldata tokenIds, uint256[] calldata amounts) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /** * @dev Your extension is required to implement this interface if it wishes * to receive the onBurn callback whenever a token the extension created is * burned */ interface IERC1155CreatorExtensionBurnable is IERC165 { /** * @dev callback handler for burn events */ function onBurn(address owner, uint256[] calldata tokenIds, uint256[] calldata amounts) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155Creator compliant extension contracts. */ interface IERC1155CreatorMintPermissions is IERC165 { /** * @dev get approval to mint */ function approveMint(address extension, address[] calldata to, uint256[] calldata tokenIds, uint256[] calldata amounts) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "./CreatorCore.sol"; /** * @dev Core ERC1155 creator interface */ interface IERC1155CreatorCore is ICreatorCore { /** * @dev mint a token with no extension. Can only be called by an admin. * * @param to - Can be a single element array (all tokens go to same address) or multi-element array (single token to many recipients) * @param amounts - Can be a single element array (all recipients get the same amount) or a multi-element array * @param uris - If no elements, all tokens use the default uri. * If any element is an empty string, the corresponding token uses the default uri. * * * Requirements: If to is a multi-element array, then uris must be empty or single element array * If to is a multi-element array, then amounts must be a single element array or a multi-element array of the same size * If to is a single element array, uris must be empty or the same length as amounts * * Examples: * mintBaseNew(['0x....1', '0x....2'], [1], []) * Mints a single new token, and gives 1 each to '0x....1' and '0x....2'. Token uses default uri. * * mintBaseNew(['0x....1', '0x....2'], [1, 2], []) * Mints a single new token, and gives 1 to '0x....1' and 2 to '0x....2'. Token uses default uri. * * mintBaseNew(['0x....1'], [1, 2], ["", "http://token2.com"]) * Mints two new tokens to '0x....1'. 1 of the first token, 2 of the second. 1st token uses default uri, second uses "http://token2.com". * * @return Returns list of tokenIds minted */ function mintBaseNew(address[] calldata to, uint256[] calldata amounts, string[] calldata uris) external returns (uint256[] memory); /** * @dev batch mint existing token with no extension. Can only be called by an admin. * * @param to - Can be a single element array (all tokens go to same address) or multi-element array (single token to many recipients) * @param tokenIds - Can be a single element array (all recipients get the same token) or a multi-element array * @param amounts - Can be a single element array (all recipients get the same amount) or a multi-element array * * Requirements: If any of the parameters are multi-element arrays, they need to be the same length as other multi-element arrays * * Examples: * mintBaseExisting(['0x....1', '0x....2'], [1], [10]) * Mints 10 of tokenId 1 to each of '0x....1' and '0x....2'. * * mintBaseExisting(['0x....1', '0x....2'], [1, 2], [10, 20]) * Mints 10 of tokenId 1 to '0x....1' and 20 of tokenId 2 to '0x....2'. * * mintBaseExisting(['0x....1'], [1, 2], [10, 20]) * Mints 10 of tokenId 1 and 20 of tokenId 2 to '0x....1'. * * mintBaseExisting(['0x....1', '0x....2'], [1], [10, 20]) * Mints 10 of tokenId 1 to '0x....1' and 20 of tokenId 1 to '0x....2'. * */ function mintBaseExisting(address[] calldata to, uint256[] calldata tokenIds, uint256[] calldata amounts) external; /** * @dev mint a token from an extension. Can only be called by a registered extension. * * @param to - Can be a single element array (all tokens go to same address) or multi-element array (single token to many recipients) * @param amounts - Can be a single element array (all recipients get the same amount) or a multi-element array * @param uris - If no elements, all tokens use the default uri. * If any element is an empty string, the corresponding token uses the default uri. * * * Requirements: If to is a multi-element array, then uris must be empty or single element array * If to is a multi-element array, then amounts must be a single element array or a multi-element array of the same size * If to is a single element array, uris must be empty or the same length as amounts * * Examples: * mintExtensionNew(['0x....1', '0x....2'], [1], []) * Mints a single new token, and gives 1 each to '0x....1' and '0x....2'. Token uses default uri. * * mintExtensionNew(['0x....1', '0x....2'], [1, 2], []) * Mints a single new token, and gives 1 to '0x....1' and 2 to '0x....2'. Token uses default uri. * * mintExtensionNew(['0x....1'], [1, 2], ["", "http://token2.com"]) * Mints two new tokens to '0x....1'. 1 of the first token, 2 of the second. 1st token uses default uri, second uses "http://token2.com". * * @return Returns list of tokenIds minted */ function mintExtensionNew(address[] calldata to, uint256[] calldata amounts, string[] calldata uris) external returns (uint256[] memory); /** * @dev batch mint existing token from extension. Can only be called by a registered extension. * * @param to - Can be a single element array (all tokens go to same address) or multi-element array (single token to many recipients) * @param tokenIds - Can be a single element array (all recipients get the same token) or a multi-element array * @param amounts - Can be a single element array (all recipients get the same amount) or a multi-element array * * Requirements: If any of the parameters are multi-element arrays, they need to be the same length as other multi-element arrays * * Examples: * mintExtensionExisting(['0x....1', '0x....2'], [1], [10]) * Mints 10 of tokenId 1 to each of '0x....1' and '0x....2'. * * mintExtensionExisting(['0x....1', '0x....2'], [1, 2], [10, 20]) * Mints 10 of tokenId 1 to '0x....1' and 20 of tokenId 2 to '0x....2'. * * mintExtensionExisting(['0x....1'], [1, 2], [10, 20]) * Mints 10 of tokenId 1 and 20 of tokenId 2 to '0x....1'. * * mintExtensionExisting(['0x....1', '0x....2'], [1], [10, 20]) * Mints 10 of tokenId 1 to '0x....1' and 20 of tokenId 1 to '0x....2'. * */ function mintExtensionExisting(address[] calldata to, uint256[] calldata tokenIds, uint256[] calldata amounts) external; /** * @dev burn tokens. Can only be called by token owner or approved address. * On burn, calls back to the registered extension's onBurn method */ function burn(address account, uint256[] calldata tokenIds, uint256[] calldata amounts) external; /** * @dev Total amount of tokens in with a given tokenId. */ function totalSupply(uint256 tokenId) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "../extensions/ICreatorExtensionTokenURI.sol"; import "../extensions/ICreatorExtensionRoyalties.sol"; import "./ICreatorCore.sol"; /** * @dev Core creator implementation */ abstract contract CreatorCore is ReentrancyGuard, ICreatorCore, ERC165 { using Strings for uint256; using EnumerableSet for EnumerableSet.AddressSet; using AddressUpgradeable for address; uint256 internal _tokenCount = 0; // Base approve transfers address location address internal _approveTransferBase; // Track registered extensions data EnumerableSet.AddressSet internal _extensions; EnumerableSet.AddressSet internal _blacklistedExtensions; // The baseURI for a given extension mapping (address => string) private _extensionBaseURI; mapping (address => bool) private _extensionBaseURIIdentical; // The prefix for any tokens with a uri configured mapping (address => string) private _extensionURIPrefix; // Mapping for individual token URIs mapping (uint256 => string) internal _tokenURIs; // Royalty configurations struct RoyaltyConfig { address payable receiver; uint16 bps; } mapping (address => RoyaltyConfig[]) internal _extensionRoyalty; mapping (uint256 => RoyaltyConfig[]) internal _tokenRoyalty; bytes4 private constant _CREATOR_CORE_V1 = 0x28f10a21; /** * External interface identifiers for royalties */ /** * @dev CreatorCore * * bytes4(keccak256('getRoyalties(uint256)')) == 0xbb3bafd6 * * => 0xbb3bafd6 = 0xbb3bafd6 */ bytes4 private constant _INTERFACE_ID_ROYALTIES_CREATORCORE = 0xbb3bafd6; /** * @dev Rarible: RoyaltiesV1 * * bytes4(keccak256('getFeeRecipients(uint256)')) == 0xb9c4d9fb * bytes4(keccak256('getFeeBps(uint256)')) == 0x0ebd4c7f * * => 0xb9c4d9fb ^ 0x0ebd4c7f = 0xb7799584 */ bytes4 private constant _INTERFACE_ID_ROYALTIES_RARIBLE = 0xb7799584; /** * @dev Foundation * * bytes4(keccak256('getFees(uint256)')) == 0xd5a06d4c * * => 0xd5a06d4c = 0xd5a06d4c */ bytes4 private constant _INTERFACE_ID_ROYALTIES_FOUNDATION = 0xd5a06d4c; /** * @dev EIP-2981 * * bytes4(keccak256("royaltyInfo(uint256,uint256)")) == 0x2a55205a * * => 0x2a55205a = 0x2a55205a */ bytes4 private constant _INTERFACE_ID_ROYALTIES_EIP2981 = 0x2a55205a; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(ICreatorCore).interfaceId || interfaceId == _CREATOR_CORE_V1 || super.supportsInterface(interfaceId) || interfaceId == _INTERFACE_ID_ROYALTIES_CREATORCORE || interfaceId == _INTERFACE_ID_ROYALTIES_RARIBLE || interfaceId == _INTERFACE_ID_ROYALTIES_FOUNDATION || interfaceId == _INTERFACE_ID_ROYALTIES_EIP2981; } /** * @dev Only allows registered extensions to call the specified function */ function requireExtension() internal view { require(_extensions.contains(msg.sender), "Must be registered extension"); } /** * @dev Only allows non-blacklisted extensions */ function requireNonBlacklist(address extension) internal view { require(!_blacklistedExtensions.contains(extension), "Extension blacklisted"); } /** * @dev See {ICreatorCore-getExtensions}. */ function getExtensions() external view override returns (address[] memory extensions) { extensions = new address[](_extensions.length()); for (uint i; i < _extensions.length();) { extensions[i] = _extensions.at(i); unchecked { ++i; } } return extensions; } /** * @dev Register an extension */ function _registerExtension(address extension, string calldata baseURI, bool baseURIIdentical) internal virtual { require(extension != address(this) && extension.isContract(), "Invalid"); emit ExtensionRegistered(extension, msg.sender); _extensionBaseURI[extension] = baseURI; _extensionBaseURIIdentical[extension] = baseURIIdentical; _extensions.add(extension); _setApproveTransferExtension(extension, true); } /** * @dev See {ICreatorCore-setApproveTransferExtension}. */ function setApproveTransferExtension(bool enabled) external override { requireExtension(); _setApproveTransferExtension(msg.sender, enabled); } /** * @dev Set whether or not tokens minted by the extension defers transfer approvals to the extension */ function _setApproveTransferExtension(address extension, bool enabled) internal virtual; /** * @dev Unregister an extension */ function _unregisterExtension(address extension) internal { emit ExtensionUnregistered(extension, msg.sender); _extensions.remove(extension); } /** * @dev Blacklist an extension */ function _blacklistExtension(address extension) internal { require(extension != address(0) && extension != address(this), "Cannot blacklist yourself"); if (_extensions.contains(extension)) { emit ExtensionUnregistered(extension, msg.sender); _extensions.remove(extension); } if (!_blacklistedExtensions.contains(extension)) { emit ExtensionBlacklisted(extension, msg.sender); _blacklistedExtensions.add(extension); } } /** * @dev Set base token uri for an extension */ function _setBaseTokenURIExtension(string calldata uri, bool identical) internal { _extensionBaseURI[msg.sender] = uri; _extensionBaseURIIdentical[msg.sender] = identical; } /** * @dev Set token uri prefix for an extension */ function _setTokenURIPrefixExtension(string calldata prefix) internal { _extensionURIPrefix[msg.sender] = prefix; } /** * @dev Set token uri for a token of an extension */ function _setTokenURIExtension(uint256 tokenId, string calldata uri) internal { require(_tokenExtension(tokenId) == msg.sender, "Invalid token"); _tokenURIs[tokenId] = uri; } /** * @dev Set base token uri for tokens with no extension */ function _setBaseTokenURI(string calldata uri) internal { _extensionBaseURI[address(0)] = uri; } /** * @dev Set token uri prefix for tokens with no extension */ function _setTokenURIPrefix(string calldata prefix) internal { _extensionURIPrefix[address(0)] = prefix; } /** * @dev Set token uri for a token with no extension */ function _setTokenURI(uint256 tokenId, string calldata uri) internal { require(tokenId > 0 && tokenId <= _tokenCount && _tokenExtension(tokenId) == address(0), "Invalid token"); _tokenURIs[tokenId] = uri; } /** * @dev Retrieve a token's URI */ function _tokenURI(uint256 tokenId) internal view returns (string memory) { require(tokenId > 0 && tokenId <= _tokenCount, "Invalid token"); address extension = _tokenExtension(tokenId); require(!_blacklistedExtensions.contains(extension), "Extension blacklisted"); if (bytes(_tokenURIs[tokenId]).length != 0) { if (bytes(_extensionURIPrefix[extension]).length != 0) { return string(abi.encodePacked(_extensionURIPrefix[extension], _tokenURIs[tokenId])); } return _tokenURIs[tokenId]; } if (ERC165Checker.supportsInterface(extension, type(ICreatorExtensionTokenURI).interfaceId)) { return ICreatorExtensionTokenURI(extension).tokenURI(address(this), tokenId); } if (!_extensionBaseURIIdentical[extension]) { return string(abi.encodePacked(_extensionBaseURI[extension], tokenId.toString())); } else { return _extensionBaseURI[extension]; } } /** * Helper to get royalties for a token */ function _getRoyalties(uint256 tokenId) view internal returns (address payable[] memory receivers, uint256[] memory bps) { // Get token level royalties RoyaltyConfig[] memory royalties = _tokenRoyalty[tokenId]; if (royalties.length == 0) { // Get extension specific royalties address extension = _tokenExtension(tokenId); if (extension != address(0)) { if (ERC165Checker.supportsInterface(extension, type(ICreatorExtensionRoyalties).interfaceId)) { (receivers, bps) = ICreatorExtensionRoyalties(extension).getRoyalties(address(this), tokenId); // Extension override exists, just return that if (receivers.length > 0) return (receivers, bps); } royalties = _extensionRoyalty[extension]; } } if (royalties.length == 0) { // Get the default royalty royalties = _extensionRoyalty[address(0)]; } if (royalties.length > 0) { receivers = new address payable[](royalties.length); bps = new uint256[](royalties.length); for (uint i; i < royalties.length;) { receivers[i] = royalties[i].receiver; bps[i] = royalties[i].bps; unchecked { ++i; } } } } /** * Helper to get royalty receivers for a token */ function _getRoyaltyReceivers(uint256 tokenId) view internal returns (address payable[] memory recievers) { (recievers, ) = _getRoyalties(tokenId); } /** * Helper to get royalty basis points for a token */ function _getRoyaltyBPS(uint256 tokenId) view internal returns (uint256[] memory bps) { (, bps) = _getRoyalties(tokenId); } function _getRoyaltyInfo(uint256 tokenId, uint256 value) view internal returns (address receiver, uint256 amount){ (address payable[] memory receivers, uint256[] memory bps) = _getRoyalties(tokenId); require(receivers.length <= 1, "More than 1 royalty receiver"); if (receivers.length == 0) { return (address(this), 0); } return (receivers[0], bps[0]*value/10000); } /** * Set royalties for a token */ function _setRoyalties(uint256 tokenId, address payable[] calldata receivers, uint256[] calldata basisPoints) internal { _checkRoyalties(receivers, basisPoints); delete _tokenRoyalty[tokenId]; _setRoyalties(receivers, basisPoints, _tokenRoyalty[tokenId]); emit RoyaltiesUpdated(tokenId, receivers, basisPoints); } /** * Set royalties for all tokens of an extension */ function _setRoyaltiesExtension(address extension, address payable[] calldata receivers, uint256[] calldata basisPoints) internal { _checkRoyalties(receivers, basisPoints); delete _extensionRoyalty[extension]; _setRoyalties(receivers, basisPoints, _extensionRoyalty[extension]); if (extension == address(0)) { emit DefaultRoyaltiesUpdated(receivers, basisPoints); } else { emit ExtensionRoyaltiesUpdated(extension, receivers, basisPoints); } } /** * Helper function to check that royalties provided are valid */ function _checkRoyalties(address payable[] calldata receivers, uint256[] calldata basisPoints) private pure { require(receivers.length == basisPoints.length, "Invalid input"); uint256 totalBasisPoints; for (uint i; i < basisPoints.length;) { totalBasisPoints += basisPoints[i]; unchecked { ++i; } } require(totalBasisPoints < 10000, "Invalid total royalties"); } /** * Helper function to set royalties */ function _setRoyalties(address payable[] calldata receivers, uint256[] calldata basisPoints, RoyaltyConfig[] storage royalties) private { for (uint i; i < basisPoints.length;) { royalties.push( RoyaltyConfig( { receiver: receivers[i], bps: uint16(basisPoints[i]) } ) ); unchecked { ++i; } } } /** * @dev Set the base contract's approve transfer contract location */ function _setApproveTransferBase(address extension) internal { _approveTransferBase = extension; emit ApproveTransferUpdated(extension); } /** * @dev See {ICreatorCore-getApproveTransfer}. */ function getApproveTransfer() external view override returns (address) { return _approveTransferBase; } /** * @dev Get the extension for the given token */ function _tokenExtension(uint256 tokenId) internal virtual view returns(address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/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._ */ abstract contract ERC1155Core is ERC165, IERC1155, IERC1155MetadataURI { using Address for address; // Token name string internal _name; // Token symbol string internal _symbol; // 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; /** * @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 {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; } function name() public view virtual returns (string memory) { return _name; } function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(msg.sender, 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 == msg.sender || isApprovedForAll(from, msg.sender), "ERC1155: caller is not token owner or 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 == msg.sender || isApprovedForAll(from, msg.sender), "ERC1155: caller is not token owner or 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 = msg.sender; 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 = msg.sender; _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 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 = msg.sender; 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 = msg.sender; _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 = msg.sender; 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 = msg.sender; _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.8.1) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// 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 v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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 ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/introspection/ERC165Checker.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Library used to query support of an interface declared via {IERC165}. * * Note that these functions return the actual result of the query: they do not * `revert` if an interface is not supported. It is up to the caller to decide * what to do in these cases. */ library ERC165Checker { // As per the EIP-165 spec, no interface should ever match 0xffffffff bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff; /** * @dev Returns true if `account` supports the {IERC165} interface. */ function supportsERC165(address account) internal view returns (bool) { // Any contract that implements ERC165 must explicitly indicate support of // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid return supportsERC165InterfaceUnchecked(account, type(IERC165).interfaceId) && !supportsERC165InterfaceUnchecked(account, _INTERFACE_ID_INVALID); } /** * @dev Returns true if `account` supports the interface defined by * `interfaceId`. Support for {IERC165} itself is queried automatically. * * See {IERC165-supportsInterface}. */ function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) { // query support of both ERC165 as per the spec and support of _interfaceId return supportsERC165(account) && supportsERC165InterfaceUnchecked(account, interfaceId); } /** * @dev Returns a boolean array where each value corresponds to the * interfaces passed in and whether they're supported or not. This allows * you to batch check interfaces for a contract where your expectation * is that some interfaces may not be supported. * * See {IERC165-supportsInterface}. * * _Available since v3.4._ */ function getSupportedInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool[] memory) { // an array of booleans corresponding to interfaceIds and whether they're supported or not bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length); // query support of ERC165 itself if (supportsERC165(account)) { // query support of each interface in interfaceIds for (uint256 i = 0; i < interfaceIds.length; i++) { interfaceIdsSupported[i] = supportsERC165InterfaceUnchecked(account, interfaceIds[i]); } } return interfaceIdsSupported; } /** * @dev Returns true if `account` supports all the interfaces defined in * `interfaceIds`. Support for {IERC165} itself is queried automatically. * * Batch-querying can lead to gas savings by skipping repeated checks for * {IERC165} support. * * See {IERC165-supportsInterface}. */ function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) { // query support of ERC165 itself if (!supportsERC165(account)) { return false; } // query support of each interface in interfaceIds for (uint256 i = 0; i < interfaceIds.length; i++) { if (!supportsERC165InterfaceUnchecked(account, interfaceIds[i])) { return false; } } // all interfaces supported return true; } /** * @notice Query if a contract implements an interface, does not check ERC165 support * @param account The address of the contract to query for support of an interface * @param interfaceId The interface identifier, as specified in ERC-165 * @return true if the contract at account indicates support of the interface with * identifier interfaceId, false otherwise * @dev Assumes that account contains a contract that supports ERC165, otherwise * the behavior of this method is undefined. This precondition can be checked * with {supportsERC165}. * Interface identification is specified in ERC-165. */ function supportsERC165InterfaceUnchecked(address account, bytes4 interfaceId) internal view returns (bool) { // prepare call bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId); // perform static call bool success; uint256 returnSize; uint256 returnValue; assembly { success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20) returnSize := returndatasize() returnValue := mload(0x00) } return success && returnSize >= 0x20 && returnValue > 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /** * @dev Implement this if you want your extension to have overloadable URI's */ interface ICreatorExtensionTokenURI is IERC165 { /** * Get the uri for a given creator/tokenId */ function tokenURI(address creator, uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /** * @dev Implement this if you want your extension to have overloadable royalties */ interface ICreatorExtensionRoyalties is IERC165 { /** * Get the royalties for a given creator/tokenId */ function getRoyalties(address creator, uint256 tokenId) external view returns (address payable[] memory, uint256[] memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /** * @dev Core creator interface */ interface ICreatorCore is IERC165 { event ExtensionRegistered(address indexed extension, address indexed sender); event ExtensionUnregistered(address indexed extension, address indexed sender); event ExtensionBlacklisted(address indexed extension, address indexed sender); event MintPermissionsUpdated(address indexed extension, address indexed permissions, address indexed sender); event RoyaltiesUpdated(uint256 indexed tokenId, address payable[] receivers, uint256[] basisPoints); event DefaultRoyaltiesUpdated(address payable[] receivers, uint256[] basisPoints); event ApproveTransferUpdated(address extension); event ExtensionRoyaltiesUpdated(address indexed extension, address payable[] receivers, uint256[] basisPoints); event ExtensionApproveTransferUpdated(address indexed extension, bool enabled); /** * @dev gets address of all extensions */ function getExtensions() external view returns (address[] memory); /** * @dev add an extension. Can only be called by contract owner or admin. * extension address must point to a contract implementing ICreatorExtension. * Returns True if newly added, False if already added. */ function registerExtension(address extension, string calldata baseURI) external; /** * @dev add an extension. Can only be called by contract owner or admin. * extension address must point to a contract implementing ICreatorExtension. * Returns True if newly added, False if already added. */ function registerExtension(address extension, string calldata baseURI, bool baseURIIdentical) external; /** * @dev add an extension. Can only be called by contract owner or admin. * Returns True if removed, False if already removed. */ function unregisterExtension(address extension) external; /** * @dev blacklist an extension. Can only be called by contract owner or admin. * This function will destroy all ability to reference the metadata of any tokens created * by the specified extension. It will also unregister the extension if needed. * Returns True if removed, False if already removed. */ function blacklistExtension(address extension) external; /** * @dev set the baseTokenURI of an extension. Can only be called by extension. */ function setBaseTokenURIExtension(string calldata uri) external; /** * @dev set the baseTokenURI of an extension. Can only be called by extension. * For tokens with no uri configured, tokenURI will return "uri+tokenId" */ function setBaseTokenURIExtension(string calldata uri, bool identical) external; /** * @dev set the common prefix of an extension. Can only be called by extension. * If configured, and a token has a uri set, tokenURI will return "prefixURI+tokenURI" * Useful if you want to use ipfs/arweave */ function setTokenURIPrefixExtension(string calldata prefix) external; /** * @dev set the tokenURI of a token extension. Can only be called by extension that minted token. */ function setTokenURIExtension(uint256 tokenId, string calldata uri) external; /** * @dev set the tokenURI of a token extension for multiple tokens. Can only be called by extension that minted token. */ function setTokenURIExtension(uint256[] memory tokenId, string[] calldata uri) external; /** * @dev set the baseTokenURI for tokens with no extension. Can only be called by owner/admin. * For tokens with no uri configured, tokenURI will return "uri+tokenId" */ function setBaseTokenURI(string calldata uri) external; /** * @dev set the common prefix for tokens with no extension. Can only be called by owner/admin. * If configured, and a token has a uri set, tokenURI will return "prefixURI+tokenURI" * Useful if you want to use ipfs/arweave */ function setTokenURIPrefix(string calldata prefix) external; /** * @dev set the tokenURI of a token with no extension. Can only be called by owner/admin. */ function setTokenURI(uint256 tokenId, string calldata uri) external; /** * @dev set the tokenURI of multiple tokens with no extension. Can only be called by owner/admin. */ function setTokenURI(uint256[] memory tokenIds, string[] calldata uris) external; /** * @dev set a permissions contract for an extension. Used to control minting. */ function setMintPermissions(address extension, address permissions) external; /** * @dev Configure so transfers of tokens created by the caller (must be extension) gets approval * from the extension before transferring */ function setApproveTransferExtension(bool enabled) external; /** * @dev get the extension of a given token */ function tokenExtension(uint256 tokenId) external view returns (address); /** * @dev Set default royalties */ function setRoyalties(address payable[] calldata receivers, uint256[] calldata basisPoints) external; /** * @dev Set royalties of a token */ function setRoyalties(uint256 tokenId, address payable[] calldata receivers, uint256[] calldata basisPoints) external; /** * @dev Set royalties of an extension */ function setRoyaltiesExtension(address extension, address payable[] calldata receivers, uint256[] calldata basisPoints) external; /** * @dev Get royalites of a token. Returns list of receivers and basisPoints */ function getRoyalties(uint256 tokenId) external view returns (address payable[] memory, uint256[] memory); // Royalty support for various other standards function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory); function getFeeBps(uint256 tokenId) external view returns (uint[] memory); function getFees(uint256 tokenId) external view returns (address payable[] memory, uint256[] memory); function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address, uint256); /** * @dev Set the default approve transfer contract location. */ function setApproveTransfer(address extension) external; /** * @dev Get the default approve transfer contract location. */ function getApproveTransfer() external view returns (address); }
// 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
{ "remappings": [ "@ensdomains/=node_modules/@ensdomains/", "@manifoldxyz/=node_modules/@manifoldxyz/", "@openzeppelin/=node_modules/@openzeppelin/", "ds-test/=lib/forge-std/lib/ds-test/src/", "eth-gas-reporter/=node_modules/eth-gas-reporter/", "forge-std/=lib/forge-std/src/", "hardhat/=node_modules/hardhat/" ], "optimizer": { "enabled": true, "runs": 250 }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"AdminApproved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"AdminRevoked","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":"address","name":"extension","type":"address"}],"name":"ApproveTransferUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address payable[]","name":"receivers","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"basisPoints","type":"uint256[]"}],"name":"DefaultRoyaltiesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extension","type":"address"},{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"ExtensionApproveTransferUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extension","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"ExtensionBlacklisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extension","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"ExtensionRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extension","type":"address"},{"indexed":false,"internalType":"address payable[]","name":"receivers","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"basisPoints","type":"uint256[]"}],"name":"ExtensionRoyaltiesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extension","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"ExtensionUnregistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extension","type":"address"},{"indexed":true,"internalType":"address","name":"permissions","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"MintPermissionsUpdated","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":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address payable[]","name":"receivers","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"basisPoints","type":"uint256[]"}],"name":"RoyaltiesUpdated","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"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"approveAdmin","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":"extension","type":"address"}],"name":"blacklistExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAdmins","outputs":[{"internalType":"address[]","name":"admins","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getApproveTransfer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getExtensions","outputs":[{"internalType":"address[]","name":"extensions","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getFeeBps","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getFeeRecipients","outputs":[{"internalType":"address payable[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getFees","outputs":[{"internalType":"address payable[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRoyalties","outputs":[{"internalType":"address payable[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"to","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"mintBaseExisting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"string[]","name":"uris","type":"string[]"}],"name":"mintBaseNew","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"mintExtensionExisting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"string[]","name":"uris","type":"string[]"}],"name":"mintExtensionNew","outputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"extension","type":"address"},{"internalType":"string","name":"baseURI","type":"string"}],"name":"registerExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"extension","type":"address"},{"internalType":"string","name":"baseURI","type":"string"},{"internalType":"bool","name":"baseURIIdentical","type":"bool"}],"name":"registerExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"revokeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"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":"extension","type":"address"}],"name":"setApproveTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setApproveTransferExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"}],"name":"setBaseTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"}],"name":"setBaseTokenURIExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"},{"internalType":"bool","name":"identical","type":"bool"}],"name":"setBaseTokenURIExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"extension","type":"address"},{"internalType":"address","name":"permissions","type":"address"}],"name":"setMintPermissions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address payable[]","name":"receivers","type":"address[]"},{"internalType":"uint256[]","name":"basisPoints","type":"uint256[]"}],"name":"setRoyalties","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable[]","name":"receivers","type":"address[]"},{"internalType":"uint256[]","name":"basisPoints","type":"uint256[]"}],"name":"setRoyalties","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"extension","type":"address"},{"internalType":"address payable[]","name":"receivers","type":"address[]"},{"internalType":"uint256[]","name":"basisPoints","type":"uint256[]"}],"name":"setRoyaltiesExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"uri_","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"string[]","name":"uris","type":"string[]"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"string[]","name":"uris","type":"string[]"}],"name":"setTokenURIExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"uri_","type":"string"}],"name":"setTokenURIExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"prefix","type":"string"}],"name":"setTokenURIPrefix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"prefix","type":"string"}],"name":"setTokenURIPrefixExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenExtension","outputs":[{"internalType":"address","name":"extension","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","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":"address","name":"extension","type":"address"}],"name":"unregisterExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040526000606c553480156200001657600080fd5b506001606555620000266200002c565b620000ee565b600054610100900460ff1615620000995760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000ec576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b615ff080620000fe6000396000f3fe608060405234801561001057600080fd5b506004361061030b5760003560e01c8063695c96e61161019d578063b9c4d9fb116100e9578063e92a89f6116100a2578063f242432a1161007c578063f242432a146106ec578063f2fde38b146106ff578063feeb5a9a14610712578063ffa1ad741461072557600080fd5b8063e92a89f6146106b3578063e985e9c5146106c6578063f0cdc499146106d957600080fd5b8063b9c4d9fb14610639578063bb3bafd61461064c578063bd85b0391461066d578063ce8aee9d1461068d578063d5a06d4c1461064c578063e6c884dc146106a057600080fd5b80638da5cb5b11610156578063a22cb46511610130578063a22cb465146105ed578063aafb2d4414610600578063ac0c8cfa14610613578063b0fe87c91461062657600080fd5b80638da5cb5b146105c157806395d89b41146105d257806399e0dd7c146105da57600080fd5b8063695c96e6146105655780636d73e66914610578578063715018a61461058b57806382dcc0c81461059357806383b7db63146105a65780638c6e8472146105ae57600080fd5b80632eb2c2d61161025c5780633e6134b8116102155780634e1273f4116101ef5780634e1273f414610519578063596798ad1461052c57806361e5bc6b1461053f57806366d1e9d01461055257600080fd5b80633e6134b8146104e05780633f0f37f6146104f35780634cd88b761461050657600080fd5b80632eb2c2d61461046c57806330176e131461047f5780633071a0f91461049257806331ae450b146104a5578063332dd1ae146104ba5780633db0f8ab146104cd57600080fd5b8063162094c4116102c9578063239be317116102a3578063239be3171461040157806324d7806c146104145780632a55205a146104275780632d3456701461045957600080fd5b8063162094c4146103b657806320e4afe2146103c957806322f374d0146103dc57600080fd5b8062fdd58e1461031057806301ffc9a71461033657806302e7afb71461035957806306fdde031461036e5780630e89341c146103835780630ebd4c7f14610396575b600080fd5b61032361031e366004614adf565b61072d565b6040519081526020015b60405180910390f35b610349610344366004614b21565b6107c8565b604051901515815260200161032d565b61036c610367366004614b3e565b6107f1565b005b610376610847565b60405161032d9190614bab565b610376610391366004614bbe565b6108d9565b6103a96103a4366004614bbe565b6108e4565b60405161032d9190614c12565b61036c6103c4366004614c66565b6108ef565b61036c6103d7366004614cf5565b610949565b606d546001600160a01b03165b6040516001600160a01b03909116815260200161032d565b6103e961040f366004614bbe565b6109a7565b610349610422366004614b3e565b610a61565b61043a610435366004614d6e565b610a9a565b604080516001600160a01b03909316835260208301919091520161032d565b61036c610467366004614b3e565b610ab3565b61036c61047a366004614ee9565b610b10565b61036c61048d366004614f96565b610b55565b61036c6104a0366004614fd7565b610ba9565b6104ad610c09565b60405161032d919061504b565b61036c6104c836600461505e565b610cb7565b61036c6104db3660046150c9565b610d15565b61036c6104ee366004614f96565b610e74565b61036c610501366004615116565b610e88565b61036c61051436600461517d565b610ee7565b6103a96105273660046151e0565b611003565b61036c61053a366004614b3e565b61112c565b61036c61054d36600461505e565b61117f565b61036c610560366004614f96565b6111fe565b61036c6105733660046152a2565b611210565b61036c610586366004614b3e565b611369565b61036c6113c1565b61036c6105a136600461533b565b6113d5565b6104ad6113e8565b6103a96105bc3660046152a2565b611488565b6033546001600160a01b03166103e9565b6103766114bf565b61036c6105e8366004614f96565b6114ce565b61036c6105fb366004615391565b611522565b61036c61060e36600461505e565b61152d565b61036c6106213660046153ca565b6115ee565b61036c6106343660046150c9565b611600565b6104ad610647366004614bbe565b611657565b61065f61065a366004614bbe565b611662565b60405161032d9291906153e7565b61032361067b366004614bbe565b6000908152607b602052604090205490565b61036c61069b366004614b3e565b611677565b61036c6106ae3660046152a2565b6116ca565b61036c6106c1366004614c66565b611797565b6103496106d4366004615415565b6117aa565b61036c6106e7366004615415565b6117d8565b61036c6106fa366004615443565b61182c565b61036c61070d366004614b3e565b611871565b6103a96107203660046152a2565b6118e7565b610323600381565b60006001600160a01b03831661079d5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000818152606a602090815260408083206001600160a01b03861684529091529020545b92915050565b60006107d38261194b565b806107e257506107e282611970565b806107c257506107c2826119ab565b336108046033546001600160a01b031690565b6001600160a01b0316148061081f575061081f6066336119e0565b61083b5760405162461bcd60e51b8152600401610794906154ab565b61084481611a05565b50565b606060688054610856906154ef565b80601f0160208091040260200160405190810160405280929190818152602001828054610882906154ef565b80156108cf5780601f106108a4576101008083540402835291602001916108cf565b820191906000526020600020905b8154815290600101906020018083116108b257829003601f168201915b5050505050905090565b60606107c282611b15565b60606107c282611e04565b336109026033546001600160a01b031690565b6001600160a01b0316148061091d575061091d6066336119e0565b6109395760405162461bcd60e51b8152600401610794906154ab565b610944838383611e0f565b505050565b3361095c6033546001600160a01b031690565b6001600160a01b0316148061097757506109776066336119e0565b6109935760405162461bcd60e51b8152600401610794906154ab565b6109a08585858585611ea1565b5050505050565b6000818152607a60205260409020546001600160a01b031680610a0c5760405162461bcd60e51b815260206004820152601660248201527f4e6f20657874656e73696f6e20666f7220746f6b656e000000000000000000006044820152606401610794565b610a176070826119e0565b15610a5c5760405162461bcd60e51b8152602060048201526015602482015274115e1d195b9cda5bdb88189b1858dadb1a5cdd1959605a1b6044820152606401610794565b919050565b6000816001600160a01b0316610a7f6033546001600160a01b031690565b6001600160a01b031614806107c257506107c26066836119e0565b600080610aa78484611f28565b915091505b9250929050565b610abb611fff565b610ac66066826119e0565b156108445760405133906001600160a01b038316907f7c0c3c84c67c85fcac635147348bfe374c24a1a93d0366d1cfe9d8853cbf89d590600090a3610b0c606682612059565b5050565b6001600160a01b038516331480610b2c5750610b2c85336117aa565b610b485760405162461bcd60e51b815260040161079490615523565b6109a0858585858561206e565b33610b686033546001600160a01b031690565b6001600160a01b03161480610b835750610b836066336119e0565b610b9f5760405162461bcd60e51b8152600401610794906154ab565b610b0c8282612213565b33610bbc6033546001600160a01b031690565b6001600160a01b03161480610bd75750610bd76066336119e0565b610bf35760405162461bcd60e51b8152600401610794906154ab565b610bfc83612248565b6109448383836000612298565b6060610c156066612385565b6001600160401b03811115610c2c57610c2c614d90565b604051908082528060200260200182016040528015610c55578160200160208202803683370190505b50905060005b610c656066612385565b811015610cb357610c7760668261238f565b828281518110610c8957610c89615571565b6001600160a01b039092166020928302919091019091015280610cab8161559d565b915050610c5b565b5090565b33610cca6033546001600160a01b031690565b6001600160a01b03161480610ce55750610ce56066336119e0565b610d015760405162461bcd60e51b8152600401610794906154ab565b610d0f60008585858561239b565b50505050565b610d1d612488565b6001600160a01b038516331480610d395750610d3985336117aa565b610d855760405162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206973206e6f74206f776e6572206f7220617070726f766564006044820152606401610794565b828114610da45760405162461bcd60e51b8152600401610794906155b6565b6001839003610def57610dea8585856000818110610dc457610dc4615571565b9050602002013584846000818110610dde57610dde615571565b905060200201356124e1565b610e5d565b610e5d858585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060408051602080890282810182019093528882529093508892508791829185019084908082843760009201919091525061251492505050565b610e6a858585858561258d565b6109a06001606555565b610e7c61271f565b610b0c82826000612776565b33610e9b6033546001600160a01b031690565b6001600160a01b03161480610eb65750610eb66066336119e0565b610ed25760405162461bcd60e51b8152600401610794906154ab565b610edb84612248565b610d0f84848484612298565b600054610100900460ff1615808015610f075750600054600160ff909116105b80610f215750303b158015610f21575060005460ff166001145b610f845760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610794565b6000805460ff191660011790558015610fa7576000805461ff0019166101001790555b610fb183836127b3565b610fb96127e4565b8015610944576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b606081518351146110685760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610794565b600083516001600160401b0381111561108357611083614d90565b6040519080825280602002602001820160405280156110ac578160200160208202803683370190505b50905060005b8451811015611124576110f78582815181106110d0576110d0615571565b60200260200101518583815181106110ea576110ea615571565b602002602001015161072d565b82828151811061110957611109615571565b602090810291909101015261111d8161559d565b90506110b2565b509392505050565b3361113f6033546001600160a01b031690565b6001600160a01b0316148061115a575061115a6066336119e0565b6111765760405162461bcd60e51b8152600401610794906154ab565b61084481612813565b61118761271f565b8281146111a65760405162461bcd60e51b8152600401610794906155b6565b60005b838110156109a0576111f68585838181106111c6576111c6615571565b905060200201358484848181106111df576111df615571565b90506020028101906111f191906155dd565b612867565b6001016111a9565b61120661271f565b610b0c8282612886565b611218612488565b3361122b6033546001600160a01b031690565b6001600160a01b0316148061124657506112466066336119e0565b6112625760405162461bcd60e51b8152600401610794906154ab565b60005b8381101561134657600085858381811061128157611281615571565b90506020020135905060008111801561129c5750606c548111155b6112d85760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b6044820152606401610794565b6000818152607a60205260409020546001600160a01b03161561133d5760405162461bcd60e51b815260206004820152601a60248201527f546f6b656e206372656174656420627920657874656e73696f6e0000000000006044820152606401610794565b50600101611265565b5061135760008787878787876128a0565b6113616001606555565b505050505050565b611371611fff565b61137c6066826119e0565b6108445760405133906001600160a01b038316907f7e1a1a08d52e4ba0e21554733d66165fd5151f99460116223d9e3a608eec5cb190600090a3610b0c606682612c48565b6113c9611fff565b6113d36000612c5d565b565b6113dd61271f565b610944838383612776565b60606113f4606e612385565b6001600160401b0381111561140b5761140b614d90565b604051908082528060200260200182016040528015611434578160200160208202803683370190505b50905060005b611444606e612385565b811015610cb357611456606e8261238f565b82828151811061146857611468615571565b6001600160a01b039092166020928302919091019091015260010161143a565b6060611492612488565b61149a61271f565b6114a933888888888888612caf565b90506114b56001606555565b9695505050505050565b606060698054610856906154ef565b336114e16033546001600160a01b031690565b6001600160a01b031614806114fc57506114fc6066336119e0565b6115185760405162461bcd60e51b8152600401610794906154ab565b610b0c82826130f6565b610b0c33838361312b565b336115406033546001600160a01b031690565b6001600160a01b0316148061155b575061155b6066336119e0565b6115775760405162461bcd60e51b8152600401610794906154ab565b8281146115965760405162461bcd60e51b8152600401610794906155b6565b60005b838110156109a0576115e68585838181106115b6576115b6615571565b905060200201358484848181106115cf576115cf615571565b90506020028101906115e191906155dd565b611e0f565b600101611599565b6115f661271f565b610844338261320b565b336116136033546001600160a01b031690565b6001600160a01b0316148061162e575061162e6066336119e0565b61164a5760405162461bcd60e51b8152600401610794906154ab565b6109a0858585858561239b565b60606107c282613283565b60608061166e83613295565b91509150915091565b3361168a6033546001600160a01b031690565b6001600160a01b031614806116a557506116a56066336119e0565b6116c15760405162461bcd60e51b8152600401610794906154ab565b61084481613645565b6116d2612488565b6116da61271f565b60005b83811015611787573361171d8686848181106116fb576116fb615571565b905060200201356000908152607a60205260409020546001600160a01b031690565b6001600160a01b03161461177f5760405162461bcd60e51b815260206004820152602360248201527f546f6b656e206e6f742063726561746564206279207468697320657874656e7360448201526234b7b760e91b6064820152608401610794565b6001016116dd565b50611357338787878787876128a0565b61179f61271f565b610944838383612867565b6001600160a01b039182166000908152606b6020908152604080832093909416825291909152205460ff1690565b336117eb6033546001600160a01b031690565b6001600160a01b0316148061180657506118066066336119e0565b6118225760405162461bcd60e51b8152600401610794906154ab565b610b0c8282613686565b6001600160a01b038516331480611848575061184885336117aa565b6118645760405162461bcd60e51b815260040161079490615523565b6109a085858585856137af565b611879611fff565b6001600160a01b0381166118de5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610794565b61084481612c5d565b60606118f1612488565b336119046033546001600160a01b031690565b6001600160a01b0316148061191f575061191f6066336119e0565b61193b5760405162461bcd60e51b8152600401610794906154ab565b6114a96000888888888888612caf565b60006001600160e01b031982166301f4921160e61b14806107c257506107c2826138eb565b60006001600160e01b03198216636cdb3d1360e11b14806107e257506001600160e01b031982166303a24d0760e21b14806107c257506107c2825b60006001600160e01b03198216632a9f3abf60e11b14806107c257506301ffc9a760e01b6001600160e01b03198316146107c2565b6001600160a01b038116600090815260018301602052604081205415155b9392505050565b6001600160a01b03811615801590611a2657506001600160a01b0381163014155b611a725760405162461bcd60e51b815260206004820152601960248201527f43616e6e6f7420626c61636b6c69737420796f757273656c66000000000000006044820152606401610794565b611a7d606e826119e0565b15611ac55760405133906001600160a01b038316907fd19cf84cf0fec6bec9ddfa29c63adf83a55707c712f32c8285d6180a7890147990600090a3611ac3606e82612059565b505b611ad06070826119e0565b6108445760405133906001600160a01b038316907f05ac7bc5a606cd92a63365f9fda244499b9add0526b22d99937b6bd88181059c90600090a3610b0c607082612c48565b6060600082118015611b295750606c548211155b611b655760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b6044820152606401610794565b6000828152607a60205260409020546001600160a01b0316611b886070826119e0565b15611bcd5760405162461bcd60e51b8152602060048201526015602482015274115e1d195b9cda5bdb88189b1858dadb1a5cdd1959605a1b6044820152606401610794565b60008381526075602052604090208054611be6906154ef565b159050611d00576001600160a01b03811660009081526074602052604090208054611c10906154ef565b159050611c61576001600160a01b038116600090815260746020908152604080832086845260758352928190209051611c4a939201615696565b604051602081830303815290604052915050919050565b60008381526075602052604090208054611c7a906154ef565b80601f0160208091040260200160405190810160405280929190818152602001828054611ca6906154ef565b8015611cf35780601f10611cc857610100808354040283529160200191611cf3565b820191906000526020600020905b815481529060010190602001808311611cd657829003601f168201915b5050505050915050919050565b611d118163e9dc637560e01b61399c565b15611d895760405163e9dc637560e01b8152306004820152602481018490526001600160a01b0382169063e9dc637590604401600060405180830381865afa158015611d61573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526119fe91908101906156b3565b6001600160a01b03811660009081526073602052604090205460ff16611ddb576001600160a01b0381166000908152607260205260409020611dca846139b8565b604051602001611c4a92919061572a565b6001600160a01b03811660009081526072602052604090208054611c7a906154ef565b50919050565b60606119fe82613295565b600083118015611e215750606c548311155b8015611e4c57506000838152607a60205260408120546001600160a01b03165b6001600160a01b0316145b611e885760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b6044820152606401610794565b6000838152607560205260409020610d0f828483615795565b611ead84848484613a4a565b6000858152607760205260408120611ec491614a92565b611ee384848484607760008b8152602001908152602001600020613af5565b847fabb46fe0761d77584bde75697647804ffd8113abd4d8d06bc664150395eccdee85858585604051611f199493929190615886565b60405180910390a25050505050565b600080600080611f3786613295565b91509150600182511115611f8d5760405162461bcd60e51b815260206004820152601c60248201527f4d6f7265207468616e203120726f79616c7479207265636569766572000000006044820152606401610794565b8151600003611fa457306000935093505050610aac565b81600081518110611fb757611fb7615571565b60200260200101516127108683600081518110611fd657611fd6615571565b6020026020010151611fe891906158e9565b611ff29190615900565b9350935050509250929050565b6033546001600160a01b031633146113d35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610794565b60006119fe836001600160a01b038416613bb0565b815183511461208f5760405162461bcd60e51b815260040161079490615922565b6001600160a01b0384166120b55760405162461bcd60e51b81526004016107949061596a565b336120c4818787878787613ca3565b60005b84518110156121ad5760008582815181106120e4576120e4615571565b60200260200101519050600085838151811061210257612102615571565b6020908102919091018101516000848152606a835260408082206001600160a01b038e1683529093529190912054909150818110156121535760405162461bcd60e51b8152600401610794906159af565b6000838152606a602090815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906121929084906159f9565b92505081905550505050806121a69061559d565b90506120c7565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516121fd929190615a0c565b60405180910390a4611361818787878787613caf565b6000805260726020527fb5ad54240dc61c51d3a3e8d3f925722e010966ae263d67344c5fb60bddebddae610944828483615795565b6122536070826119e0565b156108445760405162461bcd60e51b8152602060048201526015602482015274115e1d195b9cda5bdb88189b1858dadb1a5cdd1959605a1b6044820152606401610794565b6001600160a01b03841630148015906122ba57506001600160a01b0384163b15155b6122f05760405162461bcd60e51b8152602060048201526007602482015266125b9d985b1a5960ca1b6044820152606401610794565b60405133906001600160a01b038616907fd8cb8ba4086944eabf43c5535b7712015e4d4c714b24bf812c040ea5b7a3e42a90600090a36001600160a01b0384166000908152607260205260409020612349838583615795565b506001600160a01b0384166000908152607360205260409020805460ff1916821515179055612379606e85612c48565b50610d0f84600161320b565b60006107c2825490565b60006119fe8383613e0a565b6123a784848484613a4a565b6001600160a01b03851660009081526076602052604081206123c891614a92565b6123f984848484607660008b6001600160a01b03166001600160a01b03168152602001908152602001600020613af5565b6001600160a01b038516612449577f2b6849d5976d799a5b0ca4dfd6b40a3d7afe9ea72c091fa01a958594f9a2659b8484848460405161243c9493929190615886565b60405180910390a16109a0565b846001600160a01b03167f535a93d2cb000582c0ebeaa9be4890ec6a287f98eb2df00c54c300612fd78d8f85858585604051611f199493929190615886565b6002606554036124da5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610794565b6002606555565b6124ec838383613e34565b6000828152607b60205260408120805483929061250a908490615a1f565b9091555050505050565b61251f838383613f50565b60005b8251811015610d0f5781818151811061253d5761253d615571565b6020026020010151607b600085848151811061255b5761255b615571565b6020026020010151815260200190815260200160002060008282546125809190615a1f565b9091555050600101612522565b826125aa5760405162461bcd60e51b8152600401610794906155b6565b6000607a6000868660008181106125c3576125c3615571565b602090810292909201358352508101919091526040016000908120546001600160a01b031691505b8481101561268b57816001600160a01b0316607a600088888581811061261357612613615571565b60209081029290920135835250810191909152604001600020546001600160a01b0316146126835760405162461bcd60e51b815260206004820152601c60248201527f4d69736d61746368656420746f6b656e206f726967696e61746f7273000000006044820152606401610794565b6001016125eb565b506001600160a01b03811615611361576126ac816303dc6f6560e51b61399c565b15611361576040516303dc6f6560e51b81526001600160a01b03821690637b8deca0906126e59089908990899089908990600401615a32565b600060405180830381600087803b1580156126ff57600080fd5b505af1158015612713573d6000803e3d6000fd5b50505050505050505050565b61272a606e336119e0565b6113d35760405162461bcd60e51b815260206004820152601c60248201527f4d757374206265207265676973746572656420657874656e73696f6e000000006044820152606401610794565b336000908152607260205260409020612790838583615795565b50336000908152607360205260409020805460ff19169115159190911790555050565b600054610100900460ff166127da5760405162461bcd60e51b815260040161079490615a68565b610b0c82826140ef565b600054610100900460ff1661280b5760405162461bcd60e51b815260040161079490615a68565b6113d361412f565b606d80546001600160a01b0319166001600160a01b0383169081179091556040519081527f959c0e47a2fe3cf01e237ba4892e2cc3194d77cbfb33e434e40873225d6b595f9060200160405180910390a150565b6000838152607a602052604090205433906001600160a01b0316611e41565b336000908152607460205260409020610944828483615795565b6001600160a01b0387161561294d5761294d86868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a028281018201909352898252909350899250889182918501908490808284376000920191909152505060408051602080890282810182019093528882529093508892508791829185019084908082843760009201919091525061415f92505050565b60018514801561295d5750600183145b80156129695750600181145b156129ea576129e58686600081811061298457612984615571565b90506020020160208101906129999190614b3e565b858560008181106129ac576129ac615571565b90506020020135848460008181106129c6576129c6615571565b60408051600081526020808201909252910292909201359190506141ee565b612c3f565b6001851480156129f957508281145b15612ac3576129e586866000818110612a1457612a14615571565b9050602002016020810190612a299190614b3e565b8585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060408051602080890282810182019093528882529093508892508791829185019084908082843760009201829052509250612a93915050565b6040519080825280601f01601f191660200182016040528015612abd576020820181803683370190505b50614223565b600183148015612ad35750600181145b15612b485760005b85811015612b4257612b3a878783818110612af857612af8615571565b9050602002016020810190612b0d9190614b3e565b86866000818110612b2057612b20615571565b90506020020135858560008181106129c6576129c6615571565b600101612adb565b50612c3f565b600183148015612b5757508481145b15612bc55760005b85811015612b4257612bbd878783818110612b7c57612b7c615571565b9050602002016020810190612b919190614b3e565b86866000818110612ba457612ba4615571565b905060200201358585858181106129c6576129c6615571565b600101612b5f565b8483148015612bd357508481145b15612c275760005b85811015612b4257612c1f878783818110612bf857612bf8615571565b9050602002016020810190612c0d9190614b3e565b868684818110612ba457612ba4615571565b600101612bdb565b60405162461bcd60e51b8152600401610794906155b6565b50505050505050565b60006119fe836001600160a01b03841661429d565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606001861115612d1557604080516001808252818301909252906020808301908036833701905050905060018211801590612cf457506001841480612cf457508584145b612d105760405162461bcd60e51b8152600401610794906155b6565b612d81565b836001600160401b03811115612d2d57612d2d614d90565b604051908082528060200260200182016040528015612d56578160200160208202803683370190505b509050811580612d6557508382145b612d815760405162461bcd60e51b8152600401610794906155b6565b60005b8151811015612df857606c60008154612d9c9061559d565b90915550606c548251839083908110612db757612db7615571565b602090810291909101810191909152606c546000908152607a9091526040902080546001600160a01b0319166001600160a01b038b16179055600101612d84565b506001600160a01b03881615612e7857612e7887878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82528794509092508a918a9182919085019084908082843760009201919091525061415f92505050565b600186148015612e89575080516001145b15612eec57612ee787876000818110612ea457612ea4615571565b9050602002016020810190612eb99190614b3e565b82600081518110612ecc57612ecc615571565b6020026020010151878760008181106129c6576129c6615571565b61303e565b6001861115612fd9576001849003612f6f5760005b86811015612f6957612f61888883818110612f1e57612f1e615571565b9050602002016020810190612f339190614b3e565b83600081518110612f4657612f46615571565b6020026020010151888860008181106129c6576129c6615571565b600101612f01565b5061303e565b60005b86811015612f6957612fd1888883818110612f8f57612f8f615571565b9050602002016020810190612fa49190614b3e565b83600081518110612fb757612fb7615571565b60200260200101518888858181106129c6576129c6615571565b600101612f72565b61303e87876000818110612fef57612fef615571565b90506020020160208101906130049190614b3e565b8287878080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250612a93915050565b60005b81518110156130ea57828110801561307e5750600084848381811061306857613068615571565b905060200281019061307a91906155dd565b9050115b156130e25783838281811061309557613095615571565b90506020028101906130a791906155dd565b607560008585815181106130bd576130bd615571565b6020026020010151815260200190815260200160002091826130e0929190615795565b505b600101613041565b50979650505050505050565b6000805260746020527fccdf39d850e26d5964b24c5391eecfa7a13a375488d6de2101d279419f39a537610944828483615795565b816001600160a01b0316836001600160a01b03160361319e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610794565b6001600160a01b038381166000818152606b6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61321f826001620e90cb60e41b031961399c565b15610b0c576001600160a01b038216600081815260786020908152604091829020805460ff191685151590811790915591519182527f072a7592283e2c2d1d56d21517ff6013325e0f55483f4828373ff4d98b0a1a36910160405180910390a25050565b606061328e82613295565b5092915050565b606080600060776000858152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561331757600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b900461ffff16818301528252600190920191016132cd565b5050505090508051600003613466576000848152607a60205260409020546001600160a01b031680156134645761335581634e53ee3d60e11b61399c565b156133e057604051634e53ee3d60e11b8152306004820152602481018690526001600160a01b03821690639ca7dc7a90604401600060405180830381865afa1580156133a5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526133cd9190810190615b19565b81519195509350156133e0575050915091565b6001600160a01b038116600090815260766020908152604080832080548251818502810185019093528083529193909284015b8282101561345d57600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b900461ffff1681830152825260019092019101613413565b5050505091505b505b8051600003613509576000808052607660209081527fafbc767fed27552cbeceb3d11150dacedabc53b0cc52ac5aa6285a747a1819588054604080518285028101850190915281815293919290919084015b8282101561350257600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b900461ffff16818301528252600190920191016134b8565b5050505090505b80511561363f5780516001600160401b0381111561352957613529614d90565b604051908082528060200260200182016040528015613552578160200160208202803683370190505b50925080516001600160401b0381111561356e5761356e614d90565b604051908082528060200260200182016040528015613597578160200160208202803683370190505b50915060005b815181101561363d578181815181106135b8576135b8615571565b6020026020010151600001518482815181106135d6576135d6615571565b60200260200101906001600160a01b031690816001600160a01b03168152505081818151811061360857613608615571565b60200260200101516020015161ffff1683828151811061362a5761362a615571565b602090810291909101015260010161359d565b505b50915091565b60405133906001600160a01b038316907fd19cf84cf0fec6bec9ddfa29c63adf83a55707c712f32c8285d6180a7890147990600090a3610b0c606e82612059565b613691606e836119e0565b6136d15760405162461bcd60e51b815260206004820152601160248201527024b73b30b634b21032bc3a32b739b4b7b760791b6044820152606401610794565b6001600160a01b03811615806136f357506136f3816378ea2a9760e11b61399c565b6137315760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b6044820152606401610794565b6001600160a01b03828116600090815260796020526040902054811690821614610b0c576001600160a01b0382811660008181526079602052604080822080546001600160a01b031916948616948517905551339392917f6a835c4fcf7e0d398db3762332fdaa1471814ad39f1e2d6d0b3fdabf8efee3e091a45050565b6001600160a01b0384166137d55760405162461bcd60e51b81526004016107949061596a565b3360006137e1856142ec565b905060006137ee856142ec565b90506137fe838989858589613ca3565b6000868152606a602090815260408083206001600160a01b038c168452909152902054858110156138415760405162461bcd60e51b8152600401610794906159af565b6000878152606a602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906138809084906159f9565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46138e0848a8a8a8a8a614337565b505050505050505050565b60006001600160e01b031982166314d9799760e21b148061391c57506001600160e01b031982166328f10a2160e01b145b8061392b575061392b82611970565b8061394657506001600160e01b03198216635d9dd7eb60e11b145b8061396157506001600160e01b03198216632dde656160e21b145b8061397c57506001600160e01b031982166335681b5360e21b145b806107c257506001600160e01b0319821663152a902d60e11b1492915050565b60006139a7836143f2565b80156119fe57506119fe8383614425565b606060006139c5836144ae565b60010190506000816001600160401b038111156139e4576139e4614d90565b6040519080825280601f01601f191660200182016040528015613a0e576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084613a1857509392505050565b828114613a695760405162461bcd60e51b8152600401610794906155b6565b6000805b82811015613aa357838382818110613a8757613a87615571565b9050602002013582613a9991906159f9565b9150600101613a6d565b5061271081106109a05760405162461bcd60e51b815260206004820152601760248201527f496e76616c696420746f74616c20726f79616c746965730000000000000000006044820152606401610794565b60005b8281101561136157816040518060400160405280888885818110613b1e57613b1e615571565b9050602002016020810190613b339190614b3e565b6001600160a01b03168152602001868685818110613b5357613b53615571565b61ffff602091820293909301358316909352508354600181810186556000958652948390208451910180549490930151909116600160a01b026001600160b01b03199093166001600160a01b039091161791909117905501613af8565b60008181526001830160205260408120548015613c99576000613bd4600183615a1f565b8554909150600090613be890600190615a1f565b9050818114613c4d576000866000018281548110613c0857613c08615571565b9060005260206000200154905080876000018481548110613c2b57613c2b615571565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613c5e57613c5e615bde565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506107c2565b60009150506107c2565b61136185858585614586565b6001600160a01b0384163b156113615760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190613cf39089908990889088908890600401615bf4565b6020604051808303816000875af1925050508015613d2e575060408051601f3d908101601f19168201909252613d2b91810190615c46565b60015b613dda57613d3a615c63565b806308c379a003613d735750613d4e615c7f565b80613d595750613d75565b8060405162461bcd60e51b81526004016107949190614bab565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610794565b6001600160e01b0319811663bc197c8160e01b14612c3f5760405162461bcd60e51b815260040161079490615d08565b6000826000018281548110613e2157613e21615571565b9060005260206000200154905092915050565b6001600160a01b038316613e5a5760405162461bcd60e51b815260040161079490615d50565b336000613e66846142ec565b90506000613e73846142ec565b9050613e9383876000858560405180602001604052806000815250613ca3565b6000858152606a602090815260408083206001600160a01b038a16845290915290205484811015613ed65760405162461bcd60e51b815260040161079490615d93565b6000868152606a602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052612c3f565b6001600160a01b038316613f765760405162461bcd60e51b815260040161079490615d50565b8051825114613f975760405162461bcd60e51b815260040161079490615922565b6000339050613fba81856000868660405180602001604052806000815250613ca3565b60005b8351811015614082576000848281518110613fda57613fda615571565b602002602001015190506000848381518110613ff857613ff8615571565b6020908102919091018101516000848152606a835260408082206001600160a01b038c1683529093529190912054909150818110156140495760405162461bcd60e51b815260040161079490615d93565b6000928352606a602090815260408085206001600160a01b038b168652909152909220910390558061407a8161559d565b915050613fbd565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb86866040516140d3929190615a0c565b60405180910390a4604080516020810190915260009052610d0f565b600054610100900460ff166141165760405162461bcd60e51b815260040161079490615a68565b60686141228382615dd7565b5060696109448282615dd7565b600054610100900460ff166141565760405162461bcd60e51b815260040161079490615a68565b6113d333612c5d565b336000908152607960205260409020546001600160a01b0316156109445733600081815260796020526040908190205490516378ea2a9760e11b81526001600160a01b039091169163f1d4552e916141c09190879087908790600401615e96565b600060405180830381600087803b1580156141da57600080fd5b505af1158015612c3f573d6000803e3d6000fd5b6141fa84848484614855565b6000838152607b6020526040812080548492906142189084906159f9565b909155505050505050565b61422f84848484614937565b60005b83518110156109a05782818151811061424d5761424d615571565b6020026020010151607b600086848151811061426b5761426b615571565b60200260200101518152602001908152602001600020600082825461429091906159f9565b9091555050600101614232565b60008181526001830160205260408120546142e4575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556107c2565b5060006107c2565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061432657614326615571565b602090810291909101015292915050565b6001600160a01b0384163b156113615760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061437b9089908990889088908890600401615ede565b6020604051808303816000875af19250505080156143b6575060408051601f3d908101601f191682019092526143b391810190615c46565b60015b6143c257613d3a615c63565b6001600160e01b0319811663f23a6e6160e01b14612c3f5760405162461bcd60e51b815260040161079490615d08565b6000614405826301ffc9a760e01b614425565b80156107c2575061441e826001600160e01b0319614425565b1592915050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03166301ffc9a760e01b178152825160009392849283928392918391908a617530fa92503d91506000519050828015614497575060208210155b80156144a35750600081115b979650505050505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106144ed5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310614519576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061453757662386f26fc10000830492506010015b6305f5e100831061454f576305f5e100830492506008015b612710831061456357612710830492506004015b60648310614575576064830492506002015b600a83106107c25760010192915050565b6001600160a01b03841615610d0f576000607a6000846000815181106145ae576145ae615571565b6020026020010151815260200190815260200160002060009054906101000a90046001600160a01b0316905060005b835181101561467f57816001600160a01b0316607a600086848151811061460657614606615571565b6020908102919091018101518252810191909152604001600020546001600160a01b0316146146775760405162461bcd60e51b815260206004820152601c60248201527f4d69736d61746368656420746f6b656e206f726967696e61746f7273000000006044820152606401610794565b6001016145dd565b506001600160a01b038116158015906146b057506001600160a01b03811660009081526078602052604090205460ff165b1561477d5760405163e483517760e01b81526001600160a01b0382169063e4835177906146e99033908990899089908990600401615f16565b6020604051808303816000875af1158015614708573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061472c9190615f5c565b6147785760405162461bcd60e51b815260206004820152601a60248201527f457874656e73696f6e20617070726f76616c206661696c7572650000000000006044820152606401610794565b6109a0565b606d546001600160a01b0316156109a057606d5460405163e483517760e01b81526001600160a01b039091169063e4835177906147c69033908990899089908990600401615f16565b6020604051808303816000875af11580156147e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906148099190615f5c565b6109a05760405162461bcd60e51b815260206004820152601a60248201527f457874656e73696f6e20617070726f76616c206661696c7572650000000000006044820152606401610794565b6001600160a01b03841661487b5760405162461bcd60e51b815260040161079490615f79565b336000614887856142ec565b90506000614894856142ec565b90506148a583600089858589613ca3565b6000868152606a602090815260408083206001600160a01b038b168452909152812080548792906148d79084906159f9565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612c3f83600089898989614337565b6001600160a01b03841661495d5760405162461bcd60e51b815260040161079490615f79565b815183511461497e5760405162461bcd60e51b815260040161079490615922565b3361498e81600087878787613ca3565b60005b8451811015614a2a578381815181106149ac576149ac615571565b6020026020010151606a60008784815181106149ca576149ca615571565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254614a1291906159f9565b90915550819050614a228161559d565b915050614991565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051614a7b929190615a0c565b60405180910390a46109a081600087878787613caf565b508054600082559060005260206000209081019061084491905b80821115610cb35780546001600160b01b0319168155600101614aac565b6001600160a01b038116811461084457600080fd5b60008060408385031215614af257600080fd5b8235614afd81614aca565b946020939093013593505050565b6001600160e01b03198116811461084457600080fd5b600060208284031215614b3357600080fd5b81356119fe81614b0b565b600060208284031215614b5057600080fd5b81356119fe81614aca565b60005b83811015614b76578181015183820152602001614b5e565b50506000910152565b60008151808452614b97816020860160208601614b5b565b601f01601f19169290920160200192915050565b6020815260006119fe6020830184614b7f565b600060208284031215614bd057600080fd5b5035919050565b600081518084526020808501945080840160005b83811015614c0757815187529582019590820190600101614beb565b509495945050505050565b6020815260006119fe6020830184614bd7565b60008083601f840112614c3757600080fd5b5081356001600160401b03811115614c4e57600080fd5b602083019150836020828501011115610aac57600080fd5b600080600060408486031215614c7b57600080fd5b8335925060208401356001600160401b03811115614c9857600080fd5b614ca486828701614c25565b9497909650939450505050565b60008083601f840112614cc357600080fd5b5081356001600160401b03811115614cda57600080fd5b6020830191508360208260051b8501011115610aac57600080fd5b600080600080600060608688031215614d0d57600080fd5b8535945060208601356001600160401b0380821115614d2b57600080fd5b614d3789838a01614cb1565b90965094506040880135915080821115614d5057600080fd5b50614d5d88828901614cb1565b969995985093965092949392505050565b60008060408385031215614d8157600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715614dcb57614dcb614d90565b6040525050565b60006001600160401b03821115614deb57614deb614d90565b5060051b60200190565b600082601f830112614e0657600080fd5b81356020614e1382614dd2565b604051614e208282614da6565b83815260059390931b8501820192828101915086841115614e4057600080fd5b8286015b84811015614e5b5780358352918301918301614e44565b509695505050505050565b60006001600160401b03821115614e7f57614e7f614d90565b50601f01601f191660200190565b600082601f830112614e9e57600080fd5b8135614ea981614e66565b604051614eb68282614da6565b828152856020848701011115614ecb57600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a08688031215614f0157600080fd5b8535614f0c81614aca565b94506020860135614f1c81614aca565b935060408601356001600160401b0380821115614f3857600080fd5b614f4489838a01614df5565b94506060880135915080821115614f5a57600080fd5b614f6689838a01614df5565b93506080880135915080821115614f7c57600080fd5b50614f8988828901614e8d565b9150509295509295909350565b60008060208385031215614fa957600080fd5b82356001600160401b03811115614fbf57600080fd5b614fcb85828601614c25565b90969095509350505050565b600080600060408486031215614fec57600080fd5b8335614ff781614aca565b925060208401356001600160401b03811115614c9857600080fd5b600081518084526020808501945080840160005b83811015614c075781516001600160a01b031687529582019590820190600101615026565b6020815260006119fe6020830184615012565b6000806000806040858703121561507457600080fd5b84356001600160401b038082111561508b57600080fd5b61509788838901614cb1565b909650945060208701359150808211156150b057600080fd5b506150bd87828801614cb1565b95989497509550505050565b6000806000806000606086880312156150e157600080fd5b85356150ec81614aca565b945060208601356001600160401b0380821115614d2b57600080fd5b801515811461084457600080fd5b6000806000806060858703121561512c57600080fd5b843561513781614aca565b935060208501356001600160401b0381111561515257600080fd5b61515e87828801614c25565b909450925050604085013561517281615108565b939692955090935050565b6000806040838503121561519057600080fd5b82356001600160401b03808211156151a757600080fd5b6151b386838701614e8d565b935060208501359150808211156151c957600080fd5b506151d685828601614e8d565b9150509250929050565b600080604083850312156151f357600080fd5b82356001600160401b038082111561520a57600080fd5b818501915085601f83011261521e57600080fd5b8135602061522b82614dd2565b6040516152388282614da6565b83815260059390931b850182019282810191508984111561525857600080fd5b948201945b8386101561527f57853561527081614aca565b8252948201949082019061525d565b9650508601359250508082111561529557600080fd5b506151d685828601614df5565b600080600080600080606087890312156152bb57600080fd5b86356001600160401b03808211156152d257600080fd5b6152de8a838b01614cb1565b909850965060208901359150808211156152f757600080fd5b6153038a838b01614cb1565b9096509450604089013591508082111561531c57600080fd5b5061532989828a01614cb1565b979a9699509497509295939492505050565b60008060006040848603121561535057600080fd5b83356001600160401b0381111561536657600080fd5b61537286828701614c25565b909450925050602084013561538681615108565b809150509250925092565b600080604083850312156153a457600080fd5b82356153af81614aca565b915060208301356153bf81615108565b809150509250929050565b6000602082840312156153dc57600080fd5b81356119fe81615108565b6040815260006153fa6040830185615012565b828103602084015261540c8185614bd7565b95945050505050565b6000806040838503121561542857600080fd5b823561543381614aca565b915060208301356153bf81614aca565b600080600080600060a0868803121561545b57600080fd5b853561546681614aca565b9450602086013561547681614aca565b9350604086013592506060860135915060808601356001600160401b0381111561549f57600080fd5b614f8988828901614e8d565b60208082526024908201527f41646d696e436f6e74726f6c3a204d757374206265206f776e6572206f7220616040820152633236b4b760e11b606082015260800190565b600181811c9082168061550357607f821691505b602082108103611dfe57634e487b7160e01b600052602260045260246000fd5b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016155af576155af615587565b5060010190565b6020808252600d908201526c125b9d985b1a59081a5b9c1d5d609a1b604082015260600190565b6000808335601e198436030181126155f457600080fd5b8301803591506001600160401b0382111561560e57600080fd5b602001915036819003821315610aac57600080fd5b60008154615630816154ef565b60018281168015615648576001811461565d5761568c565b60ff198416875282151583028701945061568c565b8560005260208060002060005b858110156156835781548a82015290840190820161566a565b50505082870194505b5050505092915050565b60006156ab6156a58386615623565b84615623565b949350505050565b6000602082840312156156c557600080fd5b81516001600160401b038111156156db57600080fd5b8201601f810184136156ec57600080fd5b80516156f781614e66565b6040516157048282614da6565b82815286602084860101111561571957600080fd5b6114b5836020830160208701614b5b565b60006157368285615623565b8351615746818360208801614b5b565b01949350505050565b601f82111561094457600081815260208120601f850160051c810160208610156157765750805b601f850160051c820191505b8181101561136157828155600101615782565b6001600160401b038311156157ac576157ac614d90565b6157c0836157ba83546154ef565b8361574f565b6000601f8411600181146157f457600085156157dc5750838201355b600019600387901b1c1916600186901b1783556109a0565b600083815260209020601f19861690835b828110156158255786850135825560209485019460019092019101615805565b50868210156158425760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835260006001600160fb1b0383111561586d57600080fd5b8260051b80836020870137939093016020019392505050565b6040808252810184905260008560608301825b878110156158c95782356158ac81614aca565b6001600160a01b0316825260209283019290910190600101615899565b5083810360208501526158dd818688615854565b98975050505050505050565b80820281158282048414176107c2576107c2615587565b60008261591d57634e487b7160e01b600052601260045260246000fd5b500490565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b808201808211156107c2576107c2615587565b6040815260006153fa6040830185614bd7565b818103818111156107c2576107c2615587565b6001600160a01b0386168152606060208201526000615a55606083018688615854565b82810360408401526158dd818587615854565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082601f830112615ac457600080fd5b81516020615ad182614dd2565b604051615ade8282614da6565b83815260059390931b8501820192828101915086841115615afe57600080fd5b8286015b84811015614e5b5780518352918301918301615b02565b60008060408385031215615b2c57600080fd5b82516001600160401b0380821115615b4357600080fd5b818501915085601f830112615b5757600080fd5b81516020615b6482614dd2565b604051615b718282614da6565b83815260059390931b8501820192828101915089841115615b9157600080fd5b948201945b83861015615bb8578551615ba981614aca565b82529482019490820190615b96565b91880151919650909350505080821115615bd157600080fd5b506151d685828601615ab3565b634e487b7160e01b600052603160045260246000fd5b60006001600160a01b03808816835280871660208401525060a06040830152615c2060a0830186614bd7565b8281036060840152615c328186614bd7565b905082810360808401526158dd8185614b7f565b600060208284031215615c5857600080fd5b81516119fe81614b0b565b600060033d1115615c7c5760046000803e5060005160e01c5b90565b600060443d1015615c8d5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715615cbc57505050505090565b8285019150815181811115615cd45750505050505090565b843d8701016020828501011115615cee5750505050505090565b615cfd60208286010187614da6565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b81516001600160401b03811115615df057615df0614d90565b615e0481615dfe84546154ef565b8461574f565b602080601f831160018114615e395760008415615e215750858301515b600019600386901b1c1916600185901b178555611361565b600085815260208120601f198616915b82811015615e6857888601518255948401946001909101908401615e49565b5085821015615e865787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b0385168152608060208201526000615eb86080830186615012565b8281036040840152615eca8186614bd7565b905082810360608401526144a38185614bd7565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a060808301526144a360a0830184614b7f565b60006001600160a01b038088168352808716602084015280861660408401525060a06060830152615f4a60a0830185614bd7565b82810360808401526158dd8185614bd7565b600060208284031215615f6e57600080fd5b81516119fe81615108565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b60608201526080019056fea2646970667358221220ab556332a610f7685776c138d1199e5f604995eec694c1a10ecbdb243abaeedb64736f6c63430008110033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061030b5760003560e01c8063695c96e61161019d578063b9c4d9fb116100e9578063e92a89f6116100a2578063f242432a1161007c578063f242432a146106ec578063f2fde38b146106ff578063feeb5a9a14610712578063ffa1ad741461072557600080fd5b8063e92a89f6146106b3578063e985e9c5146106c6578063f0cdc499146106d957600080fd5b8063b9c4d9fb14610639578063bb3bafd61461064c578063bd85b0391461066d578063ce8aee9d1461068d578063d5a06d4c1461064c578063e6c884dc146106a057600080fd5b80638da5cb5b11610156578063a22cb46511610130578063a22cb465146105ed578063aafb2d4414610600578063ac0c8cfa14610613578063b0fe87c91461062657600080fd5b80638da5cb5b146105c157806395d89b41146105d257806399e0dd7c146105da57600080fd5b8063695c96e6146105655780636d73e66914610578578063715018a61461058b57806382dcc0c81461059357806383b7db63146105a65780638c6e8472146105ae57600080fd5b80632eb2c2d61161025c5780633e6134b8116102155780634e1273f4116101ef5780634e1273f414610519578063596798ad1461052c57806361e5bc6b1461053f57806366d1e9d01461055257600080fd5b80633e6134b8146104e05780633f0f37f6146104f35780634cd88b761461050657600080fd5b80632eb2c2d61461046c57806330176e131461047f5780633071a0f91461049257806331ae450b146104a5578063332dd1ae146104ba5780633db0f8ab146104cd57600080fd5b8063162094c4116102c9578063239be317116102a3578063239be3171461040157806324d7806c146104145780632a55205a146104275780632d3456701461045957600080fd5b8063162094c4146103b657806320e4afe2146103c957806322f374d0146103dc57600080fd5b8062fdd58e1461031057806301ffc9a71461033657806302e7afb71461035957806306fdde031461036e5780630e89341c146103835780630ebd4c7f14610396575b600080fd5b61032361031e366004614adf565b61072d565b6040519081526020015b60405180910390f35b610349610344366004614b21565b6107c8565b604051901515815260200161032d565b61036c610367366004614b3e565b6107f1565b005b610376610847565b60405161032d9190614bab565b610376610391366004614bbe565b6108d9565b6103a96103a4366004614bbe565b6108e4565b60405161032d9190614c12565b61036c6103c4366004614c66565b6108ef565b61036c6103d7366004614cf5565b610949565b606d546001600160a01b03165b6040516001600160a01b03909116815260200161032d565b6103e961040f366004614bbe565b6109a7565b610349610422366004614b3e565b610a61565b61043a610435366004614d6e565b610a9a565b604080516001600160a01b03909316835260208301919091520161032d565b61036c610467366004614b3e565b610ab3565b61036c61047a366004614ee9565b610b10565b61036c61048d366004614f96565b610b55565b61036c6104a0366004614fd7565b610ba9565b6104ad610c09565b60405161032d919061504b565b61036c6104c836600461505e565b610cb7565b61036c6104db3660046150c9565b610d15565b61036c6104ee366004614f96565b610e74565b61036c610501366004615116565b610e88565b61036c61051436600461517d565b610ee7565b6103a96105273660046151e0565b611003565b61036c61053a366004614b3e565b61112c565b61036c61054d36600461505e565b61117f565b61036c610560366004614f96565b6111fe565b61036c6105733660046152a2565b611210565b61036c610586366004614b3e565b611369565b61036c6113c1565b61036c6105a136600461533b565b6113d5565b6104ad6113e8565b6103a96105bc3660046152a2565b611488565b6033546001600160a01b03166103e9565b6103766114bf565b61036c6105e8366004614f96565b6114ce565b61036c6105fb366004615391565b611522565b61036c61060e36600461505e565b61152d565b61036c6106213660046153ca565b6115ee565b61036c6106343660046150c9565b611600565b6104ad610647366004614bbe565b611657565b61065f61065a366004614bbe565b611662565b60405161032d9291906153e7565b61032361067b366004614bbe565b6000908152607b602052604090205490565b61036c61069b366004614b3e565b611677565b61036c6106ae3660046152a2565b6116ca565b61036c6106c1366004614c66565b611797565b6103496106d4366004615415565b6117aa565b61036c6106e7366004615415565b6117d8565b61036c6106fa366004615443565b61182c565b61036c61070d366004614b3e565b611871565b6103a96107203660046152a2565b6118e7565b610323600381565b60006001600160a01b03831661079d5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000818152606a602090815260408083206001600160a01b03861684529091529020545b92915050565b60006107d38261194b565b806107e257506107e282611970565b806107c257506107c2826119ab565b336108046033546001600160a01b031690565b6001600160a01b0316148061081f575061081f6066336119e0565b61083b5760405162461bcd60e51b8152600401610794906154ab565b61084481611a05565b50565b606060688054610856906154ef565b80601f0160208091040260200160405190810160405280929190818152602001828054610882906154ef565b80156108cf5780601f106108a4576101008083540402835291602001916108cf565b820191906000526020600020905b8154815290600101906020018083116108b257829003601f168201915b5050505050905090565b60606107c282611b15565b60606107c282611e04565b336109026033546001600160a01b031690565b6001600160a01b0316148061091d575061091d6066336119e0565b6109395760405162461bcd60e51b8152600401610794906154ab565b610944838383611e0f565b505050565b3361095c6033546001600160a01b031690565b6001600160a01b0316148061097757506109776066336119e0565b6109935760405162461bcd60e51b8152600401610794906154ab565b6109a08585858585611ea1565b5050505050565b6000818152607a60205260409020546001600160a01b031680610a0c5760405162461bcd60e51b815260206004820152601660248201527f4e6f20657874656e73696f6e20666f7220746f6b656e000000000000000000006044820152606401610794565b610a176070826119e0565b15610a5c5760405162461bcd60e51b8152602060048201526015602482015274115e1d195b9cda5bdb88189b1858dadb1a5cdd1959605a1b6044820152606401610794565b919050565b6000816001600160a01b0316610a7f6033546001600160a01b031690565b6001600160a01b031614806107c257506107c26066836119e0565b600080610aa78484611f28565b915091505b9250929050565b610abb611fff565b610ac66066826119e0565b156108445760405133906001600160a01b038316907f7c0c3c84c67c85fcac635147348bfe374c24a1a93d0366d1cfe9d8853cbf89d590600090a3610b0c606682612059565b5050565b6001600160a01b038516331480610b2c5750610b2c85336117aa565b610b485760405162461bcd60e51b815260040161079490615523565b6109a0858585858561206e565b33610b686033546001600160a01b031690565b6001600160a01b03161480610b835750610b836066336119e0565b610b9f5760405162461bcd60e51b8152600401610794906154ab565b610b0c8282612213565b33610bbc6033546001600160a01b031690565b6001600160a01b03161480610bd75750610bd76066336119e0565b610bf35760405162461bcd60e51b8152600401610794906154ab565b610bfc83612248565b6109448383836000612298565b6060610c156066612385565b6001600160401b03811115610c2c57610c2c614d90565b604051908082528060200260200182016040528015610c55578160200160208202803683370190505b50905060005b610c656066612385565b811015610cb357610c7760668261238f565b828281518110610c8957610c89615571565b6001600160a01b039092166020928302919091019091015280610cab8161559d565b915050610c5b565b5090565b33610cca6033546001600160a01b031690565b6001600160a01b03161480610ce55750610ce56066336119e0565b610d015760405162461bcd60e51b8152600401610794906154ab565b610d0f60008585858561239b565b50505050565b610d1d612488565b6001600160a01b038516331480610d395750610d3985336117aa565b610d855760405162461bcd60e51b815260206004820152601f60248201527f43616c6c6572206973206e6f74206f776e6572206f7220617070726f766564006044820152606401610794565b828114610da45760405162461bcd60e51b8152600401610794906155b6565b6001839003610def57610dea8585856000818110610dc457610dc4615571565b9050602002013584846000818110610dde57610dde615571565b905060200201356124e1565b610e5d565b610e5d858585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060408051602080890282810182019093528882529093508892508791829185019084908082843760009201919091525061251492505050565b610e6a858585858561258d565b6109a06001606555565b610e7c61271f565b610b0c82826000612776565b33610e9b6033546001600160a01b031690565b6001600160a01b03161480610eb65750610eb66066336119e0565b610ed25760405162461bcd60e51b8152600401610794906154ab565b610edb84612248565b610d0f84848484612298565b600054610100900460ff1615808015610f075750600054600160ff909116105b80610f215750303b158015610f21575060005460ff166001145b610f845760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610794565b6000805460ff191660011790558015610fa7576000805461ff0019166101001790555b610fb183836127b3565b610fb96127e4565b8015610944576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b606081518351146110685760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610794565b600083516001600160401b0381111561108357611083614d90565b6040519080825280602002602001820160405280156110ac578160200160208202803683370190505b50905060005b8451811015611124576110f78582815181106110d0576110d0615571565b60200260200101518583815181106110ea576110ea615571565b602002602001015161072d565b82828151811061110957611109615571565b602090810291909101015261111d8161559d565b90506110b2565b509392505050565b3361113f6033546001600160a01b031690565b6001600160a01b0316148061115a575061115a6066336119e0565b6111765760405162461bcd60e51b8152600401610794906154ab565b61084481612813565b61118761271f565b8281146111a65760405162461bcd60e51b8152600401610794906155b6565b60005b838110156109a0576111f68585838181106111c6576111c6615571565b905060200201358484848181106111df576111df615571565b90506020028101906111f191906155dd565b612867565b6001016111a9565b61120661271f565b610b0c8282612886565b611218612488565b3361122b6033546001600160a01b031690565b6001600160a01b0316148061124657506112466066336119e0565b6112625760405162461bcd60e51b8152600401610794906154ab565b60005b8381101561134657600085858381811061128157611281615571565b90506020020135905060008111801561129c5750606c548111155b6112d85760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b6044820152606401610794565b6000818152607a60205260409020546001600160a01b03161561133d5760405162461bcd60e51b815260206004820152601a60248201527f546f6b656e206372656174656420627920657874656e73696f6e0000000000006044820152606401610794565b50600101611265565b5061135760008787878787876128a0565b6113616001606555565b505050505050565b611371611fff565b61137c6066826119e0565b6108445760405133906001600160a01b038316907f7e1a1a08d52e4ba0e21554733d66165fd5151f99460116223d9e3a608eec5cb190600090a3610b0c606682612c48565b6113c9611fff565b6113d36000612c5d565b565b6113dd61271f565b610944838383612776565b60606113f4606e612385565b6001600160401b0381111561140b5761140b614d90565b604051908082528060200260200182016040528015611434578160200160208202803683370190505b50905060005b611444606e612385565b811015610cb357611456606e8261238f565b82828151811061146857611468615571565b6001600160a01b039092166020928302919091019091015260010161143a565b6060611492612488565b61149a61271f565b6114a933888888888888612caf565b90506114b56001606555565b9695505050505050565b606060698054610856906154ef565b336114e16033546001600160a01b031690565b6001600160a01b031614806114fc57506114fc6066336119e0565b6115185760405162461bcd60e51b8152600401610794906154ab565b610b0c82826130f6565b610b0c33838361312b565b336115406033546001600160a01b031690565b6001600160a01b0316148061155b575061155b6066336119e0565b6115775760405162461bcd60e51b8152600401610794906154ab565b8281146115965760405162461bcd60e51b8152600401610794906155b6565b60005b838110156109a0576115e68585838181106115b6576115b6615571565b905060200201358484848181106115cf576115cf615571565b90506020028101906115e191906155dd565b611e0f565b600101611599565b6115f661271f565b610844338261320b565b336116136033546001600160a01b031690565b6001600160a01b0316148061162e575061162e6066336119e0565b61164a5760405162461bcd60e51b8152600401610794906154ab565b6109a0858585858561239b565b60606107c282613283565b60608061166e83613295565b91509150915091565b3361168a6033546001600160a01b031690565b6001600160a01b031614806116a557506116a56066336119e0565b6116c15760405162461bcd60e51b8152600401610794906154ab565b61084481613645565b6116d2612488565b6116da61271f565b60005b83811015611787573361171d8686848181106116fb576116fb615571565b905060200201356000908152607a60205260409020546001600160a01b031690565b6001600160a01b03161461177f5760405162461bcd60e51b815260206004820152602360248201527f546f6b656e206e6f742063726561746564206279207468697320657874656e7360448201526234b7b760e91b6064820152608401610794565b6001016116dd565b50611357338787878787876128a0565b61179f61271f565b610944838383612867565b6001600160a01b039182166000908152606b6020908152604080832093909416825291909152205460ff1690565b336117eb6033546001600160a01b031690565b6001600160a01b0316148061180657506118066066336119e0565b6118225760405162461bcd60e51b8152600401610794906154ab565b610b0c8282613686565b6001600160a01b038516331480611848575061184885336117aa565b6118645760405162461bcd60e51b815260040161079490615523565b6109a085858585856137af565b611879611fff565b6001600160a01b0381166118de5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610794565b61084481612c5d565b60606118f1612488565b336119046033546001600160a01b031690565b6001600160a01b0316148061191f575061191f6066336119e0565b61193b5760405162461bcd60e51b8152600401610794906154ab565b6114a96000888888888888612caf565b60006001600160e01b031982166301f4921160e61b14806107c257506107c2826138eb565b60006001600160e01b03198216636cdb3d1360e11b14806107e257506001600160e01b031982166303a24d0760e21b14806107c257506107c2825b60006001600160e01b03198216632a9f3abf60e11b14806107c257506301ffc9a760e01b6001600160e01b03198316146107c2565b6001600160a01b038116600090815260018301602052604081205415155b9392505050565b6001600160a01b03811615801590611a2657506001600160a01b0381163014155b611a725760405162461bcd60e51b815260206004820152601960248201527f43616e6e6f7420626c61636b6c69737420796f757273656c66000000000000006044820152606401610794565b611a7d606e826119e0565b15611ac55760405133906001600160a01b038316907fd19cf84cf0fec6bec9ddfa29c63adf83a55707c712f32c8285d6180a7890147990600090a3611ac3606e82612059565b505b611ad06070826119e0565b6108445760405133906001600160a01b038316907f05ac7bc5a606cd92a63365f9fda244499b9add0526b22d99937b6bd88181059c90600090a3610b0c607082612c48565b6060600082118015611b295750606c548211155b611b655760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b6044820152606401610794565b6000828152607a60205260409020546001600160a01b0316611b886070826119e0565b15611bcd5760405162461bcd60e51b8152602060048201526015602482015274115e1d195b9cda5bdb88189b1858dadb1a5cdd1959605a1b6044820152606401610794565b60008381526075602052604090208054611be6906154ef565b159050611d00576001600160a01b03811660009081526074602052604090208054611c10906154ef565b159050611c61576001600160a01b038116600090815260746020908152604080832086845260758352928190209051611c4a939201615696565b604051602081830303815290604052915050919050565b60008381526075602052604090208054611c7a906154ef565b80601f0160208091040260200160405190810160405280929190818152602001828054611ca6906154ef565b8015611cf35780601f10611cc857610100808354040283529160200191611cf3565b820191906000526020600020905b815481529060010190602001808311611cd657829003601f168201915b5050505050915050919050565b611d118163e9dc637560e01b61399c565b15611d895760405163e9dc637560e01b8152306004820152602481018490526001600160a01b0382169063e9dc637590604401600060405180830381865afa158015611d61573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526119fe91908101906156b3565b6001600160a01b03811660009081526073602052604090205460ff16611ddb576001600160a01b0381166000908152607260205260409020611dca846139b8565b604051602001611c4a92919061572a565b6001600160a01b03811660009081526072602052604090208054611c7a906154ef565b50919050565b60606119fe82613295565b600083118015611e215750606c548311155b8015611e4c57506000838152607a60205260408120546001600160a01b03165b6001600160a01b0316145b611e885760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b6044820152606401610794565b6000838152607560205260409020610d0f828483615795565b611ead84848484613a4a565b6000858152607760205260408120611ec491614a92565b611ee384848484607760008b8152602001908152602001600020613af5565b847fabb46fe0761d77584bde75697647804ffd8113abd4d8d06bc664150395eccdee85858585604051611f199493929190615886565b60405180910390a25050505050565b600080600080611f3786613295565b91509150600182511115611f8d5760405162461bcd60e51b815260206004820152601c60248201527f4d6f7265207468616e203120726f79616c7479207265636569766572000000006044820152606401610794565b8151600003611fa457306000935093505050610aac565b81600081518110611fb757611fb7615571565b60200260200101516127108683600081518110611fd657611fd6615571565b6020026020010151611fe891906158e9565b611ff29190615900565b9350935050509250929050565b6033546001600160a01b031633146113d35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610794565b60006119fe836001600160a01b038416613bb0565b815183511461208f5760405162461bcd60e51b815260040161079490615922565b6001600160a01b0384166120b55760405162461bcd60e51b81526004016107949061596a565b336120c4818787878787613ca3565b60005b84518110156121ad5760008582815181106120e4576120e4615571565b60200260200101519050600085838151811061210257612102615571565b6020908102919091018101516000848152606a835260408082206001600160a01b038e1683529093529190912054909150818110156121535760405162461bcd60e51b8152600401610794906159af565b6000838152606a602090815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906121929084906159f9565b92505081905550505050806121a69061559d565b90506120c7565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516121fd929190615a0c565b60405180910390a4611361818787878787613caf565b6000805260726020527fb5ad54240dc61c51d3a3e8d3f925722e010966ae263d67344c5fb60bddebddae610944828483615795565b6122536070826119e0565b156108445760405162461bcd60e51b8152602060048201526015602482015274115e1d195b9cda5bdb88189b1858dadb1a5cdd1959605a1b6044820152606401610794565b6001600160a01b03841630148015906122ba57506001600160a01b0384163b15155b6122f05760405162461bcd60e51b8152602060048201526007602482015266125b9d985b1a5960ca1b6044820152606401610794565b60405133906001600160a01b038616907fd8cb8ba4086944eabf43c5535b7712015e4d4c714b24bf812c040ea5b7a3e42a90600090a36001600160a01b0384166000908152607260205260409020612349838583615795565b506001600160a01b0384166000908152607360205260409020805460ff1916821515179055612379606e85612c48565b50610d0f84600161320b565b60006107c2825490565b60006119fe8383613e0a565b6123a784848484613a4a565b6001600160a01b03851660009081526076602052604081206123c891614a92565b6123f984848484607660008b6001600160a01b03166001600160a01b03168152602001908152602001600020613af5565b6001600160a01b038516612449577f2b6849d5976d799a5b0ca4dfd6b40a3d7afe9ea72c091fa01a958594f9a2659b8484848460405161243c9493929190615886565b60405180910390a16109a0565b846001600160a01b03167f535a93d2cb000582c0ebeaa9be4890ec6a287f98eb2df00c54c300612fd78d8f85858585604051611f199493929190615886565b6002606554036124da5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610794565b6002606555565b6124ec838383613e34565b6000828152607b60205260408120805483929061250a908490615a1f565b9091555050505050565b61251f838383613f50565b60005b8251811015610d0f5781818151811061253d5761253d615571565b6020026020010151607b600085848151811061255b5761255b615571565b6020026020010151815260200190815260200160002060008282546125809190615a1f565b9091555050600101612522565b826125aa5760405162461bcd60e51b8152600401610794906155b6565b6000607a6000868660008181106125c3576125c3615571565b602090810292909201358352508101919091526040016000908120546001600160a01b031691505b8481101561268b57816001600160a01b0316607a600088888581811061261357612613615571565b60209081029290920135835250810191909152604001600020546001600160a01b0316146126835760405162461bcd60e51b815260206004820152601c60248201527f4d69736d61746368656420746f6b656e206f726967696e61746f7273000000006044820152606401610794565b6001016125eb565b506001600160a01b03811615611361576126ac816303dc6f6560e51b61399c565b15611361576040516303dc6f6560e51b81526001600160a01b03821690637b8deca0906126e59089908990899089908990600401615a32565b600060405180830381600087803b1580156126ff57600080fd5b505af1158015612713573d6000803e3d6000fd5b50505050505050505050565b61272a606e336119e0565b6113d35760405162461bcd60e51b815260206004820152601c60248201527f4d757374206265207265676973746572656420657874656e73696f6e000000006044820152606401610794565b336000908152607260205260409020612790838583615795565b50336000908152607360205260409020805460ff19169115159190911790555050565b600054610100900460ff166127da5760405162461bcd60e51b815260040161079490615a68565b610b0c82826140ef565b600054610100900460ff1661280b5760405162461bcd60e51b815260040161079490615a68565b6113d361412f565b606d80546001600160a01b0319166001600160a01b0383169081179091556040519081527f959c0e47a2fe3cf01e237ba4892e2cc3194d77cbfb33e434e40873225d6b595f9060200160405180910390a150565b6000838152607a602052604090205433906001600160a01b0316611e41565b336000908152607460205260409020610944828483615795565b6001600160a01b0387161561294d5761294d86868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808a028281018201909352898252909350899250889182918501908490808284376000920191909152505060408051602080890282810182019093528882529093508892508791829185019084908082843760009201919091525061415f92505050565b60018514801561295d5750600183145b80156129695750600181145b156129ea576129e58686600081811061298457612984615571565b90506020020160208101906129999190614b3e565b858560008181106129ac576129ac615571565b90506020020135848460008181106129c6576129c6615571565b60408051600081526020808201909252910292909201359190506141ee565b612c3f565b6001851480156129f957508281145b15612ac3576129e586866000818110612a1457612a14615571565b9050602002016020810190612a299190614b3e565b8585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505060408051602080890282810182019093528882529093508892508791829185019084908082843760009201829052509250612a93915050565b6040519080825280601f01601f191660200182016040528015612abd576020820181803683370190505b50614223565b600183148015612ad35750600181145b15612b485760005b85811015612b4257612b3a878783818110612af857612af8615571565b9050602002016020810190612b0d9190614b3e565b86866000818110612b2057612b20615571565b90506020020135858560008181106129c6576129c6615571565b600101612adb565b50612c3f565b600183148015612b5757508481145b15612bc55760005b85811015612b4257612bbd878783818110612b7c57612b7c615571565b9050602002016020810190612b919190614b3e565b86866000818110612ba457612ba4615571565b905060200201358585858181106129c6576129c6615571565b600101612b5f565b8483148015612bd357508481145b15612c275760005b85811015612b4257612c1f878783818110612bf857612bf8615571565b9050602002016020810190612c0d9190614b3e565b868684818110612ba457612ba4615571565b600101612bdb565b60405162461bcd60e51b8152600401610794906155b6565b50505050505050565b60006119fe836001600160a01b03841661429d565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606001861115612d1557604080516001808252818301909252906020808301908036833701905050905060018211801590612cf457506001841480612cf457508584145b612d105760405162461bcd60e51b8152600401610794906155b6565b612d81565b836001600160401b03811115612d2d57612d2d614d90565b604051908082528060200260200182016040528015612d56578160200160208202803683370190505b509050811580612d6557508382145b612d815760405162461bcd60e51b8152600401610794906155b6565b60005b8151811015612df857606c60008154612d9c9061559d565b90915550606c548251839083908110612db757612db7615571565b602090810291909101810191909152606c546000908152607a9091526040902080546001600160a01b0319166001600160a01b038b16179055600101612d84565b506001600160a01b03881615612e7857612e7887878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82528794509092508a918a9182919085019084908082843760009201919091525061415f92505050565b600186148015612e89575080516001145b15612eec57612ee787876000818110612ea457612ea4615571565b9050602002016020810190612eb99190614b3e565b82600081518110612ecc57612ecc615571565b6020026020010151878760008181106129c6576129c6615571565b61303e565b6001861115612fd9576001849003612f6f5760005b86811015612f6957612f61888883818110612f1e57612f1e615571565b9050602002016020810190612f339190614b3e565b83600081518110612f4657612f46615571565b6020026020010151888860008181106129c6576129c6615571565b600101612f01565b5061303e565b60005b86811015612f6957612fd1888883818110612f8f57612f8f615571565b9050602002016020810190612fa49190614b3e565b83600081518110612fb757612fb7615571565b60200260200101518888858181106129c6576129c6615571565b600101612f72565b61303e87876000818110612fef57612fef615571565b90506020020160208101906130049190614b3e565b8287878080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509250612a93915050565b60005b81518110156130ea57828110801561307e5750600084848381811061306857613068615571565b905060200281019061307a91906155dd565b9050115b156130e25783838281811061309557613095615571565b90506020028101906130a791906155dd565b607560008585815181106130bd576130bd615571565b6020026020010151815260200190815260200160002091826130e0929190615795565b505b600101613041565b50979650505050505050565b6000805260746020527fccdf39d850e26d5964b24c5391eecfa7a13a375488d6de2101d279419f39a537610944828483615795565b816001600160a01b0316836001600160a01b03160361319e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610794565b6001600160a01b038381166000818152606b6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b61321f826001620e90cb60e41b031961399c565b15610b0c576001600160a01b038216600081815260786020908152604091829020805460ff191685151590811790915591519182527f072a7592283e2c2d1d56d21517ff6013325e0f55483f4828373ff4d98b0a1a36910160405180910390a25050565b606061328e82613295565b5092915050565b606080600060776000858152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561331757600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b900461ffff16818301528252600190920191016132cd565b5050505090508051600003613466576000848152607a60205260409020546001600160a01b031680156134645761335581634e53ee3d60e11b61399c565b156133e057604051634e53ee3d60e11b8152306004820152602481018690526001600160a01b03821690639ca7dc7a90604401600060405180830381865afa1580156133a5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526133cd9190810190615b19565b81519195509350156133e0575050915091565b6001600160a01b038116600090815260766020908152604080832080548251818502810185019093528083529193909284015b8282101561345d57600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b900461ffff1681830152825260019092019101613413565b5050505091505b505b8051600003613509576000808052607660209081527fafbc767fed27552cbeceb3d11150dacedabc53b0cc52ac5aa6285a747a1819588054604080518285028101850190915281815293919290919084015b8282101561350257600084815260209081902060408051808201909152908401546001600160a01b0381168252600160a01b900461ffff16818301528252600190920191016134b8565b5050505090505b80511561363f5780516001600160401b0381111561352957613529614d90565b604051908082528060200260200182016040528015613552578160200160208202803683370190505b50925080516001600160401b0381111561356e5761356e614d90565b604051908082528060200260200182016040528015613597578160200160208202803683370190505b50915060005b815181101561363d578181815181106135b8576135b8615571565b6020026020010151600001518482815181106135d6576135d6615571565b60200260200101906001600160a01b031690816001600160a01b03168152505081818151811061360857613608615571565b60200260200101516020015161ffff1683828151811061362a5761362a615571565b602090810291909101015260010161359d565b505b50915091565b60405133906001600160a01b038316907fd19cf84cf0fec6bec9ddfa29c63adf83a55707c712f32c8285d6180a7890147990600090a3610b0c606e82612059565b613691606e836119e0565b6136d15760405162461bcd60e51b815260206004820152601160248201527024b73b30b634b21032bc3a32b739b4b7b760791b6044820152606401610794565b6001600160a01b03811615806136f357506136f3816378ea2a9760e11b61399c565b6137315760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b6044820152606401610794565b6001600160a01b03828116600090815260796020526040902054811690821614610b0c576001600160a01b0382811660008181526079602052604080822080546001600160a01b031916948616948517905551339392917f6a835c4fcf7e0d398db3762332fdaa1471814ad39f1e2d6d0b3fdabf8efee3e091a45050565b6001600160a01b0384166137d55760405162461bcd60e51b81526004016107949061596a565b3360006137e1856142ec565b905060006137ee856142ec565b90506137fe838989858589613ca3565b6000868152606a602090815260408083206001600160a01b038c168452909152902054858110156138415760405162461bcd60e51b8152600401610794906159af565b6000878152606a602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906138809084906159f9565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46138e0848a8a8a8a8a614337565b505050505050505050565b60006001600160e01b031982166314d9799760e21b148061391c57506001600160e01b031982166328f10a2160e01b145b8061392b575061392b82611970565b8061394657506001600160e01b03198216635d9dd7eb60e11b145b8061396157506001600160e01b03198216632dde656160e21b145b8061397c57506001600160e01b031982166335681b5360e21b145b806107c257506001600160e01b0319821663152a902d60e11b1492915050565b60006139a7836143f2565b80156119fe57506119fe8383614425565b606060006139c5836144ae565b60010190506000816001600160401b038111156139e4576139e4614d90565b6040519080825280601f01601f191660200182016040528015613a0e576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084613a1857509392505050565b828114613a695760405162461bcd60e51b8152600401610794906155b6565b6000805b82811015613aa357838382818110613a8757613a87615571565b9050602002013582613a9991906159f9565b9150600101613a6d565b5061271081106109a05760405162461bcd60e51b815260206004820152601760248201527f496e76616c696420746f74616c20726f79616c746965730000000000000000006044820152606401610794565b60005b8281101561136157816040518060400160405280888885818110613b1e57613b1e615571565b9050602002016020810190613b339190614b3e565b6001600160a01b03168152602001868685818110613b5357613b53615571565b61ffff602091820293909301358316909352508354600181810186556000958652948390208451910180549490930151909116600160a01b026001600160b01b03199093166001600160a01b039091161791909117905501613af8565b60008181526001830160205260408120548015613c99576000613bd4600183615a1f565b8554909150600090613be890600190615a1f565b9050818114613c4d576000866000018281548110613c0857613c08615571565b9060005260206000200154905080876000018481548110613c2b57613c2b615571565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613c5e57613c5e615bde565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506107c2565b60009150506107c2565b61136185858585614586565b6001600160a01b0384163b156113615760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190613cf39089908990889088908890600401615bf4565b6020604051808303816000875af1925050508015613d2e575060408051601f3d908101601f19168201909252613d2b91810190615c46565b60015b613dda57613d3a615c63565b806308c379a003613d735750613d4e615c7f565b80613d595750613d75565b8060405162461bcd60e51b81526004016107949190614bab565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610794565b6001600160e01b0319811663bc197c8160e01b14612c3f5760405162461bcd60e51b815260040161079490615d08565b6000826000018281548110613e2157613e21615571565b9060005260206000200154905092915050565b6001600160a01b038316613e5a5760405162461bcd60e51b815260040161079490615d50565b336000613e66846142ec565b90506000613e73846142ec565b9050613e9383876000858560405180602001604052806000815250613ca3565b6000858152606a602090815260408083206001600160a01b038a16845290915290205484811015613ed65760405162461bcd60e51b815260040161079490615d93565b6000868152606a602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052612c3f565b6001600160a01b038316613f765760405162461bcd60e51b815260040161079490615d50565b8051825114613f975760405162461bcd60e51b815260040161079490615922565b6000339050613fba81856000868660405180602001604052806000815250613ca3565b60005b8351811015614082576000848281518110613fda57613fda615571565b602002602001015190506000848381518110613ff857613ff8615571565b6020908102919091018101516000848152606a835260408082206001600160a01b038c1683529093529190912054909150818110156140495760405162461bcd60e51b815260040161079490615d93565b6000928352606a602090815260408085206001600160a01b038b168652909152909220910390558061407a8161559d565b915050613fbd565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb86866040516140d3929190615a0c565b60405180910390a4604080516020810190915260009052610d0f565b600054610100900460ff166141165760405162461bcd60e51b815260040161079490615a68565b60686141228382615dd7565b5060696109448282615dd7565b600054610100900460ff166141565760405162461bcd60e51b815260040161079490615a68565b6113d333612c5d565b336000908152607960205260409020546001600160a01b0316156109445733600081815260796020526040908190205490516378ea2a9760e11b81526001600160a01b039091169163f1d4552e916141c09190879087908790600401615e96565b600060405180830381600087803b1580156141da57600080fd5b505af1158015612c3f573d6000803e3d6000fd5b6141fa84848484614855565b6000838152607b6020526040812080548492906142189084906159f9565b909155505050505050565b61422f84848484614937565b60005b83518110156109a05782818151811061424d5761424d615571565b6020026020010151607b600086848151811061426b5761426b615571565b60200260200101518152602001908152602001600020600082825461429091906159f9565b9091555050600101614232565b60008181526001830160205260408120546142e4575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556107c2565b5060006107c2565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061432657614326615571565b602090810291909101015292915050565b6001600160a01b0384163b156113615760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061437b9089908990889088908890600401615ede565b6020604051808303816000875af19250505080156143b6575060408051601f3d908101601f191682019092526143b391810190615c46565b60015b6143c257613d3a615c63565b6001600160e01b0319811663f23a6e6160e01b14612c3f5760405162461bcd60e51b815260040161079490615d08565b6000614405826301ffc9a760e01b614425565b80156107c2575061441e826001600160e01b0319614425565b1592915050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03166301ffc9a760e01b178152825160009392849283928392918391908a617530fa92503d91506000519050828015614497575060208210155b80156144a35750600081115b979650505050505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106144ed5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310614519576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061453757662386f26fc10000830492506010015b6305f5e100831061454f576305f5e100830492506008015b612710831061456357612710830492506004015b60648310614575576064830492506002015b600a83106107c25760010192915050565b6001600160a01b03841615610d0f576000607a6000846000815181106145ae576145ae615571565b6020026020010151815260200190815260200160002060009054906101000a90046001600160a01b0316905060005b835181101561467f57816001600160a01b0316607a600086848151811061460657614606615571565b6020908102919091018101518252810191909152604001600020546001600160a01b0316146146775760405162461bcd60e51b815260206004820152601c60248201527f4d69736d61746368656420746f6b656e206f726967696e61746f7273000000006044820152606401610794565b6001016145dd565b506001600160a01b038116158015906146b057506001600160a01b03811660009081526078602052604090205460ff165b1561477d5760405163e483517760e01b81526001600160a01b0382169063e4835177906146e99033908990899089908990600401615f16565b6020604051808303816000875af1158015614708573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061472c9190615f5c565b6147785760405162461bcd60e51b815260206004820152601a60248201527f457874656e73696f6e20617070726f76616c206661696c7572650000000000006044820152606401610794565b6109a0565b606d546001600160a01b0316156109a057606d5460405163e483517760e01b81526001600160a01b039091169063e4835177906147c69033908990899089908990600401615f16565b6020604051808303816000875af11580156147e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906148099190615f5c565b6109a05760405162461bcd60e51b815260206004820152601a60248201527f457874656e73696f6e20617070726f76616c206661696c7572650000000000006044820152606401610794565b6001600160a01b03841661487b5760405162461bcd60e51b815260040161079490615f79565b336000614887856142ec565b90506000614894856142ec565b90506148a583600089858589613ca3565b6000868152606a602090815260408083206001600160a01b038b168452909152812080548792906148d79084906159f9565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612c3f83600089898989614337565b6001600160a01b03841661495d5760405162461bcd60e51b815260040161079490615f79565b815183511461497e5760405162461bcd60e51b815260040161079490615922565b3361498e81600087878787613ca3565b60005b8451811015614a2a578381815181106149ac576149ac615571565b6020026020010151606a60008784815181106149ca576149ca615571565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254614a1291906159f9565b90915550819050614a228161559d565b915050614991565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051614a7b929190615a0c565b60405180910390a46109a081600087878787613caf565b508054600082559060005260206000209081019061084491905b80821115610cb35780546001600160b01b0319168155600101614aac565b6001600160a01b038116811461084457600080fd5b60008060408385031215614af257600080fd5b8235614afd81614aca565b946020939093013593505050565b6001600160e01b03198116811461084457600080fd5b600060208284031215614b3357600080fd5b81356119fe81614b0b565b600060208284031215614b5057600080fd5b81356119fe81614aca565b60005b83811015614b76578181015183820152602001614b5e565b50506000910152565b60008151808452614b97816020860160208601614b5b565b601f01601f19169290920160200192915050565b6020815260006119fe6020830184614b7f565b600060208284031215614bd057600080fd5b5035919050565b600081518084526020808501945080840160005b83811015614c0757815187529582019590820190600101614beb565b509495945050505050565b6020815260006119fe6020830184614bd7565b60008083601f840112614c3757600080fd5b5081356001600160401b03811115614c4e57600080fd5b602083019150836020828501011115610aac57600080fd5b600080600060408486031215614c7b57600080fd5b8335925060208401356001600160401b03811115614c9857600080fd5b614ca486828701614c25565b9497909650939450505050565b60008083601f840112614cc357600080fd5b5081356001600160401b03811115614cda57600080fd5b6020830191508360208260051b8501011115610aac57600080fd5b600080600080600060608688031215614d0d57600080fd5b8535945060208601356001600160401b0380821115614d2b57600080fd5b614d3789838a01614cb1565b90965094506040880135915080821115614d5057600080fd5b50614d5d88828901614cb1565b969995985093965092949392505050565b60008060408385031215614d8157600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715614dcb57614dcb614d90565b6040525050565b60006001600160401b03821115614deb57614deb614d90565b5060051b60200190565b600082601f830112614e0657600080fd5b81356020614e1382614dd2565b604051614e208282614da6565b83815260059390931b8501820192828101915086841115614e4057600080fd5b8286015b84811015614e5b5780358352918301918301614e44565b509695505050505050565b60006001600160401b03821115614e7f57614e7f614d90565b50601f01601f191660200190565b600082601f830112614e9e57600080fd5b8135614ea981614e66565b604051614eb68282614da6565b828152856020848701011115614ecb57600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a08688031215614f0157600080fd5b8535614f0c81614aca565b94506020860135614f1c81614aca565b935060408601356001600160401b0380821115614f3857600080fd5b614f4489838a01614df5565b94506060880135915080821115614f5a57600080fd5b614f6689838a01614df5565b93506080880135915080821115614f7c57600080fd5b50614f8988828901614e8d565b9150509295509295909350565b60008060208385031215614fa957600080fd5b82356001600160401b03811115614fbf57600080fd5b614fcb85828601614c25565b90969095509350505050565b600080600060408486031215614fec57600080fd5b8335614ff781614aca565b925060208401356001600160401b03811115614c9857600080fd5b600081518084526020808501945080840160005b83811015614c075781516001600160a01b031687529582019590820190600101615026565b6020815260006119fe6020830184615012565b6000806000806040858703121561507457600080fd5b84356001600160401b038082111561508b57600080fd5b61509788838901614cb1565b909650945060208701359150808211156150b057600080fd5b506150bd87828801614cb1565b95989497509550505050565b6000806000806000606086880312156150e157600080fd5b85356150ec81614aca565b945060208601356001600160401b0380821115614d2b57600080fd5b801515811461084457600080fd5b6000806000806060858703121561512c57600080fd5b843561513781614aca565b935060208501356001600160401b0381111561515257600080fd5b61515e87828801614c25565b909450925050604085013561517281615108565b939692955090935050565b6000806040838503121561519057600080fd5b82356001600160401b03808211156151a757600080fd5b6151b386838701614e8d565b935060208501359150808211156151c957600080fd5b506151d685828601614e8d565b9150509250929050565b600080604083850312156151f357600080fd5b82356001600160401b038082111561520a57600080fd5b818501915085601f83011261521e57600080fd5b8135602061522b82614dd2565b6040516152388282614da6565b83815260059390931b850182019282810191508984111561525857600080fd5b948201945b8386101561527f57853561527081614aca565b8252948201949082019061525d565b9650508601359250508082111561529557600080fd5b506151d685828601614df5565b600080600080600080606087890312156152bb57600080fd5b86356001600160401b03808211156152d257600080fd5b6152de8a838b01614cb1565b909850965060208901359150808211156152f757600080fd5b6153038a838b01614cb1565b9096509450604089013591508082111561531c57600080fd5b5061532989828a01614cb1565b979a9699509497509295939492505050565b60008060006040848603121561535057600080fd5b83356001600160401b0381111561536657600080fd5b61537286828701614c25565b909450925050602084013561538681615108565b809150509250925092565b600080604083850312156153a457600080fd5b82356153af81614aca565b915060208301356153bf81615108565b809150509250929050565b6000602082840312156153dc57600080fd5b81356119fe81615108565b6040815260006153fa6040830185615012565b828103602084015261540c8185614bd7565b95945050505050565b6000806040838503121561542857600080fd5b823561543381614aca565b915060208301356153bf81614aca565b600080600080600060a0868803121561545b57600080fd5b853561546681614aca565b9450602086013561547681614aca565b9350604086013592506060860135915060808601356001600160401b0381111561549f57600080fd5b614f8988828901614e8d565b60208082526024908201527f41646d696e436f6e74726f6c3a204d757374206265206f776e6572206f7220616040820152633236b4b760e11b606082015260800190565b600181811c9082168061550357607f821691505b602082108103611dfe57634e487b7160e01b600052602260045260246000fd5b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016155af576155af615587565b5060010190565b6020808252600d908201526c125b9d985b1a59081a5b9c1d5d609a1b604082015260600190565b6000808335601e198436030181126155f457600080fd5b8301803591506001600160401b0382111561560e57600080fd5b602001915036819003821315610aac57600080fd5b60008154615630816154ef565b60018281168015615648576001811461565d5761568c565b60ff198416875282151583028701945061568c565b8560005260208060002060005b858110156156835781548a82015290840190820161566a565b50505082870194505b5050505092915050565b60006156ab6156a58386615623565b84615623565b949350505050565b6000602082840312156156c557600080fd5b81516001600160401b038111156156db57600080fd5b8201601f810184136156ec57600080fd5b80516156f781614e66565b6040516157048282614da6565b82815286602084860101111561571957600080fd5b6114b5836020830160208701614b5b565b60006157368285615623565b8351615746818360208801614b5b565b01949350505050565b601f82111561094457600081815260208120601f850160051c810160208610156157765750805b601f850160051c820191505b8181101561136157828155600101615782565b6001600160401b038311156157ac576157ac614d90565b6157c0836157ba83546154ef565b8361574f565b6000601f8411600181146157f457600085156157dc5750838201355b600019600387901b1c1916600186901b1783556109a0565b600083815260209020601f19861690835b828110156158255786850135825560209485019460019092019101615805565b50868210156158425760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b81835260006001600160fb1b0383111561586d57600080fd5b8260051b80836020870137939093016020019392505050565b6040808252810184905260008560608301825b878110156158c95782356158ac81614aca565b6001600160a01b0316825260209283019290910190600101615899565b5083810360208501526158dd818688615854565b98975050505050505050565b80820281158282048414176107c2576107c2615587565b60008261591d57634e487b7160e01b600052601260045260246000fd5b500490565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b808201808211156107c2576107c2615587565b6040815260006153fa6040830185614bd7565b818103818111156107c2576107c2615587565b6001600160a01b0386168152606060208201526000615a55606083018688615854565b82810360408401526158dd818587615854565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082601f830112615ac457600080fd5b81516020615ad182614dd2565b604051615ade8282614da6565b83815260059390931b8501820192828101915086841115615afe57600080fd5b8286015b84811015614e5b5780518352918301918301615b02565b60008060408385031215615b2c57600080fd5b82516001600160401b0380821115615b4357600080fd5b818501915085601f830112615b5757600080fd5b81516020615b6482614dd2565b604051615b718282614da6565b83815260059390931b8501820192828101915089841115615b9157600080fd5b948201945b83861015615bb8578551615ba981614aca565b82529482019490820190615b96565b91880151919650909350505080821115615bd157600080fd5b506151d685828601615ab3565b634e487b7160e01b600052603160045260246000fd5b60006001600160a01b03808816835280871660208401525060a06040830152615c2060a0830186614bd7565b8281036060840152615c328186614bd7565b905082810360808401526158dd8185614b7f565b600060208284031215615c5857600080fd5b81516119fe81614b0b565b600060033d1115615c7c5760046000803e5060005160e01c5b90565b600060443d1015615c8d5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715615cbc57505050505090565b8285019150815181811115615cd45750505050505090565b843d8701016020828501011115615cee5750505050505090565b615cfd60208286010187614da6565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b81516001600160401b03811115615df057615df0614d90565b615e0481615dfe84546154ef565b8461574f565b602080601f831160018114615e395760008415615e215750858301515b600019600386901b1c1916600185901b178555611361565b600085815260208120601f198616915b82811015615e6857888601518255948401946001909101908401615e49565b5085821015615e865787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b0385168152608060208201526000615eb86080830186615012565b8281036040840152615eca8186614bd7565b905082810360608401526144a38185614bd7565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a060808301526144a360a0830184614b7f565b60006001600160a01b038088168352808716602084015280861660408401525060a06060830152615f4a60a0830185614bd7565b82810360808401526158dd8185614bd7565b600060208284031215615f6e57600080fd5b81516119fe81615108565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b60608201526080019056fea2646970667358221220ab556332a610f7685776c138d1199e5f604995eec694c1a10ecbdb243abaeedb64736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.