Feature Tip: Add private address tag to any address under My Name Tag !
ERC-721
Overview
Max Total Supply
0 Metaborg Five Stars
Holders
64
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 Metaborg Five StarsLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
MetaborgStars
Compiler Version
v0.8.13+commit.abaa5c0e
Optimization Enabled:
Yes with 10 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // Smart Contract developed by MT /* __ __ _____ _____ _ ____ ___ ____ ____ ____ _____ _ ____ ____ | \/ | ____|_ _|/ \ | __ ) / _ \| _ \ / ___| / ___|_ _|/ \ | _ \/ ___| | |\/| | _| | | / _ \ | _ \| | | | |_) | | _ \___ \ | | / _ \ | |_) \___ \ | | | | |___ | |/ ___ \| |_) | |_| | _ <| |_| | ___) || |/ ___ \| _ < ___) | |_| |_|_____| |_/_/ \_\____/ \___/|_| \_\\____| |____/ |_/_/ \_\_| \_\____/ */ pragma solidity ^0.8.13; import '@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol'; import '@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.sol'; import '@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol'; import "operator-filter-registry/src/upgradeable/DefaultOperatorFiltererUpgradeable.sol"; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; contract MetaborgStars is ERC721Upgradeable, DefaultOperatorFiltererUpgradeable, OwnableUpgradeable { using SafeMathUpgradeable for uint256; using SafeMathUpgradeable for uint8; using StringsUpgradeable for uint256; uint private randomizerIndex; uint private ownerBalance; uint8[] private availablePagesArray; uint8[] private availableStarsArray; uint public blockDelay; address public ERC1155Address; string public baseURI; uint8 public visibility; /* @dev: It will be a waterfall check based on the order specified by priority */ enum visibilityInfo { OPEN, WHITELISTED, OWNER, OWNER_OR_WHITELISTED, OWNER_AND_WHITELISTED, CLOSED } struct groupPriceStruct { uint price1; uint pack1; uint price2; uint pack2; uint price3; uint pack3; } mapping(uint => groupPriceStruct) groupPriceMetaData; mapping(uint => bytes32) burnToPhysicalEdition; mapping(uint => uint) expirationBlock; mapping(address => bool) isWhitelisted; event initializeDataEvent(uint elements, bytes32 baseURI, address ERC1155Address); event withdrawOwnerBalanceEvent(address indexed to, uint amount); event setGroupPriceEvent(uint groupID, uint pack1, uint pack2, uint pack3, uint price1, uint price2, uint price3); event deletePriceEvent(uint price); event setContactPhysicalEditionEvent(uint tokenID, bytes32 email); event setBlockDelayEvent(uint oldDelay, uint newDelay); event setWhitelistEvent(address indexed to, bool isWhitelisted); event revealURIEvent(string oldURI, string newURI); function initialize(uint[] memory _availableIDs, uint8[] memory _stars, string memory _baseURI, address _ERC1155Address) initializer public { __ERC721_init("Metaborg Five Stars by Giovanni Motta", "Metaborg Five Stars"); __Ownable_init(); __DefaultOperatorFilterer_init(); require(!checkDuplicates(_availableIDs), "ONE_OR_MORE_ID_ALREADY_SET"); ERC1155Address = _ERC1155Address; require(_stars.length < uint(256), "IPFS_LIST_TOO_LONG"); // Due to uint8 and project requirements for(uint index = uint(0); index < _stars.length; index++){ require(_stars[index] >= 0 && _stars[index] <= 5, "STAR_VALUE_NOT_VALID"); availableStarsArray.push(uint8(_stars[index])); availablePagesArray.push(uint8(_availableIDs[index])); } baseURI = _baseURI; emit initializeDataEvent(_stars.length, keccak256((abi.encodePacked(_baseURI))), _ERC1155Address); } function setWhitelistedAddresses(address[] memory _addresses, bool _toWhitelist) public onlyOwner returns(bool){ require(_addresses.length > uint(0), "NOT_ENOUGH_ADDRESSES"); for(uint index = uint(0); index < _addresses.length; index++){ isWhitelisted[_addresses[index]] = _toWhitelist; emit setWhitelistEvent(_addresses[index], _toWhitelist); } return true; } /* @dev: By default the user group is OPEN @usr: We can have 4 cases: 0 (open), 1 (whitelisted), 2 (owner), 3 (whitelisted + owner) */ function getUserGroup(address _address) public view returns(uint8){ uint result = uint(visibilityInfo.OPEN); // = 0 uint METABORG_DIAMOND_ID = uint(1); uint METABORG_GOLD_ID = uint(2); uint METABORG_ORIGINAL_ID = uint(3); IERC1155Upgradeable IERC1155 = IERC1155Upgradeable(ERC1155Address); require(ERC1155Address != address(0), "ERC1155_NOT_SET"); isWhitelisted[_address] ? result = result.add(uint(visibilityInfo.WHITELISTED)) : uint(0); // = 1 (IERC1155.balanceOf(_address, METABORG_DIAMOND_ID) > 0 || IERC1155.balanceOf(_address, METABORG_GOLD_ID) > 0 || IERC1155.balanceOf(_address, METABORG_ORIGINAL_ID) > 0) ? result = result.add(uint(visibilityInfo.OWNER)) : uint(0); // 2 // = 3 if both return uint8(result); } /* @dev: Group ID is equals to 0 (open), 1 (whitelisted), 2 (owner), 3 (whitelisted+owner) */ function setGroupMetaData(uint[] memory _prices, uint[] memory _packs, uint _groupID) public onlyOwner returns(bool){ require(_prices.length == uint(3), "PRICE_ARRAY_LENGTH_DISMATCH"); require(_packs.length == uint(3), "PACKS_ARRAY_LENGTH_DISMATCH"); require(_groupID < uint(visibilityInfo.CLOSED), "GROUP_ID_NOT_VALID"); groupPriceMetaData[_groupID].pack1 = _packs[0]; groupPriceMetaData[_groupID].pack2 = _packs[1]; groupPriceMetaData[_groupID].pack3 = _packs[2]; groupPriceMetaData[_groupID].price1 = _prices[0]; groupPriceMetaData[_groupID].price2 = _prices[1]; groupPriceMetaData[_groupID].price3 = _prices[2]; emit setGroupPriceEvent(_groupID, _packs[0], _packs[1], _packs[2], _prices[0], _prices[1], _prices[2]); return true; } function setWaitToBurn(uint _blocks) public onlyOwner returns(bool){ blockDelay = _blocks; emit setBlockDelayEvent(blockDelay, _blocks); return true; } function setVisibility(uint8 _visibility) public onlyOwner returns(bool){ require(visibility != _visibility, "SWITCH_DISMATCH"); visibility = _visibility; return true; } // OPENSEA COMPATIBILITY OVERRIDE // BaseURI Example: "https://<your-gateway>.mypinata.cloud/ipfs/<CID-Folder>/" function tokenURI(uint256 _tokenId) public override view returns (string memory) { return string(abi.encodePacked(baseURI,_tokenId.toString(),".json")); } function revealURI(string memory _newBaseURI) public onlyOwner returns(bool){ string memory oldBaseURI = baseURI; baseURI = _newBaseURI; emit revealURIEvent(oldBaseURI, _newBaseURI); return true; } // RANDOMIZER LOGIC function bytesToUint(bytes32 b) public pure returns (uint256){ uint256 number; for(uint i=uint(0);i<b.length;i++){ number = number + uint8(b[i]); } return number; } function getRandom(uint _externalMax) public returns(uint){ // _externalmax = numberOfElements require(_externalMax > 0, "CANT_DIVIDE_BY_ZERO"); uint randomNumber = bytesToUint(bytes32(keccak256(abi.encodePacked(msg.sender, block.timestamp, block.number, address(this), randomizerIndex++)))); return randomNumber.mod(_externalMax); } function shiftArray8(uint8[] memory _array, uint8[] memory _indexesToDelete) public pure returns(uint8[] memory){ uint k; bool f; uint8[] memory r = new uint8[](_array.length.sub(_indexesToDelete.length)); for(uint i = uint(0); i < _array.length; i++){ for(uint j = uint(0); j < _indexesToDelete.length; j++){ f || i == _indexesToDelete[j] ? f = true : true; } !f ? r[k++] = _array[i]: uint(0); f = false; } return r; } function checkVisibility(uint8 _userGroup) public view returns(bool){ uint8 tmpVisibility = visibility; bool result; tmpVisibility == uint8(visibilityInfo.OPEN) && _userGroup <= uint(3) ? result = true : true; // OPEN TO EVERYONE tmpVisibility == uint8(visibilityInfo.WHITELISTED) && _userGroup == uint(1) ? result = true : true; // OPEN TO WHITELISTED tmpVisibility == uint8(visibilityInfo.OWNER) && _userGroup == uint(2) ? result = true : true; // OPEN TO OWNER tmpVisibility == uint8(visibilityInfo.OWNER_OR_WHITELISTED) && _userGroup == uint(1) || _userGroup == uint(2) ? result = true : true; // OPEN TO OWNER OR WHITELISTED tmpVisibility == uint8(visibilityInfo.OWNER_AND_WHITELISTED) && _userGroup == uint(3) ? result = true : true; // OPEN TO OWNER AND WHITELISTED return result; } function buyMetaborgStars() public payable returns(uint8[] memory){ uint8 checkUserGroup = getUserGroup(msg.sender); require(checkVisibility(checkUserGroup), "RESTRICTED_FUNCTION"); // GET METADATA (uint8 pack1, uint8 pack2, uint8 pack3, uint price1, uint price2, uint price3) = getAddressMetadata(msg.sender); require(pack1 > uint(0), "UNDETECTED_METADATA"); uint8 packsPagesNumber; uint8[] memory tmpPagesAvailable = availablePagesArray; uint8[] memory tmpStarsAvailable = availableStarsArray; price1 == msg.value ? packsPagesNumber = pack1 : uint8(0); price2 == msg.value ? packsPagesNumber = pack2 : uint8(0); price3 == msg.value ? packsPagesNumber = pack3 : uint8(0); uint8[] memory randomIDList = new uint8[](uint(packsPagesNumber)); require(packsPagesNumber > 0, "NOT_VALID_MSG_VALUE"); require(tmpPagesAvailable.length >= packsPagesNumber, "NOT_ENOUGH_PAGES_AVAILABLE"); // BUYING SYSTEM bool specialPage; uint8 pageID; uint stars; for(uint index = uint(0); index < packsPagesNumber; index++) { (pageID, tmpPagesAvailable, tmpStarsAvailable, stars) = buySinglePageAndGetPageID(tmpPagesAvailable, tmpStarsAvailable, index == packsPagesNumber.sub(1) && !specialPage && (packsPagesNumber == pack2 || packsPagesNumber == pack3), packsPagesNumber == pack3 ? true : false); stars == (packsPagesNumber == pack2 ? uint(3) : uint(4)) || stars == ((packsPagesNumber == pack2 ? uint(4) : uint(5))) ? specialPage = true : true; randomIDList[index] = uint8(pageID); } availablePagesArray = new uint8[](tmpPagesAvailable.length); availableStarsArray = new uint8[](tmpStarsAvailable.length); availablePagesArray = tmpPagesAvailable; availableStarsArray = tmpStarsAvailable; ownerBalance = ownerBalance.add(msg.value); return randomIDList; } function airdropManga(address[] memory _addresses, uint[] memory _IDs) public onlyOwner returns(bool){ require(!checkDuplicates(_IDs), "ONE_OR_MORE_ID_ALREADY_SET"); require(_addresses.length == _IDs.length, "LENGHT_DISMATCH"); for(uint index = uint(0); index < _addresses.length; index++){ _safeMint(_addresses[index], _IDs[index]); } return true; } function getForcedStarArray(uint8[] memory _starsArray, bool _isPackType3) private pure returns(uint8[] memory, uint){ uint resultIndex = 0; for(uint index = uint(0); index < _starsArray.length; index++){ if(_starsArray[index] == (!_isPackType3 ? uint(3) : uint(4)) || _starsArray[index] == (!_isPackType3 ? uint(4) : uint(5))) { _starsArray[resultIndex] = uint8(index); resultIndex++; } } return (_starsArray, resultIndex); } function buySinglePageAndGetPageID(uint8[] memory _pagesAvailable, uint8[] memory _starsAvailable, bool _forceStar, bool _isPackType3) private returns(uint8, uint8[] memory, uint8[] memory, uint8){ uint8[] memory randomIndex = new uint8[](1); uint8[] memory pageID = new uint8[](1); if(_forceStar) { (uint8[] memory availableForcedPagesArray, uint elements) = getForcedStarArray(_starsAvailable, _isPackType3); elements > 0 ? randomIndex[0] = availableForcedPagesArray[getRandom(elements)] : randomIndex[0] = uint8(getRandom(_pagesAvailable.length)); } else { randomIndex[0] = uint8(getRandom(_pagesAvailable.length)); } pageID[0] = _pagesAvailable[randomIndex[0]]; _safeMint(msg.sender, pageID[0]); expirationBlock[pageID[0]] = (block.number).add(blockDelay); uint8 stars = _starsAvailable[randomIndex[0]]; return (uint8(pageID[0]), shiftArray8(_pagesAvailable, randomIndex), shiftArray8(_starsAvailable, randomIndex), stars); } function withdrawOwnerBalance(address payable _to) public onlyOwner returns(bool){ uint balance = ownerBalance; ownerBalance = uint(0); (bool sent, ) = _to.call{value : balance}(""); require(sent, "ETHERS_NOT_SENT"); emit withdrawOwnerBalanceEvent(_to, balance); return true; } function getAddressMetadata(address _address) public view returns(uint8, uint8, uint8, uint, uint, uint){ groupPriceStruct memory groupPrice = groupPriceMetaData[getUserGroup(_address)]; if(groupPrice.price1 == uint(0)) groupPrice = groupPriceMetaData[0]; return (uint8(groupPrice.pack1), uint8(groupPrice.pack2), uint8(groupPrice.pack3), groupPrice.price1, groupPrice.price2, groupPrice.price3); } function burnAndReceivePhysicalEdition(uint _tokenID, string memory _email) public returns(bool){ require(expirationBlock[_tokenID] <= block.number, "TOKEN_NOT_EXPIRED_YET"); _burn(_tokenID); //owner check is inside the function bytes32 encryptEmail = keccak256(abi.encodePacked(address(this), _tokenID, _email)); burnToPhysicalEdition[_tokenID] = encryptEmail; emit setContactPhysicalEditionEvent(_tokenID, encryptEmail); return true; } function checkEmail(uint _tokenID, string memory _email) public view returns(bool){ bool result; burnToPhysicalEdition[_tokenID] == keccak256(abi.encodePacked(address(this), _tokenID, _email)) ? result = true : result = false; return result; } function blockToExpiration(uint _tokenID) public view returns(uint){ uint result; uint expiration = expirationBlock[_tokenID]; expiration <= block.number ? result = 0 : result = expiration.sub(block.number); return result; } function getAvailablePagesNumber() public view returns(uint){ return availablePagesArray.length; } function checkDuplicates(uint[] memory _IDs) public view returns(bool){ bool r; bool f; for(uint i = uint(0); i < _IDs.length; i++){ for(uint j = uint(0); j < availablePagesArray.length; j++) f || availablePagesArray[j] == _IDs[i] ? f = true : true; r = r || f; f = false; } return r; } function transferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) { super.transferFrom(from, to, tokenId); } function safeTransferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public override onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, data); } }
// 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 // OpenZeppelin Contracts (last updated v4.8.0) (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 Internal function that returns the initialized version. Returns `_initialized` */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Internal function that returns the initialized version. Returns `_initializing` */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.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 IERC1155Upgradeable is IERC165Upgradeable { /** * @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.8.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721Upgradeable.sol"; import "./IERC721ReceiverUpgradeable.sol"; import "./extensions/IERC721MetadataUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/StringsUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC721_init_unchained(name_, symbol_); } function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _ownerOf(tokenId); require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721Upgradeable.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner or approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _ownerOf(tokenId) != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721Upgradeable.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId, 1); // Check that tokenId was not minted by `_beforeTokenTransfer` hook require(!_exists(tokenId), "ERC721: token already minted"); unchecked { // Will not overflow unless all 2**256 token ids are minted to the same owner. // Given that tokens are minted one by one, it is impossible in practice that // this ever happens. Might change if we allow batch minting. // The ERC fails to describe this case. _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId, 1); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721Upgradeable.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721Upgradeable.ownerOf(tokenId); // Clear approvals delete _tokenApprovals[tokenId]; unchecked { // Cannot overflow, as that would require more tokens to be burned/transferred // out than the owner initially received through minting and transferring in. _balances[owner] -= 1; } delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId, 1); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId, 1); // Check that tokenId was not transferred by `_beforeTokenTransfer` hook require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; unchecked { // `_balances[from]` cannot overflow for the same reason as described in `_burn`: // `from`'s balance is the number of token held, which is at least one before the current // transfer. // `_balances[to]` could overflow in the conditions described in `_mint`. That would require // all 2**256 token ids to be minted, which in practice is impossible. _balances[from] -= 1; _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId); } /** * @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, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`. * - When `from` is zero, the tokens will be minted for `to`. * - When `to` is zero, ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256, /* firstTokenId */ uint256 batchSize ) internal virtual { if (batchSize > 1) { if (from != address(0)) { _balances[from] -= batchSize; } if (to != address(0)) { _balances[to] += batchSize; } } } /** * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`. * - When `from` is zero, the tokens were minted for `to`. * - When `to` is zero, ``from``'s tokens were burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual {} /** * @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[44] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721ReceiverUpgradeable { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.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 // 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 v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @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 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 IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library MathUpgradeable { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMathUpgradeable { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/MathUpgradeable.sol"; /** * @dev String operations. */ library StringsUpgradeable { 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 = MathUpgradeable.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, MathUpgradeable.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IOperatorFilterRegistry { function isOperatorAllowed(address registrant, address operator) external view returns (bool); function register(address registrant) external; function registerAndSubscribe(address registrant, address subscription) external; function registerAndCopyEntries(address registrant, address registrantToCopy) external; function unregister(address addr) external; function updateOperator(address registrant, address operator, bool filtered) external; function updateOperators(address registrant, address[] calldata operators, bool filtered) external; function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external; function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external; function subscribe(address registrant, address registrantToSubscribe) external; function unsubscribe(address registrant, bool copyExistingEntries) external; function subscriptionOf(address addr) external returns (address registrant); function subscribers(address registrant) external returns (address[] memory); function subscriberAt(address registrant, uint256 index) external returns (address); function copyEntriesOf(address registrant, address registrantToCopy) external; function isOperatorFiltered(address registrant, address operator) external returns (bool); function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool); function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); function filteredOperators(address addr) external returns (address[] memory); function filteredCodeHashes(address addr) external returns (bytes32[] memory); function filteredOperatorAt(address registrant, uint256 index) external returns (address); function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); function isRegistered(address addr) external returns (bool); function codeHashOf(address addr) external returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {OperatorFiltererUpgradeable} from "./OperatorFiltererUpgradeable.sol"; abstract contract DefaultOperatorFiltererUpgradeable is OperatorFiltererUpgradeable { address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6); function __DefaultOperatorFilterer_init() internal onlyInitializing { OperatorFiltererUpgradeable.__OperatorFilterer_init(DEFAULT_SUBSCRIPTION, true); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IOperatorFilterRegistry} from "../IOperatorFilterRegistry.sol"; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; abstract contract OperatorFiltererUpgradeable is Initializable { error OperatorNotAllowed(address operator); IOperatorFilterRegistry constant operatorFilterRegistry = IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E); function __OperatorFilterer_init(address subscriptionOrRegistrantToCopy, bool subscribe) internal onlyInitializing { // If an inheriting token contract is deployed to a network without the registry deployed, the modifier // will not revert, but the contract will need to be registered with the registry once it is deployed in // order for the modifier to filter addresses. if (address(operatorFilterRegistry).code.length > 0) { if (!operatorFilterRegistry.isRegistered(address(this))) { if (subscribe) { operatorFilterRegistry.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy); } else { if (subscriptionOrRegistrantToCopy != address(0)) { operatorFilterRegistry.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy); } else { operatorFilterRegistry.register(address(this)); } } } } } modifier onlyAllowedOperator(address from) virtual { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(operatorFilterRegistry).code.length > 0) { // Allow spending tokens from addresses with balance // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred // from an EOA. if (from == msg.sender) { _; return; } if (!operatorFilterRegistry.isOperatorAllowed(address(this), msg.sender)) { revert OperatorNotAllowed(msg.sender); } } _; } modifier onlyAllowedOperatorApproval(address operator) virtual { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(operatorFilterRegistry).code.length > 0) { if (!operatorFilterRegistry.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(operator); } } _; } }
{ "optimizer": { "enabled": true, "runs": 10 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"deletePriceEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"elements","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"baseURI","type":"bytes32"},{"indexed":false,"internalType":"address","name":"ERC1155Address","type":"address"}],"name":"initializeDataEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"oldURI","type":"string"},{"indexed":false,"internalType":"string","name":"newURI","type":"string"}],"name":"revealURIEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldDelay","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newDelay","type":"uint256"}],"name":"setBlockDelayEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenID","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"email","type":"bytes32"}],"name":"setContactPhysicalEditionEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"groupID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"pack1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"pack2","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"pack3","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price2","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price3","type":"uint256"}],"name":"setGroupPriceEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"bool","name":"isWhitelisted","type":"bool"}],"name":"setWhitelistEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawOwnerBalanceEvent","type":"event"},{"inputs":[],"name":"ERC1155Address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"},{"internalType":"uint256[]","name":"_IDs","type":"uint256[]"}],"name":"airdropManga","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blockDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenID","type":"uint256"}],"name":"blockToExpiration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenID","type":"uint256"},{"internalType":"string","name":"_email","type":"string"}],"name":"burnAndReceivePhysicalEdition","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"buyMetaborgStars","outputs":[{"internalType":"uint8[]","name":"","type":"uint8[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"b","type":"bytes32"}],"name":"bytesToUint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_IDs","type":"uint256[]"}],"name":"checkDuplicates","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenID","type":"uint256"},{"internalType":"string","name":"_email","type":"string"}],"name":"checkEmail","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_userGroup","type":"uint8"}],"name":"checkVisibility","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getAddressMetadata","outputs":[{"internalType":"uint8","name":"","type":"uint8"},{"internalType":"uint8","name":"","type":"uint8"},{"internalType":"uint8","name":"","type":"uint8"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAvailablePagesNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_externalMax","type":"uint256"}],"name":"getRandom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getUserGroup","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_availableIDs","type":"uint256[]"},{"internalType":"uint8[]","name":"_stars","type":"uint8[]"},{"internalType":"string","name":"_baseURI","type":"string"},{"internalType":"address","name":"_ERC1155Address","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newBaseURI","type":"string"}],"name":"revealURI","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_prices","type":"uint256[]"},{"internalType":"uint256[]","name":"_packs","type":"uint256[]"},{"internalType":"uint256","name":"_groupID","type":"uint256"}],"name":"setGroupMetaData","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_visibility","type":"uint8"}],"name":"setVisibility","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_blocks","type":"uint256"}],"name":"setWaitToBurn","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"},{"internalType":"bool","name":"_toWhitelist","type":"bool"}],"name":"setWhitelistedAddresses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8[]","name":"_array","type":"uint8[]"},{"internalType":"uint8[]","name":"_indexesToDelete","type":"uint8[]"}],"name":"shiftArray8","outputs":[{"internalType":"uint8[]","name":"","type":"uint8[]"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"visibility","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"_to","type":"address"}],"name":"withdrawOwnerBalance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5061450b806100206000396000f3fe6080604052600436106101cb5760003560e01c806301ffc9a7146101d057806306fdde0314610205578063081812fc14610227578063095ea7b3146102545780630e916e461461027657806312d4ec571461028b57806323b872dd146102aa57806329adec14146102ca5780632f893de7146102f657806342842e0e1461031657806347812e34146103365780635148fdc8146103565780635a155b60146103765780636352211e1461039657806367478a35146103b657806369292694146103d65780636c0360eb146103f6578063709250c91461040b57806370a082311461042b578063715018a61461044b578063733b4782146104605780638631dc1d146104805780638da5cb5b146104a05780638ea6fcd0146104b557806395d89b41146104d55780639fc4c3b1146104ea578063a22cb4651461050a578063aa024e8b1461052a578063b36d31971461054a578063b88d4fde1461056a578063bf2773fb1461058a578063c87b56dd146105e2578063cd4b691414610602578063cfc5a96914610622578063d834a2d014610642578063d98f608814610662578063dc79b17614610678578063e985e9c514610698578063f2fde38b146106b8578063f5c12bd5146106d8575b600080fd5b3480156101dc57600080fd5b506101f06101eb366004613866565b6106f8565b60405190151581526020015b60405180910390f35b34801561021157600080fd5b5061021a61074a565b6040516101fc91906138db565b34801561023357600080fd5b506102476102423660046138ee565b6107dc565b6040516101fc9190613907565b34801561026057600080fd5b5061027461026f366004613930565b610803565b005b61027e61091d565b6040516101fc919061395c565b34801561029757600080fd5b5060cb545b6040519081526020016101fc565b3480156102b657600080fd5b506102746102c53660046139a3565b610dda565b3480156102d657600080fd5b5060d0546102e49060ff1681565b60405160ff90911681526020016101fc565b34801561030257600080fd5b506101f0610311366004613acf565b610eb4565b34801561032257600080fd5b506102746103313660046139a3565b610fe2565b34801561034257600080fd5b506101f0610351366004613b7b565b6110b1565b34801561036257600080fd5b506101f0610371366004613c26565b611172565b34801561038257600080fd5b506101f0610391366004613c6c565b61124f565b3480156103a257600080fd5b506102476103b13660046138ee565b61131c565b3480156103c257600080fd5b506101f06103d1366004613cc5565b611350565b3480156103e257600080fd5b506101f06103f1366004613c26565b611446565b34801561040257600080fd5b5061021a61149e565b34801561041757600080fd5b5060ce54610247906001600160a01b031681565b34801561043757600080fd5b5061029c610446366004613cc5565b61152c565b34801561045757600080fd5b506102746115b2565b34801561046c57600080fd5b5061027e61047b366004613d55565b6115c6565b34801561048c57600080fd5b506101f061049b366004613dae565b611706565b3480156104ac57600080fd5b506102476117d7565b3480156104c157600080fd5b506101f06104d0366004613dc9565b6117e6565b3480156104e157600080fd5b5061021a611b19565b3480156104f657600080fd5b506101f0610505366004613e35565b611b28565b34801561051657600080fd5b50610274610525366004613e69565b611c19565b34801561053657600080fd5b506101f0610545366004613dae565b611c28565b34801561055657600080fd5b50610274610565366004613e97565b611c94565b34801561057657600080fd5b50610274610585366004613f31565b612068565b34801561059657600080fd5b506105aa6105a5366004613cc5565b61213e565b6040805160ff9788168152958716602087015293909516928401929092526060830152608082015260a081019190915260c0016101fc565b3480156105ee57600080fd5b5061021a6105fd3660046138ee565b6122dd565b34801561060e57600080fd5b5061029c61061d3660046138ee565b612311565b34801561062e57600080fd5b5061029c61063d3660046138ee565b6123e3565b34801561064e57600080fd5b506101f061065d3660046138ee565b61242b565b34801561066e57600080fd5b5061029c60cd5481565b34801561068457600080fd5b506102e4610693366004613cc5565b61247b565b3480156106a457600080fd5b506101f06106b3366004613fb0565b612693565b3480156106c457600080fd5b506102746106d3366004613cc5565b6126c1565b3480156106e457600080fd5b5061029c6106f33660046138ee565b61273a565b60006001600160e01b031982166380ac58cd60e01b148061072957506001600160e01b03198216635b5e139f60e01b145b8061074457506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606065805461075990613fde565b80601f016020809104026020016040519081016040528092919081815260200182805461078590613fde565b80156107d25780601f106107a7576101008083540402835291602001916107d2565b820191906000526020600020905b8154815290600101906020018083116107b557829003601f168201915b5050505050905090565b60006107e78261276f565b506000908152606960205260409020546001600160a01b031690565b600061080e8261131c565b9050806001600160a01b0316836001600160a01b0316036108805760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148061089c575061089c8133612693565b61090e5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610877565b6109188383612794565b505050565b6060600061092a3361247b565b905061093581611706565b6109775760405162461bcd60e51b81526020600482015260136024820152722922a9aa2924a1aa22a22fa32aa721aa24a7a760691b6044820152606401610877565b6000806000806000806109893361213e565b95509550955095509550955060008660ff16116109de5760405162461bcd60e51b8152602060048201526013602482015272554e44455445435445445f4d4554414441544160681b6044820152606401610877565b60008060cb805480602002602001604051908101604052809291908181526020018280548015610a4b57602002820191906000526020600020906000905b825461010083900a900460ff16815260206001928301818104948501949093039092029101808411610a1c5790505b50505050509050600060cc805480602002602001604051908101604052809291908181526020018280548015610abe57602002820191906000526020600020906000905b825461010083900a900460ff16815260206001928301818104948501949093039092029101808411610a8f5790505b50505050509050348614610ad3576000610ad8565b889250825b50348514610ae7576000610aec565b879250825b50348414610afb576000610b00565b869250825b5060008360ff166001600160401b03811115610b1e57610b1e6139e4565b604051908082528060200260200182016040528015610b47578160200160208202803683370190505b50905060008460ff1611610b935760405162461bcd60e51b81526020600482015260136024820152724e4f545f56414c49445f4d53475f56414c554560681b6044820152606401610877565b8360ff1683511015610be45760405162461bcd60e51b815260206004820152601a6024820152794e4f545f454e4f5547485f50414745535f415641494c41424c4560301b6044820152606401610877565b60008080805b8760ff16811015610cde57610c4f8787610c0860ff8c166001612802565b84148015610c14575086155b8015610c3457508f60ff168b60ff161480610c3457508e60ff168b60ff16145b8f60ff168c60ff1614610c4857600061280e565b600161280e565b919950975090935060ff9081169250888116908e1614610c70576004610c73565b60035b821480610c9557508c60ff168860ff1614610c8f576005610c92565b60045b82145b610ca0576001610ca6565b60019350835b5082858281518110610cba57610cba614018565b60ff9092166020928302919091019091015280610cd681614044565b915050610bea565b5085516001600160401b03811115610cf857610cf86139e4565b604051908082528060200260200182016040528015610d21578160200160208202803683370190505b508051610d369160cb91602090910190613721565b5084516001600160401b03811115610d5057610d506139e4565b604051908082528060200260200182016040528015610d79578160200160208202803683370190505b508051610d8e9160cc91602090910190613721565b508551610da29060cb906020890190613721565b508451610db69060cc906020880190613721565b5060ca54610dc49034612a79565b60ca5550919d9c50505050505050505050505050565b826daaeb6d7670e522a718067333cd4e3b15610ea357336001600160a01b03821603610e1057610e0b848484612a85565b610eae565b604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c617113490610e43903090339060040161405d565b602060405180830381865afa158015610e60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e849190614077565b610ea35733604051633b79c77360e21b81526004016108779190613907565b610eae848484612a85565b50505050565b6000610ebe612ab6565b6000835111610f065760405162461bcd60e51b81526020600482015260146024820152734e4f545f454e4f5547485f41444452455353455360601b6044820152606401610877565b60005b8351811015610fd8578260d46000868481518110610f2957610f29614018565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550838181518110610f7a57610f7a614018565b60200260200101516001600160a01b03167f797df8152fef05e1c847b09d5f957ce3775cdf432504ba0194c970db40d90d2b84604051610fbe911515815260200190565b60405180910390a280610fd081614044565b915050610f09565b5060019392505050565b826daaeb6d7670e522a718067333cd4e3b156110a657336001600160a01b0382160361101357610e0b848484612b15565b604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c617113490611046903090339060040161405d565b602060405180830381865afa158015611063573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110879190614077565b6110a65733604051633b79c77360e21b81526004016108779190613907565b610eae848484612b15565b60008080805b84518110156111695760005b60cb5481101561114757828061112357508582815181106110e6576110e6614018565b602002602001015160cb828154811061110157611101614018565b60009182526020918290209181049091015460ff601f9092166101000a900416145b61112e576001611134565b60019250825b508061113f81614044565b9150506110c3565b5082806111515750815b9250600091508061116181614044565b9150506110b7565b50909392505050565b600082815260d360205260408120544310156111c85760405162461bcd60e51b81526020600482015260156024820152741513d2d15397d393d517d156141254915117d65155605a1b6044820152606401610877565b6111d183612b30565b60003084846040516020016111e8939291906140b0565b60408051808303601f190181528282528051602091820120600088815260d2835283902081905587845290830181905292507f3844671c71c87c1f77bab75d13b60f0e3be9cf4fad9fcdccbd5b600d048c3059910160405180910390a15060019392505050565b6000611259612ab6565b611262826110b1565b1561127f5760405162461bcd60e51b8152600401610877906140ed565b81518351146112c25760405162461bcd60e51b815260206004820152600f60248201526e0988a9c8e90a8be8892a69a82a8869608b1b6044820152606401610877565b60005b8351811015610fd85761130a8482815181106112e3576112e3614018565b60200260200101518483815181106112fd576112fd614018565b6020026020010151612bc1565b8061131481614044565b9150506112c5565b60008061132883612bdb565b90506001600160a01b0381166107445760405162461bcd60e51b815260040161087790614121565b600061135a612ab6565b60ca80546000918290556040519091906001600160a01b0385169083908381818185875af1925050503d80600081146113af576040519150601f19603f3d011682016040523d82523d6000602084013e6113b4565b606091505b50509050806113f75760405162461bcd60e51b815260206004820152600f60248201526e115512115494d7d393d517d4d15395608a1b6044820152606401610877565b836001600160a01b03167f883358c690ec4db7ac22c3d968b82161d86afa6eac861ecbea27d5f2676232ce8360405161143291815260200190565b60405180910390a26001925050505b919050565b60008030848460405160200161145e939291906140b0565b60408051601f198184030181529181528151602092830120600087815260d2909352912054146114915750600080611496565b506001805b509392505050565b60cf80546114ab90613fde565b80601f01602080910402602001604051908101604052809291908181526020018280546114d790613fde565b80156115245780601f106114f957610100808354040283529160200191611524565b820191906000526020600020905b81548152906001019060200180831161150757829003601f168201915b505050505081565b60006001600160a01b0382166115965760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610877565b506001600160a01b031660009081526068602052604090205490565b6115ba612ab6565b6115c46000612bf6565b565b606060008060006115e28551875161280290919063ffffffff16565b6001600160401b038111156115f9576115f96139e4565b604051908082528060200260200182016040528015611622578160200160208202803683370190505b50905060005b86518110156116fc5760005b8651811015611688578380611664575086818151811061165657611656614018565b602002602001015160ff1682145b61166f576001611675565b60019350835b508061168081614044565b915050611634565b5082156116965760006116e5565b8681815181106116a8576116a8614018565b60200260200101518285806116bc90614044565b9650815181106116ce576116ce614018565b602002602001019060ff16908160ff1681525060ff165b5060009250806116f481614044565b915050611628565b5095945050505050565b60d05460009060ff168181158015611722575060038460ff1611155b61172d576001611732565b506001805b5060ff82166001148015611749575060018460ff16145b611754576001611759565b506001805b5060ff82166002148015611770575060028460ff16145b61177b576001611780565b506001805b5060ff82166003148015611797575060018460ff16145b806117a5575060028460ff16145b6117b05760016117b5565b506001805b5060ff821660041480156117cc575060038460ff16145b611491576001611496565b6097546001600160a01b031690565b60006117f0612ab6565b600384511461183f5760405162461bcd60e51b815260206004820152601b60248201527a0a0a492868abe82a4a482b2be988a9c8ea890be8892a69a82a8869602b1b6044820152606401610877565b600383511461188e5760405162461bcd60e51b815260206004820152601b60248201527a0a0828696a6be82a4a482b2be988a9c8ea890be8892a69a82a8869602b1b6044820152606401610877565b600582106118d35760405162461bcd60e51b815260206004820152601260248201527111d493d55417d25117d393d517d59053125160721b6044820152606401610877565b826000815181106118e6576118e6614018565b602002602001015160d16000848152602001908152602001600020600101819055508260018151811061191b5761191b614018565b602002602001015160d16000848152602001908152602001600020600301819055508260028151811061195057611950614018565b602002602001015160d16000848152602001908152602001600020600501819055508360008151811061198557611985614018565b602002602001015160d1600084815260200190815260200160002060000181905550836001815181106119ba576119ba614018565b602002602001015160d1600084815260200190815260200160002060020181905550836002815181106119ef576119ef614018565b602002602001015160d16000848152602001908152602001600020600401819055507fe8f0b083ced320cb8c7c9c5e9a119447f22800a68b938692928818576969df8a8284600081518110611a4657611a46614018565b602002602001015185600181518110611a6157611a61614018565b602002602001015186600281518110611a7c57611a7c614018565b602002602001015188600081518110611a9757611a97614018565b602002602001015189600181518110611ab257611ab2614018565b60200260200101518a600281518110611acd57611acd614018565b60209081029190910181015160408051988952918801969096528601939093526060850191909152608084015260a083015260c082015260e00160405180910390a15060019392505050565b60606066805461075990613fde565b6000611b32612ab6565b600060cf8054611b4190613fde565b80601f0160208091040260200160405190810160405280929190818152602001828054611b6d90613fde565b8015611bba5780601f10611b8f57610100808354040283529160200191611bba565b820191906000526020600020905b815481529060010190602001808311611b9d57829003601f168201915b50508651939450611bd69360cf935060208801925090506137c7565b507f2d282b1217bad6dc4b2b12d8c46b39d4f6cbc709311fc62edd56e1dfc0b861888184604051611c08929190614153565b60405180910390a150600192915050565b611c24338383612c48565b5050565b6000611c32612ab6565b60d05460ff808416911603611c7b5760405162461bcd60e51b815260206004820152600f60248201526e0a6ae92a88690be8892a69a82a8869608b1b6044820152606401610877565b5060d0805460ff831660ff199091161790556001919050565b600054610100900460ff1615808015611cb45750600054600160ff909116105b80611cd55750611cc330612d12565b158015611cd5575060005460ff166001145b611d385760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610877565b6000805460ff191660011790558015611d5b576000805461ff0019166101001790555b611da86040518060600160405280602581526020016144b160259139604051806040016040528060138152602001724d657461626f7267204669766520537461727360681b815250612d21565b611db0612d52565b611db8612d81565b611dc1856110b1565b15611dde5760405162461bcd60e51b8152600401610877906140ed565b60ce80546001600160a01b0319166001600160a01b038416179055835161010011611e405760405162461bcd60e51b8152602060048201526012602482015271495046535f4c4953545f544f4f5f4c4f4e4760701b6044820152606401610877565b60005b8451811015611f98576000858281518110611e6057611e60614018565b602002602001015160ff1610158015611e9657506005858281518110611e8857611e88614018565b602002602001015160ff1611155b611ed95760405162461bcd60e51b815260206004820152601460248201527314d5105497d59053155157d393d517d59053125160621b6044820152606401610877565b60cc858281518110611eed57611eed614018565b6020908102919091018101518254600181018455600093845292829020918304909101805460ff928316601f9094166101000a9384029290930219909216179055855160cb90879083908110611f4557611f45614018565b6020908102919091018101518254600181018455600093845292829020918304909101805460ff928316601f9094166101000a938402929093021990921617905580611f9081614044565b915050611e43565b508251611fac9060cf9060208601906137c7565b507fe1d3a3bca75988c86bcfa8099cf351536e85ea01b8d94621b85c8592a0af02cb845184604051602001611fe19190614181565b60408051808303601f1901815282825280516020918201209383528201929092526001600160a01b0385168183015290519081900360600190a18015612061576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b836daaeb6d7670e522a718067333cd4e3b1561213257336001600160a01b0382160361209f5761209a85858585612dc7565b612061565b604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c6171134906120d2903090339060040161405d565b602060405180830381865afa1580156120ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121139190614077565b6121325733604051633b79c77360e21b81526004016108779190613907565b61206185858585612dc7565b600080600080600080600060d160006121568a61247b565b60ff1681526020808201929092526040908101600020815160c081018352815480825260018301549482019490945260028201549281019290925260038101546060830152600481015460808301526005015460a082015291506122ad57506000805260d160209081526040805160c0810182527efa5413e7b01fc543d01f0911de573ace463b956369df4472f39030e8d98b775481527efa5413e7b01fc543d01f0911de573ace463b956369df4472f39030e8d98b7854928101929092527efa5413e7b01fc543d01f0911de573ace463b956369df4472f39030e8d98b7954908201527efa5413e7b01fc543d01f0911de573ace463b956369df4472f39030e8d98b7a5460608201527efa5413e7b01fc543d01f0911de573ace463b956369df4472f39030e8d98b7b5460808201527efa5413e7b01fc543d01f0911de573ace463b956369df4472f39030e8d98b7c5460a08201525b6020810151606082015160a083015183516040850151608090950151939c929b5090995097509195509350915050565b606060cf6122ea83612df9565b6040516020016122fb92919061419d565b6040516020818303038152906040529050919050565b60008082116123585760405162461bcd60e51b815260206004820152601360248201527243414e545f4449564944455f42595f5a45524f60681b6044820152606401610877565b60006123d03342433060c9600081548092919061237490614044565b909155506040516001600160601b0319606096871b8116602083015260348201959095526054810193909352931b9091166074820152608881019190915260a801604051602081830303815290604052805190602001206123e3565b90506123dc8184612e8b565b9392505050565b60008060005b60208110156124245783816020811061240457612404614018565b61241091901a8361424e565b91508061241c81614044565b9150506123e9565b5092915050565b6000612435612ab6565b60cd82905560408051838152602081018490527f5e94f8c01695abbf08373b065e8bbf0a3942da7fe65a0475121a305dd07a7458910160405180910390a1506001919050565b60ce5460009081906001906002906003906001600160a01b0316806124d45760405162461bcd60e51b815260206004820152600f60248201526e115490cc4c4d4d57d393d517d4d155608a1b6044820152606401610877565b6001600160a01b038716600090815260d4602052604090205460ff166124fb57600061250c565b61250860015b8690612a79565b9450845b50604051627eeac760e11b81526000906001600160a01b0383169062fdd58e9061253c908b908990600401614266565b602060405180830381865afa158015612559573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061257d919061427f565b11806125f65750604051627eeac760e11b81526000906001600160a01b0383169062fdd58e906125b3908b908890600401614266565b602060405180830381865afa1580156125d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125f4919061427f565b115b8061266e5750604051627eeac760e11b81526000906001600160a01b0383169062fdd58e9061262b908b908790600401614266565b602060405180830381865afa158015612648573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061266c919061427f565b115b612679576000612687565b6126836002612501565b9450845b50939695505050505050565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b6126c9612ab6565b6001600160a01b03811661272e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610877565b61273781612bf6565b50565b600081815260d360205260408120548190438111156127655761275d8143612802565b915081611169565b5060009392505050565b61277881612e97565b6127375760405162461bcd60e51b815260040161087790614121565b600081815260696020526040902080546001600160a01b0319166001600160a01b03841690811790915581906127c98261131c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006123dc8284614298565b60408051600180825281830190925260009160609182918491829160208083019080368337505060408051600180825281830190925292935060009291506020808301908036833701905050905087156129015760008061286f8b8a612eb4565b91509150600081116128b0576128858c51612311565b8460008151811061289857612898614018565b602002602001019060ff16908160ff168152506128f9565b816128ba82612311565b815181106128ca576128ca614018565b6020026020010151846000815181106128e5576128e5614018565b602002602001019060ff16908160ff168152505b505050612933565b61290b8a51612311565b8260008151811061291e5761291e614018565b602002602001019060ff16908160ff16815250505b898260008151811061294757612947614018565b602002602001015160ff168151811061296257612962614018565b60200260200101518160008151811061297d5761297d614018565b602002602001019060ff16908160ff16815250506129b833826000815181106129a8576129a8614018565b602002602001015160ff16612bc1565b60cd546129c6904390612a79565b60d36000836000815181106129dd576129dd614018565b602002602001015160ff1681526020019081526020016000208190555060008983600081518110612a1057612a10614018565b602002602001015160ff1681518110612a2b57612a2b614018565b6020026020010151905081600081518110612a4857612a48614018565b6020026020010151612a5a8c856115c6565b612a648c866115c6565b919d909c50909a509098509650505050505050565b60006123dc828461424e565b612a8f3382612f7a565b612aab5760405162461bcd60e51b8152600401610877906142af565b610918838383612fd9565b33612abf6117d7565b6001600160a01b0316146115c45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610877565b61091883838360405180602001604052806000815250612068565b6000612b3b8261131c565b9050612b4b816000846001613138565b612b548261131c565b600083815260696020908152604080832080546001600160a01b03199081169091556001600160a01b038516808552606884528285208054600019019055878552606790935281842080549091169055519293508492600080516020614491833981519152908390a45050565b611c248282604051806020016040528060008152506131c0565b6000908152606760205260409020546001600160a01b031690565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031603612ca55760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610877565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b03163b151590565b600054610100900460ff16612d485760405162461bcd60e51b8152600401610877906142fc565b611c2482826131f3565b600054610100900460ff16612d795760405162461bcd60e51b8152600401610877906142fc565b6115c4613241565b600054610100900460ff16612da85760405162461bcd60e51b8152600401610877906142fc565b6115c4733cc6cdda760b79bafa08df41ecfa224f810dceb66001613271565b612dd13383612f7a565b612ded5760405162461bcd60e51b8152600401610877906142af565b610eae84848484613407565b60606000612e068361343a565b60010190506000816001600160401b03811115612e2557612e256139e4565b6040519080825280601f01601f191660200182016040528015612e4f576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612e5957509392505050565b60006123dc8284614347565b600080612ea383612bdb565b6001600160a01b0316141592915050565b6060600080805b8551811015612f71578415612ed1576004612ed4565b60035b868281518110612ee657612ee6614018565b602002602001015160ff161480612f2757508415612f05576005612f08565b60045b868281518110612f1a57612f1a614018565b602002602001015160ff16145b15612f5f5780868381518110612f3f57612f3f614018565b60ff9092166020928302919091019091015281612f5b81614044565b9250505b80612f6981614044565b915050612ebb565b50939492505050565b600080612f868361131c565b9050806001600160a01b0316846001600160a01b03161480612fad5750612fad8185612693565b80612fd15750836001600160a01b0316612fc6846107dc565b6001600160a01b0316145b949350505050565b826001600160a01b0316612fec8261131c565b6001600160a01b0316146130125760405162461bcd60e51b815260040161087790614369565b6001600160a01b0382166130745760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610877565b6130818383836001613138565b826001600160a01b03166130948261131c565b6001600160a01b0316146130ba5760405162461bcd60e51b815260040161087790614369565b600081815260696020908152604080832080546001600160a01b03199081169091556001600160a01b03878116808652606885528386208054600019019055908716808652838620805460010190558686526067909452828520805490921684179091559051849360008051602061449183398151915291a4505050565b6001811115610eae576001600160a01b0384161561317e576001600160a01b03841660009081526068602052604081208054839290613178908490614298565b90915550505b6001600160a01b03831615610eae576001600160a01b038316600090815260686020526040812080548392906131b590849061424e565b909155505050505050565b6131ca8383613510565b6131d76000848484613619565b6109185760405162461bcd60e51b8152600401610877906143ae565b600054610100900460ff1661321a5760405162461bcd60e51b8152600401610877906142fc565b815161322d9060659060208501906137c7565b5080516109189060669060208401906137c7565b600054610100900460ff166132685760405162461bcd60e51b8152600401610877906142fc565b6115c433612bf6565b600054610100900460ff166132985760405162461bcd60e51b8152600401610877906142fc565b6daaeb6d7670e522a718067333cd4e3b15611c245760405163c3c5a54760e01b81526daaeb6d7670e522a718067333cd4e9063c3c5a547906132de903090600401613907565b6020604051808303816000875af11580156132fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133219190614077565b611c2457801561339457604051633e9f1edf60e11b81526daaeb6d7670e522a718067333cd4e90637d3e3dbe9061335e903090869060040161405d565b600060405180830381600087803b15801561337857600080fd5b505af115801561338c573d6000803e3d6000fd5b505050505050565b6001600160a01b038216156133d65760405163a0af290360e01b81526daaeb6d7670e522a718067333cd4e9063a0af29039061335e903090869060040161405d565b604051632210724360e11b81526daaeb6d7670e522a718067333cd4e90634420e4869061335e903090600401613907565b613412848484612fd9565b61341e84848484613619565b610eae5760405162461bcd60e51b8152600401610877906143ae565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106134795772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b83106134a3576904ee2d6d415b85acef8160201b830492506020015b662386f26fc1000083106134c157662386f26fc10000830492506010015b6305f5e10083106134d9576305f5e100830492506008015b61271083106134ed57612710830492506004015b606483106134ff576064830492506002015b600a83106107445760010192915050565b6001600160a01b0382166135665760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610877565b61356f81612e97565b1561358c5760405162461bcd60e51b815260040161087790614400565b61359a600083836001613138565b6135a381612e97565b156135c05760405162461bcd60e51b815260040161087790614400565b6001600160a01b038216600081815260686020908152604080832080546001019055848352606790915280822080546001600160a01b031916841790555183929190600080516020614491833981519152908290a45050565b600061362d846001600160a01b0316612d12565b1561371657604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613664903390899088908890600401614436565b6020604051808303816000875af192505050801561369f575060408051601f3d908101601f1916820190925261369c91810190614473565b60015b6136fc573d8080156136cd576040519150601f19603f3d011682016040523d82523d6000602084013e6136d2565b606091505b5080516000036136f45760405162461bcd60e51b8152600401610877906143ae565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612fd1565b506001949350505050565b82805482825590600052602060002090601f016020900481019282156137b75791602002820160005b8382111561378857835183826101000a81548160ff021916908360ff160217905550926020019260010160208160000104928301926001030261374a565b80156137b55782816101000a81549060ff0219169055600101602081600001049283019260010302613788565b505b506137c392915061383b565b5090565b8280546137d390613fde565b90600052602060002090601f0160209004810192826137f557600085556137b7565b82601f1061380e57805160ff19168380011785556137b7565b828001600101855582156137b7579182015b828111156137b7578251825591602001919060010190613820565b5b808211156137c3576000815560010161383c565b6001600160e01b03198116811461273757600080fd5b60006020828403121561387857600080fd5b81356123dc81613850565b60005b8381101561389e578181015183820152602001613886565b83811115610eae5750506000910152565b600081518084526138c7816020860160208601613883565b601f01601f19169290920160200192915050565b6020815260006123dc60208301846138af565b60006020828403121561390057600080fd5b5035919050565b6001600160a01b0391909116815260200190565b6001600160a01b038116811461273757600080fd5b6000806040838503121561394357600080fd5b823561394e8161391b565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b8181101561399757835160ff1683529284019291840191600101613978565b50909695505050505050565b6000806000606084860312156139b857600080fd5b83356139c38161391b565b925060208401356139d38161391b565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715613a2257613a226139e4565b604052919050565b60006001600160401b03821115613a4357613a436139e4565b5060051b60200190565b600082601f830112613a5e57600080fd5b81356020613a73613a6e83613a2a565b6139fa565b82815260059290921b84018101918181019086841115613a9257600080fd5b8286015b84811015613ab6578035613aa98161391b565b8352918301918301613a96565b509695505050505050565b801515811461273757600080fd5b60008060408385031215613ae257600080fd5b82356001600160401b03811115613af857600080fd5b613b0485828601613a4d565b9250506020830135613b1581613ac1565b809150509250929050565b600082601f830112613b3157600080fd5b81356020613b41613a6e83613a2a565b82815260059290921b84018101918181019086841115613b6057600080fd5b8286015b84811015613ab65780358352918301918301613b64565b600060208284031215613b8d57600080fd5b81356001600160401b03811115613ba357600080fd5b612fd184828501613b20565b60006001600160401b03831115613bc857613bc86139e4565b613bdb601f8401601f19166020016139fa565b9050828152838383011115613bef57600080fd5b828260208301376000602084830101529392505050565b600082601f830112613c1757600080fd5b6123dc83833560208501613baf565b60008060408385031215613c3957600080fd5b8235915060208301356001600160401b03811115613c5657600080fd5b613c6285828601613c06565b9150509250929050565b60008060408385031215613c7f57600080fd5b82356001600160401b0380821115613c9657600080fd5b613ca286838701613a4d565b93506020850135915080821115613cb857600080fd5b50613c6285828601613b20565b600060208284031215613cd757600080fd5b81356123dc8161391b565b803560ff8116811461144157600080fd5b600082601f830112613d0457600080fd5b81356020613d14613a6e83613a2a565b82815260059290921b84018101918181019086841115613d3357600080fd5b8286015b84811015613ab657613d4881613ce2565b8352918301918301613d37565b60008060408385031215613d6857600080fd5b82356001600160401b0380821115613d7f57600080fd5b613d8b86838701613cf3565b93506020850135915080821115613da157600080fd5b50613c6285828601613cf3565b600060208284031215613dc057600080fd5b6123dc82613ce2565b600080600060608486031215613dde57600080fd5b83356001600160401b0380821115613df557600080fd5b613e0187838801613b20565b94506020860135915080821115613e1757600080fd5b50613e2486828701613b20565b925050604084013590509250925092565b600060208284031215613e4757600080fd5b81356001600160401b03811115613e5d57600080fd5b612fd184828501613c06565b60008060408385031215613e7c57600080fd5b8235613e878161391b565b91506020830135613b1581613ac1565b60008060008060808587031215613ead57600080fd5b84356001600160401b0380821115613ec457600080fd5b613ed088838901613b20565b95506020870135915080821115613ee657600080fd5b613ef288838901613cf3565b94506040870135915080821115613f0857600080fd5b50613f1587828801613c06565b9250506060850135613f268161391b565b939692955090935050565b60008060008060808587031215613f4757600080fd5b8435613f528161391b565b93506020850135613f628161391b565b92506040850135915060608501356001600160401b03811115613f8457600080fd5b8501601f81018713613f9557600080fd5b613fa487823560208401613baf565b91505092959194509250565b60008060408385031215613fc357600080fd5b8235613fce8161391b565b91506020830135613b158161391b565b600181811c90821680613ff257607f821691505b60208210810361401257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016140565761405661402e565b5060010190565b6001600160a01b0392831681529116602082015260400190565b60006020828403121561408957600080fd5b81516123dc81613ac1565b600081516140a6818560208601613883565b9290920192915050565b606084901b6001600160601b03191681526014810183905281516000906140de816034850160208701613883565b91909101603401949350505050565b6020808252601a908201527913d39157d3d497d353d49157d25117d053149150511657d4d15560321b604082015260600190565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b60408152600061416660408301856138af565b828103602084015261417881856138af565b95945050505050565b60008251614193818460208701613883565b9190910192915050565b600080845481600182811c9150808316806141b957607f831692505b602080841082036141d857634e487b7160e01b86526022600452602486fd5b8180156141ec57600181146141fd5761422a565b60ff1986168952848901965061422a565b60008b81526020902060005b868110156142225781548b820152908501908301614209565b505084890196505b50505050505061417861423d8286614094565b64173539b7b760d91b815260050190565b600082198211156142615761426161402e565b500190565b6001600160a01b03929092168252602082015260400190565b60006020828403121561429157600080fd5b5051919050565b6000828210156142aa576142aa61402e565b500390565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008261436457634e487b7160e01b600052601260045260246000fd5b500690565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252601c908201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b604082015260600190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614469908301846138af565b9695505050505050565b60006020828403121561448557600080fd5b81516123dc8161385056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef4d657461626f726720466976652053746172732062792047696f76616e6e69204d6f747461a264697066735822122050519c790100087f14c64d9f6b7c82f88c88d916926f3d3a5d13e3d5cd59485864736f6c634300080d0033
Deployed Bytecode
0x6080604052600436106101cb5760003560e01c806301ffc9a7146101d057806306fdde0314610205578063081812fc14610227578063095ea7b3146102545780630e916e461461027657806312d4ec571461028b57806323b872dd146102aa57806329adec14146102ca5780632f893de7146102f657806342842e0e1461031657806347812e34146103365780635148fdc8146103565780635a155b60146103765780636352211e1461039657806367478a35146103b657806369292694146103d65780636c0360eb146103f6578063709250c91461040b57806370a082311461042b578063715018a61461044b578063733b4782146104605780638631dc1d146104805780638da5cb5b146104a05780638ea6fcd0146104b557806395d89b41146104d55780639fc4c3b1146104ea578063a22cb4651461050a578063aa024e8b1461052a578063b36d31971461054a578063b88d4fde1461056a578063bf2773fb1461058a578063c87b56dd146105e2578063cd4b691414610602578063cfc5a96914610622578063d834a2d014610642578063d98f608814610662578063dc79b17614610678578063e985e9c514610698578063f2fde38b146106b8578063f5c12bd5146106d8575b600080fd5b3480156101dc57600080fd5b506101f06101eb366004613866565b6106f8565b60405190151581526020015b60405180910390f35b34801561021157600080fd5b5061021a61074a565b6040516101fc91906138db565b34801561023357600080fd5b506102476102423660046138ee565b6107dc565b6040516101fc9190613907565b34801561026057600080fd5b5061027461026f366004613930565b610803565b005b61027e61091d565b6040516101fc919061395c565b34801561029757600080fd5b5060cb545b6040519081526020016101fc565b3480156102b657600080fd5b506102746102c53660046139a3565b610dda565b3480156102d657600080fd5b5060d0546102e49060ff1681565b60405160ff90911681526020016101fc565b34801561030257600080fd5b506101f0610311366004613acf565b610eb4565b34801561032257600080fd5b506102746103313660046139a3565b610fe2565b34801561034257600080fd5b506101f0610351366004613b7b565b6110b1565b34801561036257600080fd5b506101f0610371366004613c26565b611172565b34801561038257600080fd5b506101f0610391366004613c6c565b61124f565b3480156103a257600080fd5b506102476103b13660046138ee565b61131c565b3480156103c257600080fd5b506101f06103d1366004613cc5565b611350565b3480156103e257600080fd5b506101f06103f1366004613c26565b611446565b34801561040257600080fd5b5061021a61149e565b34801561041757600080fd5b5060ce54610247906001600160a01b031681565b34801561043757600080fd5b5061029c610446366004613cc5565b61152c565b34801561045757600080fd5b506102746115b2565b34801561046c57600080fd5b5061027e61047b366004613d55565b6115c6565b34801561048c57600080fd5b506101f061049b366004613dae565b611706565b3480156104ac57600080fd5b506102476117d7565b3480156104c157600080fd5b506101f06104d0366004613dc9565b6117e6565b3480156104e157600080fd5b5061021a611b19565b3480156104f657600080fd5b506101f0610505366004613e35565b611b28565b34801561051657600080fd5b50610274610525366004613e69565b611c19565b34801561053657600080fd5b506101f0610545366004613dae565b611c28565b34801561055657600080fd5b50610274610565366004613e97565b611c94565b34801561057657600080fd5b50610274610585366004613f31565b612068565b34801561059657600080fd5b506105aa6105a5366004613cc5565b61213e565b6040805160ff9788168152958716602087015293909516928401929092526060830152608082015260a081019190915260c0016101fc565b3480156105ee57600080fd5b5061021a6105fd3660046138ee565b6122dd565b34801561060e57600080fd5b5061029c61061d3660046138ee565b612311565b34801561062e57600080fd5b5061029c61063d3660046138ee565b6123e3565b34801561064e57600080fd5b506101f061065d3660046138ee565b61242b565b34801561066e57600080fd5b5061029c60cd5481565b34801561068457600080fd5b506102e4610693366004613cc5565b61247b565b3480156106a457600080fd5b506101f06106b3366004613fb0565b612693565b3480156106c457600080fd5b506102746106d3366004613cc5565b6126c1565b3480156106e457600080fd5b5061029c6106f33660046138ee565b61273a565b60006001600160e01b031982166380ac58cd60e01b148061072957506001600160e01b03198216635b5e139f60e01b145b8061074457506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606065805461075990613fde565b80601f016020809104026020016040519081016040528092919081815260200182805461078590613fde565b80156107d25780601f106107a7576101008083540402835291602001916107d2565b820191906000526020600020905b8154815290600101906020018083116107b557829003601f168201915b5050505050905090565b60006107e78261276f565b506000908152606960205260409020546001600160a01b031690565b600061080e8261131c565b9050806001600160a01b0316836001600160a01b0316036108805760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148061089c575061089c8133612693565b61090e5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610877565b6109188383612794565b505050565b6060600061092a3361247b565b905061093581611706565b6109775760405162461bcd60e51b81526020600482015260136024820152722922a9aa2924a1aa22a22fa32aa721aa24a7a760691b6044820152606401610877565b6000806000806000806109893361213e565b95509550955095509550955060008660ff16116109de5760405162461bcd60e51b8152602060048201526013602482015272554e44455445435445445f4d4554414441544160681b6044820152606401610877565b60008060cb805480602002602001604051908101604052809291908181526020018280548015610a4b57602002820191906000526020600020906000905b825461010083900a900460ff16815260206001928301818104948501949093039092029101808411610a1c5790505b50505050509050600060cc805480602002602001604051908101604052809291908181526020018280548015610abe57602002820191906000526020600020906000905b825461010083900a900460ff16815260206001928301818104948501949093039092029101808411610a8f5790505b50505050509050348614610ad3576000610ad8565b889250825b50348514610ae7576000610aec565b879250825b50348414610afb576000610b00565b869250825b5060008360ff166001600160401b03811115610b1e57610b1e6139e4565b604051908082528060200260200182016040528015610b47578160200160208202803683370190505b50905060008460ff1611610b935760405162461bcd60e51b81526020600482015260136024820152724e4f545f56414c49445f4d53475f56414c554560681b6044820152606401610877565b8360ff1683511015610be45760405162461bcd60e51b815260206004820152601a6024820152794e4f545f454e4f5547485f50414745535f415641494c41424c4560301b6044820152606401610877565b60008080805b8760ff16811015610cde57610c4f8787610c0860ff8c166001612802565b84148015610c14575086155b8015610c3457508f60ff168b60ff161480610c3457508e60ff168b60ff16145b8f60ff168c60ff1614610c4857600061280e565b600161280e565b919950975090935060ff9081169250888116908e1614610c70576004610c73565b60035b821480610c9557508c60ff168860ff1614610c8f576005610c92565b60045b82145b610ca0576001610ca6565b60019350835b5082858281518110610cba57610cba614018565b60ff9092166020928302919091019091015280610cd681614044565b915050610bea565b5085516001600160401b03811115610cf857610cf86139e4565b604051908082528060200260200182016040528015610d21578160200160208202803683370190505b508051610d369160cb91602090910190613721565b5084516001600160401b03811115610d5057610d506139e4565b604051908082528060200260200182016040528015610d79578160200160208202803683370190505b508051610d8e9160cc91602090910190613721565b508551610da29060cb906020890190613721565b508451610db69060cc906020880190613721565b5060ca54610dc49034612a79565b60ca5550919d9c50505050505050505050505050565b826daaeb6d7670e522a718067333cd4e3b15610ea357336001600160a01b03821603610e1057610e0b848484612a85565b610eae565b604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c617113490610e43903090339060040161405d565b602060405180830381865afa158015610e60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e849190614077565b610ea35733604051633b79c77360e21b81526004016108779190613907565b610eae848484612a85565b50505050565b6000610ebe612ab6565b6000835111610f065760405162461bcd60e51b81526020600482015260146024820152734e4f545f454e4f5547485f41444452455353455360601b6044820152606401610877565b60005b8351811015610fd8578260d46000868481518110610f2957610f29614018565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550838181518110610f7a57610f7a614018565b60200260200101516001600160a01b03167f797df8152fef05e1c847b09d5f957ce3775cdf432504ba0194c970db40d90d2b84604051610fbe911515815260200190565b60405180910390a280610fd081614044565b915050610f09565b5060019392505050565b826daaeb6d7670e522a718067333cd4e3b156110a657336001600160a01b0382160361101357610e0b848484612b15565b604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c617113490611046903090339060040161405d565b602060405180830381865afa158015611063573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110879190614077565b6110a65733604051633b79c77360e21b81526004016108779190613907565b610eae848484612b15565b60008080805b84518110156111695760005b60cb5481101561114757828061112357508582815181106110e6576110e6614018565b602002602001015160cb828154811061110157611101614018565b60009182526020918290209181049091015460ff601f9092166101000a900416145b61112e576001611134565b60019250825b508061113f81614044565b9150506110c3565b5082806111515750815b9250600091508061116181614044565b9150506110b7565b50909392505050565b600082815260d360205260408120544310156111c85760405162461bcd60e51b81526020600482015260156024820152741513d2d15397d393d517d156141254915117d65155605a1b6044820152606401610877565b6111d183612b30565b60003084846040516020016111e8939291906140b0565b60408051808303601f190181528282528051602091820120600088815260d2835283902081905587845290830181905292507f3844671c71c87c1f77bab75d13b60f0e3be9cf4fad9fcdccbd5b600d048c3059910160405180910390a15060019392505050565b6000611259612ab6565b611262826110b1565b1561127f5760405162461bcd60e51b8152600401610877906140ed565b81518351146112c25760405162461bcd60e51b815260206004820152600f60248201526e0988a9c8e90a8be8892a69a82a8869608b1b6044820152606401610877565b60005b8351811015610fd85761130a8482815181106112e3576112e3614018565b60200260200101518483815181106112fd576112fd614018565b6020026020010151612bc1565b8061131481614044565b9150506112c5565b60008061132883612bdb565b90506001600160a01b0381166107445760405162461bcd60e51b815260040161087790614121565b600061135a612ab6565b60ca80546000918290556040519091906001600160a01b0385169083908381818185875af1925050503d80600081146113af576040519150601f19603f3d011682016040523d82523d6000602084013e6113b4565b606091505b50509050806113f75760405162461bcd60e51b815260206004820152600f60248201526e115512115494d7d393d517d4d15395608a1b6044820152606401610877565b836001600160a01b03167f883358c690ec4db7ac22c3d968b82161d86afa6eac861ecbea27d5f2676232ce8360405161143291815260200190565b60405180910390a26001925050505b919050565b60008030848460405160200161145e939291906140b0565b60408051601f198184030181529181528151602092830120600087815260d2909352912054146114915750600080611496565b506001805b509392505050565b60cf80546114ab90613fde565b80601f01602080910402602001604051908101604052809291908181526020018280546114d790613fde565b80156115245780601f106114f957610100808354040283529160200191611524565b820191906000526020600020905b81548152906001019060200180831161150757829003601f168201915b505050505081565b60006001600160a01b0382166115965760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610877565b506001600160a01b031660009081526068602052604090205490565b6115ba612ab6565b6115c46000612bf6565b565b606060008060006115e28551875161280290919063ffffffff16565b6001600160401b038111156115f9576115f96139e4565b604051908082528060200260200182016040528015611622578160200160208202803683370190505b50905060005b86518110156116fc5760005b8651811015611688578380611664575086818151811061165657611656614018565b602002602001015160ff1682145b61166f576001611675565b60019350835b508061168081614044565b915050611634565b5082156116965760006116e5565b8681815181106116a8576116a8614018565b60200260200101518285806116bc90614044565b9650815181106116ce576116ce614018565b602002602001019060ff16908160ff1681525060ff165b5060009250806116f481614044565b915050611628565b5095945050505050565b60d05460009060ff168181158015611722575060038460ff1611155b61172d576001611732565b506001805b5060ff82166001148015611749575060018460ff16145b611754576001611759565b506001805b5060ff82166002148015611770575060028460ff16145b61177b576001611780565b506001805b5060ff82166003148015611797575060018460ff16145b806117a5575060028460ff16145b6117b05760016117b5565b506001805b5060ff821660041480156117cc575060038460ff16145b611491576001611496565b6097546001600160a01b031690565b60006117f0612ab6565b600384511461183f5760405162461bcd60e51b815260206004820152601b60248201527a0a0a492868abe82a4a482b2be988a9c8ea890be8892a69a82a8869602b1b6044820152606401610877565b600383511461188e5760405162461bcd60e51b815260206004820152601b60248201527a0a0828696a6be82a4a482b2be988a9c8ea890be8892a69a82a8869602b1b6044820152606401610877565b600582106118d35760405162461bcd60e51b815260206004820152601260248201527111d493d55417d25117d393d517d59053125160721b6044820152606401610877565b826000815181106118e6576118e6614018565b602002602001015160d16000848152602001908152602001600020600101819055508260018151811061191b5761191b614018565b602002602001015160d16000848152602001908152602001600020600301819055508260028151811061195057611950614018565b602002602001015160d16000848152602001908152602001600020600501819055508360008151811061198557611985614018565b602002602001015160d1600084815260200190815260200160002060000181905550836001815181106119ba576119ba614018565b602002602001015160d1600084815260200190815260200160002060020181905550836002815181106119ef576119ef614018565b602002602001015160d16000848152602001908152602001600020600401819055507fe8f0b083ced320cb8c7c9c5e9a119447f22800a68b938692928818576969df8a8284600081518110611a4657611a46614018565b602002602001015185600181518110611a6157611a61614018565b602002602001015186600281518110611a7c57611a7c614018565b602002602001015188600081518110611a9757611a97614018565b602002602001015189600181518110611ab257611ab2614018565b60200260200101518a600281518110611acd57611acd614018565b60209081029190910181015160408051988952918801969096528601939093526060850191909152608084015260a083015260c082015260e00160405180910390a15060019392505050565b60606066805461075990613fde565b6000611b32612ab6565b600060cf8054611b4190613fde565b80601f0160208091040260200160405190810160405280929190818152602001828054611b6d90613fde565b8015611bba5780601f10611b8f57610100808354040283529160200191611bba565b820191906000526020600020905b815481529060010190602001808311611b9d57829003601f168201915b50508651939450611bd69360cf935060208801925090506137c7565b507f2d282b1217bad6dc4b2b12d8c46b39d4f6cbc709311fc62edd56e1dfc0b861888184604051611c08929190614153565b60405180910390a150600192915050565b611c24338383612c48565b5050565b6000611c32612ab6565b60d05460ff808416911603611c7b5760405162461bcd60e51b815260206004820152600f60248201526e0a6ae92a88690be8892a69a82a8869608b1b6044820152606401610877565b5060d0805460ff831660ff199091161790556001919050565b600054610100900460ff1615808015611cb45750600054600160ff909116105b80611cd55750611cc330612d12565b158015611cd5575060005460ff166001145b611d385760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610877565b6000805460ff191660011790558015611d5b576000805461ff0019166101001790555b611da86040518060600160405280602581526020016144b160259139604051806040016040528060138152602001724d657461626f7267204669766520537461727360681b815250612d21565b611db0612d52565b611db8612d81565b611dc1856110b1565b15611dde5760405162461bcd60e51b8152600401610877906140ed565b60ce80546001600160a01b0319166001600160a01b038416179055835161010011611e405760405162461bcd60e51b8152602060048201526012602482015271495046535f4c4953545f544f4f5f4c4f4e4760701b6044820152606401610877565b60005b8451811015611f98576000858281518110611e6057611e60614018565b602002602001015160ff1610158015611e9657506005858281518110611e8857611e88614018565b602002602001015160ff1611155b611ed95760405162461bcd60e51b815260206004820152601460248201527314d5105497d59053155157d393d517d59053125160621b6044820152606401610877565b60cc858281518110611eed57611eed614018565b6020908102919091018101518254600181018455600093845292829020918304909101805460ff928316601f9094166101000a9384029290930219909216179055855160cb90879083908110611f4557611f45614018565b6020908102919091018101518254600181018455600093845292829020918304909101805460ff928316601f9094166101000a938402929093021990921617905580611f9081614044565b915050611e43565b508251611fac9060cf9060208601906137c7565b507fe1d3a3bca75988c86bcfa8099cf351536e85ea01b8d94621b85c8592a0af02cb845184604051602001611fe19190614181565b60408051808303601f1901815282825280516020918201209383528201929092526001600160a01b0385168183015290519081900360600190a18015612061576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b836daaeb6d7670e522a718067333cd4e3b1561213257336001600160a01b0382160361209f5761209a85858585612dc7565b612061565b604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c6171134906120d2903090339060040161405d565b602060405180830381865afa1580156120ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121139190614077565b6121325733604051633b79c77360e21b81526004016108779190613907565b61206185858585612dc7565b600080600080600080600060d160006121568a61247b565b60ff1681526020808201929092526040908101600020815160c081018352815480825260018301549482019490945260028201549281019290925260038101546060830152600481015460808301526005015460a082015291506122ad57506000805260d160209081526040805160c0810182527efa5413e7b01fc543d01f0911de573ace463b956369df4472f39030e8d98b775481527efa5413e7b01fc543d01f0911de573ace463b956369df4472f39030e8d98b7854928101929092527efa5413e7b01fc543d01f0911de573ace463b956369df4472f39030e8d98b7954908201527efa5413e7b01fc543d01f0911de573ace463b956369df4472f39030e8d98b7a5460608201527efa5413e7b01fc543d01f0911de573ace463b956369df4472f39030e8d98b7b5460808201527efa5413e7b01fc543d01f0911de573ace463b956369df4472f39030e8d98b7c5460a08201525b6020810151606082015160a083015183516040850151608090950151939c929b5090995097509195509350915050565b606060cf6122ea83612df9565b6040516020016122fb92919061419d565b6040516020818303038152906040529050919050565b60008082116123585760405162461bcd60e51b815260206004820152601360248201527243414e545f4449564944455f42595f5a45524f60681b6044820152606401610877565b60006123d03342433060c9600081548092919061237490614044565b909155506040516001600160601b0319606096871b8116602083015260348201959095526054810193909352931b9091166074820152608881019190915260a801604051602081830303815290604052805190602001206123e3565b90506123dc8184612e8b565b9392505050565b60008060005b60208110156124245783816020811061240457612404614018565b61241091901a8361424e565b91508061241c81614044565b9150506123e9565b5092915050565b6000612435612ab6565b60cd82905560408051838152602081018490527f5e94f8c01695abbf08373b065e8bbf0a3942da7fe65a0475121a305dd07a7458910160405180910390a1506001919050565b60ce5460009081906001906002906003906001600160a01b0316806124d45760405162461bcd60e51b815260206004820152600f60248201526e115490cc4c4d4d57d393d517d4d155608a1b6044820152606401610877565b6001600160a01b038716600090815260d4602052604090205460ff166124fb57600061250c565b61250860015b8690612a79565b9450845b50604051627eeac760e11b81526000906001600160a01b0383169062fdd58e9061253c908b908990600401614266565b602060405180830381865afa158015612559573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061257d919061427f565b11806125f65750604051627eeac760e11b81526000906001600160a01b0383169062fdd58e906125b3908b908890600401614266565b602060405180830381865afa1580156125d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125f4919061427f565b115b8061266e5750604051627eeac760e11b81526000906001600160a01b0383169062fdd58e9061262b908b908790600401614266565b602060405180830381865afa158015612648573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061266c919061427f565b115b612679576000612687565b6126836002612501565b9450845b50939695505050505050565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b6126c9612ab6565b6001600160a01b03811661272e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610877565b61273781612bf6565b50565b600081815260d360205260408120548190438111156127655761275d8143612802565b915081611169565b5060009392505050565b61277881612e97565b6127375760405162461bcd60e51b815260040161087790614121565b600081815260696020526040902080546001600160a01b0319166001600160a01b03841690811790915581906127c98261131c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006123dc8284614298565b60408051600180825281830190925260009160609182918491829160208083019080368337505060408051600180825281830190925292935060009291506020808301908036833701905050905087156129015760008061286f8b8a612eb4565b91509150600081116128b0576128858c51612311565b8460008151811061289857612898614018565b602002602001019060ff16908160ff168152506128f9565b816128ba82612311565b815181106128ca576128ca614018565b6020026020010151846000815181106128e5576128e5614018565b602002602001019060ff16908160ff168152505b505050612933565b61290b8a51612311565b8260008151811061291e5761291e614018565b602002602001019060ff16908160ff16815250505b898260008151811061294757612947614018565b602002602001015160ff168151811061296257612962614018565b60200260200101518160008151811061297d5761297d614018565b602002602001019060ff16908160ff16815250506129b833826000815181106129a8576129a8614018565b602002602001015160ff16612bc1565b60cd546129c6904390612a79565b60d36000836000815181106129dd576129dd614018565b602002602001015160ff1681526020019081526020016000208190555060008983600081518110612a1057612a10614018565b602002602001015160ff1681518110612a2b57612a2b614018565b6020026020010151905081600081518110612a4857612a48614018565b6020026020010151612a5a8c856115c6565b612a648c866115c6565b919d909c50909a509098509650505050505050565b60006123dc828461424e565b612a8f3382612f7a565b612aab5760405162461bcd60e51b8152600401610877906142af565b610918838383612fd9565b33612abf6117d7565b6001600160a01b0316146115c45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610877565b61091883838360405180602001604052806000815250612068565b6000612b3b8261131c565b9050612b4b816000846001613138565b612b548261131c565b600083815260696020908152604080832080546001600160a01b03199081169091556001600160a01b038516808552606884528285208054600019019055878552606790935281842080549091169055519293508492600080516020614491833981519152908390a45050565b611c248282604051806020016040528060008152506131c0565b6000908152606760205260409020546001600160a01b031690565b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031603612ca55760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610877565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b03163b151590565b600054610100900460ff16612d485760405162461bcd60e51b8152600401610877906142fc565b611c2482826131f3565b600054610100900460ff16612d795760405162461bcd60e51b8152600401610877906142fc565b6115c4613241565b600054610100900460ff16612da85760405162461bcd60e51b8152600401610877906142fc565b6115c4733cc6cdda760b79bafa08df41ecfa224f810dceb66001613271565b612dd13383612f7a565b612ded5760405162461bcd60e51b8152600401610877906142af565b610eae84848484613407565b60606000612e068361343a565b60010190506000816001600160401b03811115612e2557612e256139e4565b6040519080825280601f01601f191660200182016040528015612e4f576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612e5957509392505050565b60006123dc8284614347565b600080612ea383612bdb565b6001600160a01b0316141592915050565b6060600080805b8551811015612f71578415612ed1576004612ed4565b60035b868281518110612ee657612ee6614018565b602002602001015160ff161480612f2757508415612f05576005612f08565b60045b868281518110612f1a57612f1a614018565b602002602001015160ff16145b15612f5f5780868381518110612f3f57612f3f614018565b60ff9092166020928302919091019091015281612f5b81614044565b9250505b80612f6981614044565b915050612ebb565b50939492505050565b600080612f868361131c565b9050806001600160a01b0316846001600160a01b03161480612fad5750612fad8185612693565b80612fd15750836001600160a01b0316612fc6846107dc565b6001600160a01b0316145b949350505050565b826001600160a01b0316612fec8261131c565b6001600160a01b0316146130125760405162461bcd60e51b815260040161087790614369565b6001600160a01b0382166130745760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610877565b6130818383836001613138565b826001600160a01b03166130948261131c565b6001600160a01b0316146130ba5760405162461bcd60e51b815260040161087790614369565b600081815260696020908152604080832080546001600160a01b03199081169091556001600160a01b03878116808652606885528386208054600019019055908716808652838620805460010190558686526067909452828520805490921684179091559051849360008051602061449183398151915291a4505050565b6001811115610eae576001600160a01b0384161561317e576001600160a01b03841660009081526068602052604081208054839290613178908490614298565b90915550505b6001600160a01b03831615610eae576001600160a01b038316600090815260686020526040812080548392906131b590849061424e565b909155505050505050565b6131ca8383613510565b6131d76000848484613619565b6109185760405162461bcd60e51b8152600401610877906143ae565b600054610100900460ff1661321a5760405162461bcd60e51b8152600401610877906142fc565b815161322d9060659060208501906137c7565b5080516109189060669060208401906137c7565b600054610100900460ff166132685760405162461bcd60e51b8152600401610877906142fc565b6115c433612bf6565b600054610100900460ff166132985760405162461bcd60e51b8152600401610877906142fc565b6daaeb6d7670e522a718067333cd4e3b15611c245760405163c3c5a54760e01b81526daaeb6d7670e522a718067333cd4e9063c3c5a547906132de903090600401613907565b6020604051808303816000875af11580156132fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133219190614077565b611c2457801561339457604051633e9f1edf60e11b81526daaeb6d7670e522a718067333cd4e90637d3e3dbe9061335e903090869060040161405d565b600060405180830381600087803b15801561337857600080fd5b505af115801561338c573d6000803e3d6000fd5b505050505050565b6001600160a01b038216156133d65760405163a0af290360e01b81526daaeb6d7670e522a718067333cd4e9063a0af29039061335e903090869060040161405d565b604051632210724360e11b81526daaeb6d7670e522a718067333cd4e90634420e4869061335e903090600401613907565b613412848484612fd9565b61341e84848484613619565b610eae5760405162461bcd60e51b8152600401610877906143ae565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106134795772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b83106134a3576904ee2d6d415b85acef8160201b830492506020015b662386f26fc1000083106134c157662386f26fc10000830492506010015b6305f5e10083106134d9576305f5e100830492506008015b61271083106134ed57612710830492506004015b606483106134ff576064830492506002015b600a83106107445760010192915050565b6001600160a01b0382166135665760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610877565b61356f81612e97565b1561358c5760405162461bcd60e51b815260040161087790614400565b61359a600083836001613138565b6135a381612e97565b156135c05760405162461bcd60e51b815260040161087790614400565b6001600160a01b038216600081815260686020908152604080832080546001019055848352606790915280822080546001600160a01b031916841790555183929190600080516020614491833981519152908290a45050565b600061362d846001600160a01b0316612d12565b1561371657604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613664903390899088908890600401614436565b6020604051808303816000875af192505050801561369f575060408051601f3d908101601f1916820190925261369c91810190614473565b60015b6136fc573d8080156136cd576040519150601f19603f3d011682016040523d82523d6000602084013e6136d2565b606091505b5080516000036136f45760405162461bcd60e51b8152600401610877906143ae565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612fd1565b506001949350505050565b82805482825590600052602060002090601f016020900481019282156137b75791602002820160005b8382111561378857835183826101000a81548160ff021916908360ff160217905550926020019260010160208160000104928301926001030261374a565b80156137b55782816101000a81549060ff0219169055600101602081600001049283019260010302613788565b505b506137c392915061383b565b5090565b8280546137d390613fde565b90600052602060002090601f0160209004810192826137f557600085556137b7565b82601f1061380e57805160ff19168380011785556137b7565b828001600101855582156137b7579182015b828111156137b7578251825591602001919060010190613820565b5b808211156137c3576000815560010161383c565b6001600160e01b03198116811461273757600080fd5b60006020828403121561387857600080fd5b81356123dc81613850565b60005b8381101561389e578181015183820152602001613886565b83811115610eae5750506000910152565b600081518084526138c7816020860160208601613883565b601f01601f19169290920160200192915050565b6020815260006123dc60208301846138af565b60006020828403121561390057600080fd5b5035919050565b6001600160a01b0391909116815260200190565b6001600160a01b038116811461273757600080fd5b6000806040838503121561394357600080fd5b823561394e8161391b565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b8181101561399757835160ff1683529284019291840191600101613978565b50909695505050505050565b6000806000606084860312156139b857600080fd5b83356139c38161391b565b925060208401356139d38161391b565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715613a2257613a226139e4565b604052919050565b60006001600160401b03821115613a4357613a436139e4565b5060051b60200190565b600082601f830112613a5e57600080fd5b81356020613a73613a6e83613a2a565b6139fa565b82815260059290921b84018101918181019086841115613a9257600080fd5b8286015b84811015613ab6578035613aa98161391b565b8352918301918301613a96565b509695505050505050565b801515811461273757600080fd5b60008060408385031215613ae257600080fd5b82356001600160401b03811115613af857600080fd5b613b0485828601613a4d565b9250506020830135613b1581613ac1565b809150509250929050565b600082601f830112613b3157600080fd5b81356020613b41613a6e83613a2a565b82815260059290921b84018101918181019086841115613b6057600080fd5b8286015b84811015613ab65780358352918301918301613b64565b600060208284031215613b8d57600080fd5b81356001600160401b03811115613ba357600080fd5b612fd184828501613b20565b60006001600160401b03831115613bc857613bc86139e4565b613bdb601f8401601f19166020016139fa565b9050828152838383011115613bef57600080fd5b828260208301376000602084830101529392505050565b600082601f830112613c1757600080fd5b6123dc83833560208501613baf565b60008060408385031215613c3957600080fd5b8235915060208301356001600160401b03811115613c5657600080fd5b613c6285828601613c06565b9150509250929050565b60008060408385031215613c7f57600080fd5b82356001600160401b0380821115613c9657600080fd5b613ca286838701613a4d565b93506020850135915080821115613cb857600080fd5b50613c6285828601613b20565b600060208284031215613cd757600080fd5b81356123dc8161391b565b803560ff8116811461144157600080fd5b600082601f830112613d0457600080fd5b81356020613d14613a6e83613a2a565b82815260059290921b84018101918181019086841115613d3357600080fd5b8286015b84811015613ab657613d4881613ce2565b8352918301918301613d37565b60008060408385031215613d6857600080fd5b82356001600160401b0380821115613d7f57600080fd5b613d8b86838701613cf3565b93506020850135915080821115613da157600080fd5b50613c6285828601613cf3565b600060208284031215613dc057600080fd5b6123dc82613ce2565b600080600060608486031215613dde57600080fd5b83356001600160401b0380821115613df557600080fd5b613e0187838801613b20565b94506020860135915080821115613e1757600080fd5b50613e2486828701613b20565b925050604084013590509250925092565b600060208284031215613e4757600080fd5b81356001600160401b03811115613e5d57600080fd5b612fd184828501613c06565b60008060408385031215613e7c57600080fd5b8235613e878161391b565b91506020830135613b1581613ac1565b60008060008060808587031215613ead57600080fd5b84356001600160401b0380821115613ec457600080fd5b613ed088838901613b20565b95506020870135915080821115613ee657600080fd5b613ef288838901613cf3565b94506040870135915080821115613f0857600080fd5b50613f1587828801613c06565b9250506060850135613f268161391b565b939692955090935050565b60008060008060808587031215613f4757600080fd5b8435613f528161391b565b93506020850135613f628161391b565b92506040850135915060608501356001600160401b03811115613f8457600080fd5b8501601f81018713613f9557600080fd5b613fa487823560208401613baf565b91505092959194509250565b60008060408385031215613fc357600080fd5b8235613fce8161391b565b91506020830135613b158161391b565b600181811c90821680613ff257607f821691505b60208210810361401257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016140565761405661402e565b5060010190565b6001600160a01b0392831681529116602082015260400190565b60006020828403121561408957600080fd5b81516123dc81613ac1565b600081516140a6818560208601613883565b9290920192915050565b606084901b6001600160601b03191681526014810183905281516000906140de816034850160208701613883565b91909101603401949350505050565b6020808252601a908201527913d39157d3d497d353d49157d25117d053149150511657d4d15560321b604082015260600190565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b60408152600061416660408301856138af565b828103602084015261417881856138af565b95945050505050565b60008251614193818460208701613883565b9190910192915050565b600080845481600182811c9150808316806141b957607f831692505b602080841082036141d857634e487b7160e01b86526022600452602486fd5b8180156141ec57600181146141fd5761422a565b60ff1986168952848901965061422a565b60008b81526020902060005b868110156142225781548b820152908501908301614209565b505084890196505b50505050505061417861423d8286614094565b64173539b7b760d91b815260050190565b600082198211156142615761426161402e565b500190565b6001600160a01b03929092168252602082015260400190565b60006020828403121561429157600080fd5b5051919050565b6000828210156142aa576142aa61402e565b500390565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60008261436457634e487b7160e01b600052601260045260246000fd5b500690565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252601c908201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b604082015260600190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614469908301846138af565b9695505050505050565b60006020828403121561448557600080fd5b81516123dc8161385056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef4d657461626f726720466976652053746172732062792047696f76616e6e69204d6f747461a264697066735822122050519c790100087f14c64d9f6b7c82f88c88d916926f3d3a5d13e3d5cd59485864736f6c634300080d0033
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.