Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60a06040 | 14788334 | 895 days ago | IN | 0 ETH | 0.07544126 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
MVHQ
Compiler Version
v0.8.13+commit.abaa5c0e
Optimization Enabled:
Yes with 2000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "erc721a/contracts/extensions/ERC721AQueryableUUPSUpgradeable.sol"; import "erc721a/contracts/extensions/ERC721ABurnableUUPSUpgradeable.sol"; import "erc721a/contracts/extensions/ERC721AGoverenedUUPSUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; /// @title MVHQ /// @author @KfishNFT /// @notice Metaverse HQ Key Collection /** @dev Any function which updates state will require a signature from an address with the correct role This is an upgradeable contract using UUPSUpgradeable (IERC1822Proxiable / ERC1967Proxy) from OpenZeppelin */ contract MVHQ is Initializable, AccessControlUpgradeable, ERC721AQueryableUUPSUpgradeable, ERC721ABurnableUUPSUpgradeable, ERC721AGoverenedUUPSUpgradeable, IERC1155Receiver { using StringsUpgradeable for uint256; /// @notice role assigned to an address that can perform upgrades to the contract /// @dev role can be granted by the DEFAULT_ADMIN_ROLE bytes32 public constant UPGRADER_ROLE = keccak256("UPGRADER_ROLE"); /// @notice role assigned to addresses that can perform managemenet actions /// @dev role can be granted by the DEFAULT_ADMIN_ROLE bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE"); /// @notice opensea Storefront ERC1155 contract ERC1155 public constant OSSF = ERC1155(0x495f947276749Ce646f68AC8c248420045cb7b5e); /// @notice opensea Storefront ERC1155 MVHQ Token ID uint256 public constant OSMVHQ_TOKENID = 70196056058896361747704672441801371315898722973429726505227809712513925252572; /// @notice flag whether claiming is available or not bool public claimActive; /// @notice base URI used to retrieve metadata /// @dev tokenURI will use .json at the end for each token starting from 1 and ending at 2000 string public baseURI; /// @notice setting an owner in order to comply with ownable interfaces /// @dev this variable was only added for compatibility with contracts that request an owner address public owner; /// @notice a way to keep track of flagged keys that are untransferable uint256[] private flaggedKeys; /// @notice a way to keep track of flagged addresses that are unable to transfer keys address[] private flaggedAddresses; /// @notice whale status requirement uint256 public whaleRequirement; /// @notice whether to refund gas of key claims bool public isRefundingGas; /// @notice the max amount that will be refunded in key claims uint256 public maxRefundAmount; /// @notice the gas units buffer for refunds uint256 public refundGasBuffer; event KeysClaimed(address indexed sender, uint256 amount); event KeyFlagged(address indexed sender, uint256 tokenId); event KeyUnflagged(address indexed sender, uint256 tokenId); event AddressFlagged(address indexed sender, address flaggedAddress); event AddressUnflagged(address indexed sender, address unflaggedAddress); event AdminTransfer(address indexed sender, address from, address to, uint256 tokenId); event LegacyKeysTransferred(address indexed sender, address to, uint256 quantity); event KeyBurned(address indexed sender, uint256 tokenId); event OwnershipTransferred(address indexed sender, address previousOwner, address newOwner); event BaseURIChanged(address indexed sender, string previousURI, string newURI); event WhaleRequirementChanged(address indexed sender, uint256 previousQuantity, uint256 newQuantity); event ClaimActiveChanged(address indexed sender, bool active); event Refunded(address indexed refunded, uint256 amount); event Received(address indexed sender, uint256 amount); /// @notice Initializer function which replaces constructor for upgradeable contracts /// @dev This should be called at deploy time /// @param baseURI_ the URI with the metadata function initialize(string memory baseURI_) public initializer { __ERC721A_init("MVHQ", "MVHQ"); __AccessControl_init(); _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); baseURI = baseURI_; whaleRequirement = 5; owner = msg.sender; isRefundingGas = true; maxRefundAmount = 0.01 ether; refundGasBuffer = 32196; } /// @notice Callable by users that have legacy MVHQ keys. Their keys will be transferred to this contract in the process /// @dev unfortunately Opensea does not allow burning storefront keys unless the sender has all of the supply function claimKeys() external isRefunding { require(isManagerOrAdmin(msg.sender) || claimActive, "MVHQ: claiming not active"); require(OSSF.isApprovedForAll(msg.sender, address(this)), "MVHQ: approval required"); uint256 claimable = OSSF.balanceOf(msg.sender, OSMVHQ_TOKENID); require(claimable > 0, "MVHQ: no claimable keys"); uint256[] memory ids = new uint256[](1); uint256[] memory amounts = new uint256[](1); ids[0] = OSMVHQ_TOKENID; amounts[0] = claimable; OSSF.safeTransferFrom(msg.sender, address(this), OSMVHQ_TOKENID, claimable, bytes("0x0")); _safeMint(msg.sender, claimable); emit KeysClaimed(msg.sender, claimable); } /// @notice function required to receive eth receive() external payable managed { emit Received(msg.sender, msg.value); } /* View Functions */ /// @notice check whether an address meets the whale requirement /// @param address_ the address to check /// @return whether the address is a whale function isWhale(address address_) external view returns (bool) { return balanceOf(address_) >= whaleRequirement; } /// @notice Check whether a key has been flagged /// @param tokenId_ the key's token id function isKeyFlagged(uint256 tokenId_) public view returns (bool) { for (uint256 i = 0; i < flaggedKeys.length; i++) { if (flaggedKeys[i] == tokenId_) return true; } return false; } /// @notice Retrieve list of flagged keys function getFlaggedKeys() external view returns (uint256[] memory) { return flaggedKeys; } /// @notice Check whether an address has been flagged /// @param address_ the address function isAddressFlagged(address address_) public view returns (bool) { for (uint256 i = 0; i < flaggedAddresses.length; i++) { if (flaggedAddresses[i] == address_) return true; } return false; } /// @notice Get list of flagged addresses function getFlaggedAddresses() external view returns (address[] memory) { return flaggedAddresses; } /// @notice Balance of legacy MVHQ Keys of an address /// @param address_ The address to check balance for function balanceOfLegacyKeys(address address_) external view returns (uint256) { return OSSF.balanceOf(address_, OSMVHQ_TOKENID); } /* Managed Functions */ /// @notice used to set the whale requirement /// @param quantity_ the amount required function setWhaleRequirement(uint256 quantity_) external managed { uint256 previousQuantity = whaleRequirement; whaleRequirement = quantity_; emit WhaleRequirementChanged(msg.sender, previousQuantity, quantity_); } /// @notice used to flag an address and remove the ability for it to transfer keys /// @dev callable by admin or manager /// @param address_ the address that will be flagged function flagAddress(address address_) external managed { flaggedAddresses.push(address_); emit AddressFlagged(msg.sender, address_); } /// @notice used to remove the flag of an address and restore the ability for it to transfer keys /// @dev callable by admin or manager /// @param address_ the address that will be unflagged function unflagAddress(address address_) external managed { for (uint256 i = 0; i < flaggedAddresses.length; i++) { if (flaggedAddresses[i] == address_) { flaggedAddresses[i] = flaggedAddresses[flaggedAddresses.length - 1]; flaggedAddresses.pop(); break; } } emit AddressUnflagged(msg.sender, address_); } /// @notice used to flag a key and make it untransferrable /// @dev callable by admin or manager /// @param tokenId_ the key that will be flagged function flagKey(uint256 tokenId_) external managed { flaggedKeys.push(tokenId_); emit KeyFlagged(msg.sender, tokenId_); } /// @notice used to remove the flag of a key and restore the ability for it to be transferred /// @dev callable by admin or manager /// @param tokenId_ the key that will be unflagged function unflagKey(uint256 tokenId_) external managed { for (uint256 i = 0; i < flaggedKeys.length; i++) { if (flaggedKeys[i] == tokenId_) { flaggedKeys[i] = flaggedKeys[flaggedKeys.length - 1]; flaggedKeys.pop(); break; } } emit KeyUnflagged(msg.sender, tokenId_); } /* Admin Functions */ /// @notice admin transfer of token from one address to another and meant to be used with extreme care /// @dev only callable from an address with the admin role /// @param from_ the address that holds the tokenId /// @param to_ the address which will receive the tokenId /// @param tokenId_ the key's tokenId function adminTransfer( address from_, address to_, uint256 tokenId_ ) external onlyRole(DEFAULT_ADMIN_ROLE) { _adminTransferFrom(from_, to_, tokenId_); emit AdminTransfer(msg.sender, from_, to_, tokenId_); } /// @notice admin function used to transfer legacy keys to an address /// @dev the address can't be the burn address unless the contract holds all legacy keys /// @param to_ the address that will receive all the legacy keys function transferLegacyKeys(address to_) external onlyRole(DEFAULT_ADMIN_ROLE) { uint256 balance = OSSF.balanceOf(address(this), OSMVHQ_TOKENID); require(balance > 0, "MVHQ: no legacy keys to transfer"); OSSF.safeTransferFrom(address(this), to_, OSMVHQ_TOKENID, balance, bytes("0x0")); emit LegacyKeysTransferred(msg.sender, to_, balance); } /// @notice this function will burn keys minted from this address /// @dev it will not work with legacy keys /// @param tokenId_ the key's tokenId function burn(uint256 tokenId_) public override onlyRole(DEFAULT_ADMIN_ROLE) { _burn(tokenId_, false); emit KeyBurned(msg.sender, tokenId_); } /// @notice toggle the claiming functionality /// @param _claimActive whether it will be active or not function setClaimActive(bool _claimActive) external onlyRole(DEFAULT_ADMIN_ROLE) { claimActive = _claimActive; emit ClaimActiveChanged(msg.sender, _claimActive); } /// @notice Used to set the baseURI for metadata /// @param baseURI_ the base URI function setBaseURI(string memory baseURI_) external onlyRole(DEFAULT_ADMIN_ROLE) { string memory previousURI = baseURI; baseURI = baseURI_; emit BaseURIChanged(msg.sender, previousURI, baseURI_); } /// @notice Used to toggle between refunding key claims /// @param isRefundingGas_ true to refund function setIsRefundingGas(bool isRefundingGas_) external onlyRole(DEFAULT_ADMIN_ROLE) { isRefundingGas = isRefundingGas_; } /// @notice The maximum eth to refund per key claim transaction /// @param maxRefundAmount_ the new max refund amount function setMaxRefundAmount(uint256 maxRefundAmount_) external onlyRole(DEFAULT_ADMIN_ROLE) { maxRefundAmount = maxRefundAmount_; } /// @notice The gas units buffer for refunds /// @dev this is to include the transfer gas itself /// @param refundGasBuffer_ the new max refund amount function setRefundGasBuffer(uint256 refundGasBuffer_) external onlyRole(DEFAULT_ADMIN_ROLE) { refundGasBuffer = refundGasBuffer_; } /// @notice Withdraw function in case anyone sends ETH to contract by mistake function withdraw() external payable onlyRole(DEFAULT_ADMIN_ROLE) { // solhint-disable-next-line avoid-low-level-calls (bool success, ) = payable(msg.sender).call{value: address(this).balance}(""); require(success, "MVHQ: failed to withdraw"); } /// @notice Used to set a new owner value /// @dev This is not the same as Ownable and was only added for compatibility /// @param newOwner_ the new owner function transferOwnership(address newOwner_) external onlyRole(DEFAULT_ADMIN_ROLE) { address previousOwner = owner; owner = newOwner_; emit OwnershipTransferred(msg.sender, previousOwner, newOwner_); } /* ERC721A Overrides */ /// @notice Override of ERC721A start token ID /// @return the initial tokenId function _startTokenId() internal view virtual override returns (uint256) { return 1; } /// @notice Override of ERC721A tokenURI(uint256) /// @dev returns baseURI + tokenId.json /// @param tokenId the tokenId without offsets /// @return the tokenURI with metadata function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); if (bytes(baseURI).length > 0) { return baseURI; } else { return ""; } } /// @notice Override of ERC721A and AccessControlUpgradeable supportsInterface function /// @param interfaceId the interfaceId /// @return bool if interfaceId is supported or not function supportsInterface(bytes4 interfaceId) public view virtual override(AccessControlUpgradeable, ERC721AUUPSUpgradeable, IERC165) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId || interfaceId == type(AccessControlUpgradeable).interfaceId || interfaceId == type(IERC165).interfaceId || super.supportsInterface(interfaceId); } /// @notice Hook to check whether a key is transferrable /// @dev admins can always transfer regardless of whether keys are flagged /// @param from address that holds the tokenId /// @param to address that will receive the tokenId /// @param startTokenId index of first tokenId that will be transferred /// @param quantity amount that will be transferred function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal override { if (!hasRole(DEFAULT_ADMIN_ROLE, msg.sender)) { require(!isAddressFlagged(from), "MVHQ: key holder address is flagged"); require(!isAddressFlagged(to), "MVHQ: key receiver address is flagged"); for (uint256 i = startTokenId; i < startTokenId + quantity; i++) { require(!isKeyFlagged(i), "MVHQ: key is flagged"); } } super._beforeTokenTransfers(from, to, startTokenId, quantity); } /// @notice UUPS Upgradeable authorization function /// @dev only the UPGRADER_ROLE can upgrade the contract /// @param newImplementation the address of the new implementation // solhint-disable-next-line no-empty-blocks function _authorizeUpgrade(address newImplementation) internal override onlyRole(UPGRADER_ROLE) {} function isManagerOrAdmin(address sender_) internal view returns (bool) { return hasRole(MANAGER_ROLE, sender_) || hasRole(DEFAULT_ADMIN_ROLE, sender_); } /// @dev required in order to receive ERC155 tokenIds function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external override returns (bytes4) { return this.onERC1155Received.selector; } /// @dev required in order to receive ERC155 tokenIds function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external override returns (bytes4) { return this.onERC1155BatchReceived.selector; } /* Modifiers */ /// @notice Used to refund a transaction gas cost modifier isRefunding() { uint256 initialGas = gasleft() + refundGasBuffer; _; if (isRefundingGas && address(this).balance >= maxRefundAmount) { uint256 gasCost = (initialGas - gasleft()) * tx.gasprice; payable(msg.sender).transfer(gasCost > maxRefundAmount ? maxRefundAmount : gasCost); emit Refunded(msg.sender, gasCost); } } /// @notice Modifier that ensures the function is being called by an address that is either a manager or a default admin modifier managed() { require(isManagerOrAdmin(msg.sender), "MVHQ: not authorized"); _; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; 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. * * 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 initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", StringsUpgradeable.toHexString(uint160(account), 20), " is missing role ", StringsUpgradeable.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } /** * @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 // Creator: Chiru Labs pragma solidity ^0.8.4; import '../ERC721AUUPSUpgradeable.sol'; error InvalidQueryRange(); /** * @title ERC721A Queryable * @dev ERC721A subclass with convenience query functions. */ abstract contract ERC721AQueryableUUPSUpgradeable is ERC721AUUPSUpgradeable { /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * - `addr` = `address(0)` * - `startTimestamp` = `0` * - `burned` = `false` * * If the `tokenId` is burned: * - `addr` = `<Address of owner before token was burned>` * - `startTimestamp` = `<Timestamp when token was burned>` * - `burned = `true` * * Otherwise: * - `addr` = `<Address of owner>` * - `startTimestamp` = `<Timestamp of start of ownership>` * - `burned = `false` */ function explicitOwnershipOf(uint256 tokenId) public view returns (TokenOwnership memory) { TokenOwnership memory ownership; if (tokenId < _startTokenId() || tokenId >= _currentIndex) { return ownership; } ownership = _ownerships[tokenId]; if (ownership.burned) { return ownership; } return _ownershipOf(tokenId); } /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory) { unchecked { uint256 tokenIdsLength = tokenIds.length; TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength); for (uint256 i; i != tokenIdsLength; ++i) { ownerships[i] = explicitOwnershipOf(tokenIds[i]); } return ownerships; } } /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start` < `stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view returns (uint256[] memory) { unchecked { if (start >= stop) revert InvalidQueryRange(); uint256 tokenIdsIdx; uint256 stopLimit = _currentIndex; // Set `start = max(start, _startTokenId())`. if (start < _startTokenId()) { start = _startTokenId(); } // Set `stop = min(stop, _currentIndex)`. if (stop > stopLimit) { stop = stopLimit; } uint256 tokenIdsMaxLength = balanceOf(owner); // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`, // to cater for cases where `balanceOf(owner)` is too big. if (start < stop) { uint256 rangeLength = stop - start; if (rangeLength < tokenIdsMaxLength) { tokenIdsMaxLength = rangeLength; } } else { tokenIdsMaxLength = 0; } uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength); if (tokenIdsMaxLength == 0) { return tokenIds; } // We need to call `explicitOwnershipOf(start)`, // because the slot at `start` may not be initialized. TokenOwnership memory ownership = explicitOwnershipOf(start); address currOwnershipAddr; // If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`. // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range. if (!ownership.burned) { currOwnershipAddr = ownership.addr; } for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) { ownership = _ownerships[i]; if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } // Downsize the array to fit. assembly { mstore(tokenIds, tokenIdsIdx) } return tokenIds; } } /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(totalSupply) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K pfp collections should be fine). */ function tokensOfOwner(address owner) external view returns (uint256[] memory) { unchecked { uint256 tokenIdsIdx; address currOwnershipAddr; uint256 tokenIdsLength = balanceOf(owner); uint256[] memory tokenIds = new uint256[](tokenIdsLength); TokenOwnership memory ownership; for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) { ownership = _ownerships[i]; if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } return tokenIds; } } }
// SPDX-License-Identifier: MIT // Creator: Chiru Labs pragma solidity ^0.8.4; import '../ERC721AUUPSUpgradeable.sol'; /** * @title ERC721A Burnable Token * @dev ERC721A Token that can be irreversibly burned (destroyed). */ abstract contract ERC721ABurnableUUPSUpgradeable is ERC721AUUPSUpgradeable { /** * @dev Burns `tokenId`. See {ERC721A-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) public virtual { _burn(tokenId, true); } }
// SPDX-License-Identifier: MIT // Creator: Chiru Labs pragma solidity ^0.8.4; import '../ERC721AUUPSUpgradeable.sol'; /** * @title ERC721A Goverend Token * @dev ERC721A Token that can transferred without approval. */ abstract contract ERC721AGoverenedUUPSUpgradeable is ERC721AUUPSUpgradeable { /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _adminTransferFrom( address from, address to, uint256 tokenId ) internal { _transfer(from, to, tokenId, false); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "./IERC1155.sol"; import "./IERC1155Receiver.sol"; import "./extensions/IERC1155MetadataURI.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: balance query for the zero address"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not owner nor approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: transfer caller is not owner nor approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn( address from, uint256 id, uint256 amount ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.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 functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// 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 // Creator: Chiru Labs pragma solidity ^0.8.4; import '@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol'; import '@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol'; import '@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol'; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; error ApprovalCallerNotOwnerNorApproved(); error ApprovalQueryForNonexistentToken(); error ApproveToCaller(); error ApprovalToCurrentOwner(); error BalanceQueryForZeroAddress(); error MintToZeroAddress(); error MintZeroQuantity(); error OwnerQueryForNonexistentToken(); error TransferCallerNotOwnerNorApproved(); error TransferFromIncorrectOwner(); error TransferToNonERC721ReceiverImplementer(); error TransferToZeroAddress(); error URIQueryForNonexistentToken(); /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..). * * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256). */ abstract contract ERC721AUUPSUpgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable, UUPSUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable for uint256; // Compiler will pack this into a single 256bit word. struct TokenOwnership { // The address of the owner. address addr; // Keeps track of the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; } // Compiler will pack this into a single 256bit word. struct AddressData { // Realistically, 2**64-1 is more than enough. uint64 balance; // Keeps track of mint count with minimal overhead for tokenomics. uint64 numberMinted; // Keeps track of burn count with minimal overhead for tokenomics. uint64 numberBurned; // For miscellaneous variable(s) pertaining to the address // (e.g. number of whitelist mint slots used). // If there are multiple variables, please pack them into a uint64. uint64 aux; } // The tokenId of the next token to be minted. uint256 internal _currentIndex; // The number of tokens burned. uint256 internal _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. See _ownershipOf implementation for details. mapping(uint256 => TokenOwnership) internal _ownerships; // Mapping owner address to address data mapping(address => AddressData) private _addressData; // 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; function __ERC721A_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC721A_init_unchained(name_, symbol_); __Context_init_unchained(); __ERC165_init_unchained(); } function __ERC721A_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } /** * To change the starting tokenId, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens. */ function totalSupply() public view returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than _currentIndex - _startTokenId() times unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view returns (uint256) { // Counter underflow is impossible as _currentIndex does not decrement, // and it is initialized to _startTokenId() unchecked { return _currentIndex - _startTokenId(); } } /** * @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 override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return uint256(_addressData[owner].balance); } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return uint256(_addressData[owner].numberMinted); } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return uint256(_addressData[owner].numberBurned); } /** * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return _addressData[owner].aux; } /** * Sets the auxillary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal { _addressData[owner].aux = aux; } /** * Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around in the collection over time. */ function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr && curr < _currentIndex) { TokenOwnership memory ownership = _ownerships[curr]; if (!ownership.burned) { if (ownership.addr != address(0)) { return ownership; } // Invariant: // There will always be an ownership that has an address and is not burned // before an ownership that does not have an address and is not burned. // Hence, curr will not underflow. while (true) { curr--; ownership = _ownerships[curr]; if (ownership.addr != address(0)) { return ownership; } } } } } revert OwnerQueryForNonexistentToken(); } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { return _ownershipOf(tokenId).addr; } /** * @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) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); 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 overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public override { address owner = ERC721AUUPSUpgradeable.ownerOf(tokenId); if (to == owner) revert ApprovalToCurrentOwner(); if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) { revert ApprovalCallerNotOwnerNorApproved(); } _approve(to, tokenId, owner); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { if (operator == _msgSender()) revert ApproveToCaller(); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_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 { _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 { _transfer(from, to, tokenId); if (to.isContract() && !_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @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`), */ function _exists(uint256 tokenId) internal view returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && !_ownerships[tokenId].burned; } function _safeMint(address to, uint256 quantity) internal { _safeMint(to, quantity, ''); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { _mint(to, quantity, _data, true); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _mint( address to, uint256 quantity, bytes memory _data, bool safe ) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1 // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1 unchecked { _addressData[to].balance += uint64(quantity); _addressData[to].numberMinted += uint64(quantity); _ownerships[startTokenId].addr = to; _ownerships[startTokenId].startTimestamp = uint64(block.timestamp); uint256 updatedIndex = startTokenId; uint256 end = updatedIndex + quantity; if (safe && to.isContract()) { do { emit Transfer(address(0), to, updatedIndex); if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (updatedIndex != end); // Reentrancy protection if (_currentIndex != startTokenId) revert(); } else { do { emit Transfer(address(0), to, updatedIndex++); } while (updatedIndex != end); } _currentIndex = updatedIndex; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Transfers `tokenId` from `from` to `to`. * * 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 ) private { _transfer(from, to, tokenId, true); } /** * @dev Transfers `tokenId` from `from` to `to`. * * 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, bool approvalCheck ) internal virtual { TokenOwnership memory prevOwnership = _ownershipOf(tokenId); if (prevOwnership.addr != from) revert TransferFromIncorrectOwner(); if(approvalCheck) { bool isApprovedOrOwner = (_msgSender() == from || isApprovedForAll(from, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); } _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, from); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256. unchecked { _addressData[from].balance -= 1; _addressData[to].balance += 1; TokenOwnership storage currSlot = _ownerships[tokenId]; currSlot.addr = to; currSlot.startTimestamp = uint64(block.timestamp); // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; TokenOwnership storage nextSlot = _ownerships[nextTokenId]; if (nextSlot.addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId != _currentIndex) { nextSlot.addr = from; nextSlot.startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev This is equivalent to _burn(tokenId, false) */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { TokenOwnership memory prevOwnership = _ownershipOf(tokenId); address from = prevOwnership.addr; if (approvalCheck) { bool isApprovedOrOwner = (_msgSender() == from || isApprovedForAll(from, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, from); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256. unchecked { AddressData storage addressData = _addressData[from]; addressData.balance -= 1; addressData.numberBurned += 1; // Keep track of who burned the token, and the timestamp of burning. TokenOwnership storage currSlot = _ownerships[tokenId]; currSlot.addr = from; currSlot.startTimestamp = uint64(block.timestamp); currSlot.burned = true; // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; TokenOwnership storage nextSlot = _ownerships[nextTokenId]; if (nextSlot.addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId != _currentIndex) { nextSlot.addr = from; nextSlot.startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve( address to, uint256 tokenId, address owner ) internal { _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target 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 _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } /** * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting. * And also called before burning one token. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes * minting. * And also called after one token has been burned. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @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 Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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 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); /** * @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; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// 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.5.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.0; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../ERC1967/ERC1967UpgradeUpgradeable.sol"; import "./Initializable.sol"; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. * * _Available since v4.1._ */ abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable { function __UUPSUpgradeable_init() internal onlyInitializing { } function __UUPSUpgradeable_init_unchained() internal onlyInitializing { } /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address private immutable __self = address(this); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { require(address(this) != __self, "Function must be called through delegatecall"); require(_getImplementation() == __self, "Function must be called through active proxy"); _; } /** * @dev Check that the execution is not being performed through a delegate call. This allows a function to be * callable on the implementing contract but not through proxies. */ modifier notDelegated() { require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall"); _; } /** * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the * implementation. It is used to validate that the this implementation remains valid after an upgrade. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier. */ function proxiableUUID() external view virtual override notDelegated returns (bytes32) { return _IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeTo(address newImplementation) external virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, new bytes(0), false); } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, data, true); } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeTo} and {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal override onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) 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[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.0; /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822ProxiableUpgradeable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeaconUpgradeable.sol"; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/StorageSlotUpgradeable.sol"; import "../utils/Initializable.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ * * @custom:oz-upgrades-unsafe-allow delegatecall */ abstract contract ERC1967UpgradeUpgradeable is Initializable { function __ERC1967Upgrade_init() internal onlyInitializing { } function __ERC1967Upgrade_init_unchained() internal onlyInitializing { } // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall( address newImplementation, bytes memory data, bool forceCall ) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { _functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallUUPS( address newImplementation, bytes memory data, bool forceCall ) internal { // Upgrades from old implementations will perform a rollback test. This test requires the new // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing // this special case will break upgrade paths from old UUPS implementation to new ones. if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else { try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) { require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID"); } catch { revert("ERC1967Upgrade: new implementation is not UUPS"); } _upgradeToAndCall(newImplementation, data, forceCall); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Emitted when the beacon is upgraded. */ event BeaconUpgraded(address indexed beacon); /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall( address newBeacon, bytes memory data, bool forceCall ) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data); } } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) { require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed"); } /** * @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 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeaconUpgradeable { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol) pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlotUpgradeable { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { assembly { r.slot := slot } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must be 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 v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly 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; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "optimizer": { "enabled": true, "runs": 2000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"flaggedAddress","type":"address"}],"name":"AddressFlagged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"unflaggedAddress","type":"address"}],"name":"AddressUnflagged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"AdminTransfer","type":"event"},{"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":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"string","name":"previousURI","type":"string"},{"indexed":false,"internalType":"string","name":"newURI","type":"string"}],"name":"BaseURIChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"bool","name":"active","type":"bool"}],"name":"ClaimActiveChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"KeyBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"KeyFlagged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"KeyUnflagged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"KeysClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"LegacyKeysTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Received","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"refunded","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Refunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"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":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousQuantity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newQuantity","type":"uint256"}],"name":"WhaleRequirementChanged","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OSMVHQ_TOKENID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OSSF","outputs":[{"internalType":"contract ERC1155","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from_","type":"address"},{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"adminTransfer","outputs":[],"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":[{"internalType":"address","name":"address_","type":"address"}],"name":"balanceOfLegacyKeys","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimKeys","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"}],"internalType":"struct ERC721AUUPSUpgradeable.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"}],"internalType":"struct ERC721AUUPSUpgradeable.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"address_","type":"address"}],"name":"flagAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"flagKey","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFlaggedAddresses","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFlaggedKeys","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"address_","type":"address"}],"name":"isAddressFlagged","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"isKeyFlagged","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRefundingGas","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"address_","type":"address"}],"name":"isWhale","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxRefundAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","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":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"refundGasBuffer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"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":"string","name":"baseURI_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_claimActive","type":"bool"}],"name":"setClaimActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"isRefundingGas_","type":"bool"}],"name":"setIsRefundingGas","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxRefundAmount_","type":"uint256"}],"name":"setMaxRefundAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"refundGasBuffer_","type":"uint256"}],"name":"setRefundGasBuffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity_","type":"uint256"}],"name":"setWhaleRequirement","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to_","type":"address"}],"name":"transferLegacyKeys","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner_","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"address_","type":"address"}],"name":"unflagAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"unflagKey","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"whaleRequirement","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60a06040523060805234801561001457600080fd5b5060805161516061004c600039600081816111c20152818161125801528181611836015281816118cc01526119c301526151606000f3fe6080604052600436106103bc5760003560e01c80637ab4d1de116101f2578063b88d4fde1161010d578063da72c1e8116100a0578063f23a6e611161006f578063f23a6e6114610c5e578063f2fde38b14610ca4578063f62d188814610cc4578063f72c0d8b14610ce457600080fd5b8063da72c1e814610ba0578063e127c45014610bc0578063e985e9c514610be0578063ec87621c14610c2a57600080fd5b8063cfba9fab116100dc578063cfba9fab14610b11578063d4a6a2fd14610b45578063d4d9b34314610b60578063d547741f14610b8057600080fd5b8063b88d4fde14610a43578063bc197c8114610a63578063c23dc68f14610ac4578063c87b56dd14610af157600080fd5b806395d89b4111610185578063a217fddf11610154578063a217fddf146109d7578063a22cb465146109ec578063ae34490414610a0c578063b2ea46c114610a2c57600080fd5b806395d89b41146109625780639937b0ce1461097757806399a2557a146109975780639a760fc6146109b757600080fd5b80638df9389c116101c15780638df9389c146108b95780638ef1e259146108e15780638faf6c311461090157806391d148541461091c57600080fd5b80637ab4d1de1461083f5780637ccd134a146108565780638462151c146108785780638da5cb5b1461089857600080fd5b80633ccfd60b116102e25780635a50fd50116102755780636a9d57fd116102445780636a9d57fd146107c85780636c0360eb146107ea57806370a08231146107ff57806373417b091461081f57600080fd5b80635a50fd50146107465780635bbb2177146107665780636352211e14610793578063658247a0146107b357600080fd5b806342966c68116102b157806342966c68146106de5780634f1ef286146106fe57806352d1902d1461071157806355f804b31461072657600080fd5b80633ccfd60b1461067657806342842e0e1461067e5780634294e5441461069e578063429644d9146106be57600080fd5b8063248a9ca31161035a57806336568abe1161032957806336568abe146105f65780633659cfe61461061657806337cb2e091461063657806338d023c21461065657600080fd5b8063248a9ca31461056f57806328bbc5c11461059f5780632efbeccd146105b65780632f2ff15d146105d657600080fd5b8063095ea7b311610396578063095ea7b3146104e6578063154974091461050857806318160ddd1461052857806323b872dd1461054f57600080fd5b806301ffc9a71461045757806306fdde031461048c578063081812fc146104ae57600080fd5b36610452576103ca33610d18565b61041b5760405162461bcd60e51b815260206004820152601460248201527f4d5648513a206e6f7420617574686f72697a656400000000000000000000000060448201526064015b60405180910390fd5b60405134815233907f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f885258749060200160405180910390a2005b600080fd5b34801561046357600080fd5b50610477610472366004614711565b610d9b565b60405190151581526020015b60405180910390f35b34801561049857600080fd5b506104a1610e75565b6040516104839190614786565b3480156104ba57600080fd5b506104ce6104c9366004614799565b610f07565b6040516001600160a01b039091168152602001610483565b3480156104f257600080fd5b506105066105013660046147c9565b610f65565b005b34801561051457600080fd5b50610506610523366004614799565b611024565b34801561053457600080fd5b5060fc5460fb5403600019015b604051908152602001610483565b34801561055b57600080fd5b5061050661056a3660046147f3565b6110e8565b34801561057b57600080fd5b5061054161058a366004614799565b60009081526065602052604090206001015490565b3480156105ab57600080fd5b5061054161010a5481565b3480156105c257600080fd5b506105066105d1366004614799565b6110f3565b3480156105e257600080fd5b506105066105f136600461482f565b611106565b34801561060257600080fd5b5061050661061136600461482f565b61112c565b34801561062257600080fd5b5061050661063136600461485b565b6111b8565b34801561064257600080fd5b5061050661065136600461485b565b611355565b34801561066257600080fd5b50610506610671366004614799565b611438565b6105066114d6565b34801561068a57600080fd5b506105066106993660046147f3565b61157a565b3480156106aa57600080fd5b506105066106b936600461485b565b611595565b3480156106ca57600080fd5b506105416106d936600461485b565b611740565b3480156106ea57600080fd5b506105066106f9366004614799565b6117e3565b61050661070c366004614935565b61182c565b34801561071d57600080fd5b506105416119b6565b34801561073257600080fd5b50610506610741366004614983565b611a7b565b34801561075257600080fd5b50610506610761366004614799565b611b76565b34801561077257600080fd5b506107866107813660046149cc565b611cbc565b6040516104839190614a72565b34801561079f57600080fd5b506104ce6107ae366004614799565b611d83565b3480156107bf57600080fd5b50610506611d95565b3480156107d457600080fd5b506107dd61223e565b6040516104839190614add565b3480156107f657600080fd5b506104a1612296565b34801561080b57600080fd5b5061054161081a36600461485b565b612325565b34801561082b57600080fd5b5061050661083a366004614b23565b61238e565b34801561084b57600080fd5b506105416101085481565b34801561086257600080fd5b5061086b6123de565b6040516104839190614b40565b34801561088457600080fd5b506107dd61089336600461485b565b612440565b3480156108a457600080fd5b50610105546104ce906001600160a01b031681565b3480156108c557600080fd5b506104ce73495f947276749ce646f68ac8c248420045cb7b5e81565b3480156108ed57600080fd5b506104776108fc36600461485b565b612582565b34801561090d57600080fd5b50610109546104779060ff1681565b34801561092857600080fd5b5061047761093736600461482f565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561096e57600080fd5b506104a1612599565b34801561098357600080fd5b50610477610992366004614799565b6125a8565b3480156109a357600080fd5b506107dd6109b2366004614b81565b612600565b3480156109c357600080fd5b506104776109d236600461485b565b6127de565b3480156109e357600080fd5b50610541600081565b3480156109f857600080fd5b50610506610a07366004614bb4565b612840565b348015610a1857600080fd5b50610506610a27366004614b23565b6128ef565b348015610a3857600080fd5b5061054161010b5481565b348015610a4f57600080fd5b50610506610a5e366004614beb565b612910565b348015610a6f57600080fd5b50610aab610a7e366004614ce1565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b6040516001600160e01b03199091168152602001610483565b348015610ad057600080fd5b50610ae4610adf366004614799565b612961565b6040516104839190614d9c565b348015610afd57600080fd5b506104a1610b0c366004614799565b612a1c565b348015610b1d57600080fd5b506105417f9b318f4ce0672a3f1ac661d9739a947f38b863a00000000000000100000005dc81565b348015610b5157600080fd5b50610103546104779060ff1681565b348015610b6c57600080fd5b50610506610b7b366004614799565b612b21565b348015610b8c57600080fd5b50610506610b9b36600461482f565b612b34565b348015610bac57600080fd5b50610506610bbb3660046147f3565b612b5a565b348015610bcc57600080fd5b50610506610bdb36600461485b565b612bc4565b348015610bec57600080fd5b50610477610bfb366004614dd2565b6001600160a01b0391821660009081526101026020908152604080832093909416825291909152205460ff1690565b348015610c3657600080fd5b506105417f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0881565b348015610c6a57600080fd5b50610aab610c79366004614dfc565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b348015610cb057600080fd5b50610506610cbf36600461485b565b612dd8565b348015610cd057600080fd5b50610506610cdf366004614983565b612e4e565b348015610cf057600080fd5b506105417f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e381565b6001600160a01b03811660009081527fcee91eb23e767f0f440dd9fce5554f355614443931e9ac5ce78c67b9e06e6f70602052604081205460ff1680610d9557506001600160a01b03821660009081527fffdfc1249c027f9191656349feb0761381bb32c9f557e01f419fd08754bf5a1b602052604090205460ff165b92915050565b60006001600160e01b031982167f80ac58cd000000000000000000000000000000000000000000000000000000001480610dfe57506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610e3257506001600160e01b031982167fda8def7300000000000000000000000000000000000000000000000000000000145b80610e6657506001600160e01b031982167f01ffc9a700000000000000000000000000000000000000000000000000000000145b80610d955750610d9582613033565b606060fd8054610e8490614e74565b80601f0160208091040260200160405190810160405280929190818152602001828054610eb090614e74565b8015610efd5780601f10610ed257610100808354040283529160200191610efd565b820191906000526020600020905b815481529060010190602001808311610ee057829003601f168201915b5050505050905090565b6000610f12826130a5565b610f48576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50600090815261010160205260409020546001600160a01b031690565b6000610f7082611d83565b9050806001600160a01b0316836001600160a01b031603610fbd576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614801590610fdd5750610fdb8133610bfb565b155b15611014576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61101f8383836130df565b505050565b61102d33610d18565b6110795760405162461bcd60e51b815260206004820152601460248201527f4d5648513a206e6f7420617574686f72697a65640000000000000000000000006044820152606401610412565b61010680546001810182556000919091527fc9ef9fceea91e87b2c84ea400a44fde78842aae8aa24cd4b502ce5fb4d91e63b0181905560405181815233907f540e004b1e599d2b6e04cb22f77b5c15ed1a83347064d867e964e25a073f5dd7906020015b60405180910390a250565b61101f838383613149565b60006110ff8133613156565b5061010a55565b6000828152606560205260409020600101546111228133613156565b61101f83836131d6565b6001600160a01b03811633146111aa5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610412565b6111b48282613278565b5050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036112565760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152608401610412565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166112b17f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b03161461132d5760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401610412565b611336816132fb565b6040805160008082526020820190925261135291839190613326565b50565b61135e33610d18565b6113aa5760405162461bcd60e51b815260206004820152601460248201527f4d5648513a206e6f7420617574686f72697a65640000000000000000000000006044820152606401610412565b61010780546001810182556000919091527f47c4908e245f386bfc1825973249847f4053a761ddb4880ad63c323a7b5a2a2501805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03831690811790915560405190815233907ff34c09a7cee2ec36676b00d8197a8db8ba2c6e091727126e27c8e3c34747f1a3906020016110dd565b61144133610d18565b61148d5760405162461bcd60e51b815260206004820152601460248201527f4d5648513a206e6f7420617574686f72697a65640000000000000000000000006044820152606401610412565b610108805490829055604080518281526020810184905233917fa091af460c0b001329ed8c9156f41f3efcc95ae5136f2c44f6746c4d778cf7fc91015b60405180910390a25050565b60006114e28133613156565b604051600090339047908381818185875af1925050503d8060008114611524576040519150601f19603f3d011682016040523d82523d6000602084013e611529565b606091505b50509050806111b45760405162461bcd60e51b815260206004820152601860248201527f4d5648513a206661696c656420746f20776974686472617700000000000000006044820152606401610412565b61101f83838360405180602001604052806000815250612910565b61159e33610d18565b6115ea5760405162461bcd60e51b815260206004820152601460248201527f4d5648513a206e6f7420617574686f72697a65640000000000000000000000006044820152606401610412565b60005b6101075481101561170457816001600160a01b0316610107828154811061161657611616614eae565b6000918252602090912001546001600160a01b0316036116f257610107805461164190600190614eda565b8154811061165157611651614eae565b60009182526020909120015461010780546001600160a01b03909216918390811061167e5761167e614eae565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506101078054806116be576116be614ef1565b6000828152602090208101600019908101805473ffffffffffffffffffffffffffffffffffffffff19169055019055611704565b806116fc81614f07565b9150506115ed565b506040516001600160a01b038216815233907fcc229432447e3f287b17d54ea5b3efb13d26e022102362f4d8eba4ac37fb8c76906020016110dd565b604051627eeac760e11b81526001600160a01b03821660048201527f9b318f4ce0672a3f1ac661d9739a947f38b863a00000000000000100000005dc602482015260009073495f947276749ce646f68ac8c248420045cb7b5e9062fdd58e90604401602060405180830381865afa1580156117bf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d959190614f21565b60006117ef8133613156565b6117fa8260006134c6565b60405182815233907feb1a139f5480882ec767b34b3d7386a850268910ed1dc7acb55c88a1e3a238ec906020016114ca565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036118ca5760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152608401610412565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166119257f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b0316146119a15760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401610412565b6119aa826132fb565b6111b482826001613326565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611a565760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610412565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b6000611a878133613156565b60006101048054611a9790614e74565b80601f0160208091040260200160405190810160405280929190818152602001828054611ac390614e74565b8015611b105780601f10611ae557610100808354040283529160200191611b10565b820191906000526020600020905b815481529060010190602001808311611af357829003601f168201915b50508651939450611b2d9361010493506020880192509050614662565b50336001600160a01b03167f92bf6a7b8937c17e6781a68d61f9fe6a5ce08604b96ca2206f311049a3a295ea8285604051611b69929190614f3a565b60405180910390a2505050565b611b7f33610d18565b611bcb5760405162461bcd60e51b815260206004820152601460248201527f4d5648513a206e6f7420617574686f72697a65640000000000000000000000006044820152606401610412565b60005b61010654811015611c8957816101068281548110611bee57611bee614eae565b906000526020600020015403611c77576101068054611c0f90600190614eda565b81548110611c1f57611c1f614eae565b90600052602060002001546101068281548110611c3e57611c3e614eae565b600091825260209091200155610106805480611c5c57611c5c614ef1565b60019003818190600052602060002001600090559055611c89565b80611c8181614f07565b915050611bce565b5060405181815233907f5bff50bb0ea7b604b792895e3a30ed31d4502d8c105e5c7c7982c8ac765beb81906020016110dd565b805160609060008167ffffffffffffffff811115611cdc57611cdc614876565b604051908082528060200260200182016040528015611d2757816020015b6040805160608101825260008082526020808301829052928201528252600019909201910181611cfa5790505b50905060005b828114611d7b57611d56858281518110611d4957611d49614eae565b6020026020010151612961565b828281518110611d6857611d68614eae565b6020908102919091010152600101611d2d565b509392505050565b6000611d8e826136e5565b5192915050565b600061010b545a611da69190614f5f565b9050611db133610d18565b80611dbf57506101035460ff165b611e0b5760405162461bcd60e51b815260206004820152601960248201527f4d5648513a20636c61696d696e67206e6f7420616374697665000000000000006044820152606401610412565b6040517fe985e9c500000000000000000000000000000000000000000000000000000000815233600482015230602482015273495f947276749ce646f68ac8c248420045cb7b5e9063e985e9c590604401602060405180830381865afa158015611e79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9d9190614f77565b611ee95760405162461bcd60e51b815260206004820152601760248201527f4d5648513a20617070726f76616c2072657175697265640000000000000000006044820152606401610412565b604051627eeac760e11b81523360048201527f9b318f4ce0672a3f1ac661d9739a947f38b863a00000000000000100000005dc602482015260009073495f947276749ce646f68ac8c248420045cb7b5e9062fdd58e90604401602060405180830381865afa158015611f5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f839190614f21565b905060008111611fd55760405162461bcd60e51b815260206004820152601760248201527f4d5648513a206e6f20636c61696d61626c65206b6579730000000000000000006044820152606401610412565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602080830190803683370190505090507f9b318f4ce0672a3f1ac661d9739a947f38b863a00000000000000100000005dc8260008151811061204e5761204e614eae565b602002602001018181525050828160008151811061206e5761206e614eae565b60200260200101818152505073495f947276749ce646f68ac8c248420045cb7b5e6001600160a01b031663f242432a33307f9b318f4ce0672a3f1ac661d9739a947f38b863a00000000000000100000005dc876040518060400160405280600381526020017f30783000000000000000000000000000000000000000000000000000000000008152506040518663ffffffff1660e01b8152600401612117959493929190614f94565b600060405180830381600087803b15801561213157600080fd5b505af1158015612145573d6000803e3d6000fd5b505050506121533384613828565b60405183815233907f6df341e167ad905feb841b44d47d5589106540c65e6fe465047aaf23cd30c5a89060200160405180910390a250506101095460ff16905080156121a2575061010a544710155b156113525760003a5a6121b59084614eda565b6121bf9190614fd7565b9050336001600160a01b03166108fc61010a5483116121de57826121e3565b61010a545b6040518115909202916000818181858888f1935050505015801561220b573d6000803e3d6000fd5b5060405181815233907fd7dee2702d63ad89917b6a4da9981c90c4d24f8c2bdfd64c604ecae57d8d0651906020016114ca565b6060610106805480602002602001604051908101604052809291908181526020018280548015610efd57602002820191906000526020600020905b815481526020019060010190808311612279575050505050905090565b61010480546122a490614e74565b80601f01602080910402602001604051908101604052809291908181526020018280546122d090614e74565b801561231d5780601f106122f25761010080835404028352916020019161231d565b820191906000526020600020905b81548152906001019060200180831161230057829003601f168201915b505050505081565b60006001600160a01b038216612367576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b03166000908152610100602052604090205467ffffffffffffffff1690565b600061239a8133613156565b610103805460ff191683151590811790915560405190815233907fcfac0d114d14393344fe66cb124151c2877a3634ed09c8ee2994553274cbc256906020016114ca565b6060610107805480602002602001604051908101604052809291908181526020018280548015610efd57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612419575050505050905090565b6060600080600061245085612325565b905060008167ffffffffffffffff81111561246d5761246d614876565b604051908082528060200260200182016040528015612496578160200160208202803683370190505b50604080516060810182526000808252602082018190529181019190915290915060015b83861461257657600081815260ff6020818152604092839020835160608101855290546001600160a01b038116825267ffffffffffffffff600160a01b82041692820192909252600160e01b9091049091161515918101829052925061256e5781516001600160a01b03161561252f57815194505b876001600160a01b0316856001600160a01b03160361256e578083878060010198508151811061256157612561614eae565b6020026020010181815250505b6001016124ba565b50909695505050505050565b60006101085461259183612325565b101592915050565b606060fe8054610e8490614e74565b6000805b610106548110156125f7578261010682815481106125cc576125cc614eae565b9060005260206000200154036125e55750600192915050565b806125ef81614f07565b9150506125ac565b50600092915050565b606081831061263b576040517f32c1995a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fb54600090600185101561264f57600194505b8084111561265b578093505b600061266687612325565b905084861015612685578585038181101561267f578091505b50612689565b5060005b60008167ffffffffffffffff8111156126a4576126a4614876565b6040519080825280602002602001820160405280156126cd578160200160208202803683370190505b509050816000036126e35793506127d792505050565b60006126ee88612961565b9050600081604001516126ff575080515b885b8881141580156127115750848714155b156127cb57600081815260ff6020818152604092839020835160608101855290546001600160a01b038116825267ffffffffffffffff600160a01b82041692820192909252600160e01b909104909116151591810182905293506127c35782516001600160a01b03161561278457825191505b8a6001600160a01b0316826001600160a01b0316036127c357808488806001019950815181106127b6576127b6614eae565b6020026020010181815250505b600101612701565b50505092835250909150505b9392505050565b6000805b610107548110156125f757826001600160a01b0316610107828154811061280b5761280b614eae565b6000918252602090912001546001600160a01b03160361282e5750600192915050565b8061283881614f07565b9150506127e2565b336001600160a01b03831603612882576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000818152610102602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b60006128fb8133613156565b50610109805460ff1916911515919091179055565b61291b848484613149565b6001600160a01b0383163b1515801561293d575061293b84848484613842565b155b1561295b576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b604080516060808201835260008083526020808401829052838501829052845192830185528183528201819052928101929092529060018310806129a7575060fb548310155b156129b25792915050565b50600082815260ff6020818152604092839020835160608101855290546001600160a01b038116825267ffffffffffffffff600160a01b82041692820192909252600160e01b9091049091161580159282019290925290612a135792915050565b6127d7836136e5565b6060612a27826130a5565b612a5d576040517fa14c4b5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006101048054612a6d90614e74565b90501115612b08576101048054612a8390614e74565b80601f0160208091040260200160405190810160405280929190818152602001828054612aaf90614e74565b8015612afc5780601f10612ad157610100808354040283529160200191612afc565b820191906000526020600020905b815481529060010190602001808311612adf57829003601f168201915b50505050509050919050565b505060408051602081019091526000815290565b919050565b6000612b2d8133613156565b5061010b55565b600082815260656020526040902060010154612b508133613156565b61101f8383613278565b6000612b668133613156565b612b71848484613960565b604080516001600160a01b0386811682528516602082015290810183905233907f360bb0808951709e17b8c0ff5cf74aa15579508d1227398aac32794efdfe75ea9060600160405180910390a250505050565b6000612bd08133613156565b604051627eeac760e11b81523060048201527f9b318f4ce0672a3f1ac661d9739a947f38b863a00000000000000100000005dc602482015260009073495f947276749ce646f68ac8c248420045cb7b5e9062fdd58e90604401602060405180830381865afa158015612c46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c6a9190614f21565b905060008111612cbc5760405162461bcd60e51b815260206004820181905260248201527f4d5648513a206e6f206c6567616379206b65797320746f207472616e736665726044820152606401610412565b604080518082018252600381527f3078300000000000000000000000000000000000000000000000000000000000602082015290517ff242432a00000000000000000000000000000000000000000000000000000000815273495f947276749ce646f68ac8c248420045cb7b5e9163f242432a91612d6591309188917f9b318f4ce0672a3f1ac661d9739a947f38b863a00000000000000100000005dc91889190600401614f94565b600060405180830381600087803b158015612d7f57600080fd5b505af1158015612d93573d6000803e3d6000fd5b5050604080516001600160a01b0387168152602081018590523393507ffeb6c27c598d8581a441fc8e59e9ef9fc43c0a609af2aed0554a05b5aaa6fca6925001611b69565b6000612de48133613156565b61010580546001600160a01b0384811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040805191909216808252602082019390935233917fc8894f26f396ce8c004245c8b7cd1b92103a6e4302fcbab883987149ac01b7ec9101611b69565b600054610100900460ff16612e695760005460ff1615612e6d565b303b155b612edf5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610412565b600054610100900460ff16158015612f1e57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b612f926040518060400160405280600481526020017f4d564851000000000000000000000000000000000000000000000000000000008152506040518060400160405280600481526020017f4d5648510000000000000000000000000000000000000000000000000000000081525061396d565b612f9a613a00565b612fa56000336131d6565b8151612fb990610104906020850190614662565b50600561010855610105805473ffffffffffffffffffffffffffffffffffffffff191633179055610109805460ff19166001179055662386f26fc1000061010a55617dc461010b5580156111b457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555050565b60006001600160e01b031982167f80ac58cd00000000000000000000000000000000000000000000000000000000148061309657506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610d955750610d9582613a7f565b6000816001111580156130b9575060fb5482105b8015610d95575050600090815260ff6020819052604090912054600160e01b9004161590565b60008281526101016020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b61101f8383836001613ae6565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff166111b457613194816001600160a01b03166014613d38565b61319f836020613d38565b6040516020016131b0929190614ff6565b60408051601f198184030181529082905262461bcd60e51b825261041291600401614786565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff166111b45760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556132343390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16156111b45760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b7f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e36111b48133613156565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156133595761101f83613f61565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156133b3575060408051601f3d908101601f191682019092526133b091810190614f21565b60015b6134255760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152608401610412565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81146134ba5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c655555494400000000000000000000000000000000000000000000006064820152608401610412565b5061101f83838361402c565b60006134d1836136e5565b80519091508215613550576000336001600160a01b03831614806134fa57506134fa8233610bfb565b8061351557503361350a86610f07565b6001600160a01b0316145b90508061354e576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b61355e816000866001614051565b61356a600085836130df565b6001600160a01b03808216600081815261010060209081526040808320805470010000000000000000000000000000000060001967ffffffffffffffff80841691909101811667ffffffffffffffff19841681178390048216600190810183169093027fffffffffffffffff0000000000000000ffffffffffffffff0000000000000000909416179290921783558b865260ff90945282852080547fffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffff42909316600160a01b026001600160e01b03199091169097179690961716600160e01b17855591890180845292208054919490911661369a5760fb54821461369a578054602087015167ffffffffffffffff16600160a01b026001600160e01b03199091166001600160a01b038716171781555b5050604051869250600091506001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a4505060fc805460010190555050565b60408051606081018252600080825260208201819052918101919091528180600111158015613715575060fb5481105b156137f657600081815260ff6020818152604092839020835160608101855290546001600160a01b038116825267ffffffffffffffff600160a01b82041692820192909252600160e01b9091049091161515918101829052906137f45780516001600160a01b031615613789579392505050565b5060001901600081815260ff6020818152604092839020835160608101855290546001600160a01b03811680835267ffffffffffffffff600160a01b83041693830193909352600160e01b900490921615159282019290925290156137ef579392505050565b613789565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111b4828260405180602001604052806000815250614201565b6040517f150b7a020000000000000000000000000000000000000000000000000000000081526000906001600160a01b0385169063150b7a0290613890903390899088908890600401615077565b6020604051808303816000875af19250505080156138cb575060408051601f3d908101601f191682019092526138c8918101906150b3565b60015b613929573d8080156138f9576040519150601f19603f3d011682016040523d82523d6000602084013e6138fe565b606091505b508051600003613921576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b0319167f150b7a02000000000000000000000000000000000000000000000000000000001490505b949350505050565b61101f8383836000613ae6565b600054610100900460ff166139ea5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610412565b6139f4828261420e565b6139fc613a00565b6111b45b600054610100900460ff16613a7d5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610412565b565b60006001600160e01b031982167f7965db0b000000000000000000000000000000000000000000000000000000001480610d9557507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610d95565b6000613af1836136e5565b9050846001600160a01b031681600001516001600160a01b031614613b42576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8115613bfc576000336001600160a01b0387161480613b665750613b668633610bfb565b80613b81575033613b7685610f07565b6001600160a01b0316145b905080613bba576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516613bfa576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b613c098585856001614051565b613c15600084876130df565b6001600160a01b03858116600090815261010060209081526040808320805467ffffffffffffffff1980821667ffffffffffffffff9283166000190183161790925589861680865283862080549384169383166001908101841694909417905589865260ff90945282852080546001600160e01b031916909417600160a01b42909216919091021783558701808452922080549193909116613cec5760fb548214613cec578054602085015167ffffffffffffffff16600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b60606000613d47836002614fd7565b613d52906002614f5f565b67ffffffffffffffff811115613d6a57613d6a614876565b6040519080825280601f01601f191660200182016040528015613d94576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110613dcb57613dcb614eae565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110613e2e57613e2e614eae565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000613e6a846002614fd7565b613e75906001614f5f565b90505b6001811115613f12577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110613eb657613eb6614eae565b1a60f81b828281518110613ecc57613ecc614eae565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93613f0b816150d0565b9050613e78565b5083156127d75760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610412565b6001600160a01b0381163b613fde5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152608401610412565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b614035836142bc565b6000825111806140425750805b1561101f5761295b83836142fc565b3360009081527fffdfc1249c027f9191656349feb0761381bb32c9f557e01f419fd08754bf5a1b602052604090205460ff166141fc57614090846127de565b156141035760405162461bcd60e51b815260206004820152602360248201527f4d5648513a206b657920686f6c646572206164647265737320697320666c616760448201527f67656400000000000000000000000000000000000000000000000000000000006064820152608401610412565b61410c836127de565b1561417f5760405162461bcd60e51b815260206004820152602560248201527f4d5648513a206b6579207265636569766572206164647265737320697320666c60448201527f61676765640000000000000000000000000000000000000000000000000000006064820152608401610412565b815b61418b8284614f5f565b8110156141fa5761419b816125a8565b156141e85760405162461bcd60e51b815260206004820152601460248201527f4d5648513a206b657920697320666c61676765640000000000000000000000006044820152606401610412565b806141f281614f07565b915050614181565b505b61295b565b61101f8383836001614407565b600054610100900460ff1661428b5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610412565b815161429e9060fd906020850190614662565b5080516142b29060fe906020840190614662565b50600160fb555050565b6142c581613f61565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b61437b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610412565b600080846001600160a01b03168460405161439691906150e7565b600060405180830381855af49150503d80600081146143d1576040519150601f19603f3d011682016040523d82523d6000602084013e6143d6565b606091505b50915091506143fe828260405180606001604052806027815260200161510460279139614629565b95945050505050565b60fb546001600160a01b03851661444a576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83600003614484576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6144916000868387614051565b6001600160a01b03851660008181526101006020908152604080832080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000811667ffffffffffffffff8083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c0181169092021790915585845260ff90925290912080546001600160e01b031916909217600160a01b42909216919091021790558080850183801561455357506001600160a01b0387163b15155b156145db575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46145a46000888480600101955088613842565b6145c1576040516368d2bf6b60e11b815260040160405180910390fd5b808203614559578260fb54146145d657600080fd5b614620565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a48082036145dc575b5060fb55613d31565b606083156146385750816127d7565b8251156146485782518084602001fd5b8160405162461bcd60e51b81526004016104129190614786565b82805461466e90614e74565b90600052602060002090601f01602090048101928261469057600085556146d6565b82601f106146a957805160ff19168380011785556146d6565b828001600101855582156146d6579182015b828111156146d65782518255916020019190600101906146bb565b506146e29291506146e6565b5090565b5b808211156146e257600081556001016146e7565b6001600160e01b03198116811461135257600080fd5b60006020828403121561472357600080fd5b81356127d7816146fb565b60005b83811015614749578181015183820152602001614731565b8381111561295b5750506000910152565b6000815180845261477281602086016020860161472e565b601f01601f19169290920160200192915050565b6020815260006127d7602083018461475a565b6000602082840312156147ab57600080fd5b5035919050565b80356001600160a01b0381168114612b1c57600080fd5b600080604083850312156147dc57600080fd5b6147e5836147b2565b946020939093013593505050565b60008060006060848603121561480857600080fd5b614811846147b2565b925061481f602085016147b2565b9150604084013590509250925092565b6000806040838503121561484257600080fd5b82359150614852602084016147b2565b90509250929050565b60006020828403121561486d57600080fd5b6127d7826147b2565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156148b5576148b5614876565b604052919050565b600067ffffffffffffffff8311156148d7576148d7614876565b6148ea6020601f19601f8601160161488c565b90508281528383830111156148fe57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261492657600080fd5b6127d7838335602085016148bd565b6000806040838503121561494857600080fd5b614951836147b2565b9150602083013567ffffffffffffffff81111561496d57600080fd5b61497985828601614915565b9150509250929050565b60006020828403121561499557600080fd5b813567ffffffffffffffff8111156149ac57600080fd5b8201601f810184136149bd57600080fd5b613958848235602084016148bd565b600060208083850312156149df57600080fd5b823567ffffffffffffffff808211156149f757600080fd5b818501915085601f830112614a0b57600080fd5b813581811115614a1d57614a1d614876565b8060051b9150614a2e84830161488c565b8181529183018401918481019088841115614a4857600080fd5b938501935b83851015614a6657843582529385019390850190614a4d565b98975050505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561257657614aca83855180516001600160a01b0316825260208082015167ffffffffffffffff16908301526040908101511515910152565b9284019260609290920191600101614a8e565b6020808252825182820181905260009190848201906040850190845b8181101561257657835183529284019291840191600101614af9565b801515811461135257600080fd5b600060208284031215614b3557600080fd5b81356127d781614b15565b6020808252825182820181905260009190848201906040850190845b818110156125765783516001600160a01b031683529284019291840191600101614b5c565b600080600060608486031215614b9657600080fd5b614b9f846147b2565b95602085013595506040909401359392505050565b60008060408385031215614bc757600080fd5b614bd0836147b2565b91506020830135614be081614b15565b809150509250929050565b60008060008060808587031215614c0157600080fd5b614c0a856147b2565b9350614c18602086016147b2565b925060408501359150606085013567ffffffffffffffff811115614c3b57600080fd5b614c4787828801614915565b91505092959194509250565b60008083601f840112614c6557600080fd5b50813567ffffffffffffffff811115614c7d57600080fd5b6020830191508360208260051b8501011115614c9857600080fd5b9250929050565b60008083601f840112614cb157600080fd5b50813567ffffffffffffffff811115614cc957600080fd5b602083019150836020828501011115614c9857600080fd5b60008060008060008060008060a0898b031215614cfd57600080fd5b614d06896147b2565b9750614d1460208a016147b2565b9650604089013567ffffffffffffffff80821115614d3157600080fd5b614d3d8c838d01614c53565b909850965060608b0135915080821115614d5657600080fd5b614d628c838d01614c53565b909650945060808b0135915080821115614d7b57600080fd5b50614d888b828c01614c9f565b999c989b5096995094979396929594505050565b81516001600160a01b0316815260208083015167ffffffffffffffff169082015260408083015115159082015260608101610d95565b60008060408385031215614de557600080fd5b614dee836147b2565b9150614852602084016147b2565b60008060008060008060a08789031215614e1557600080fd5b614e1e876147b2565b9550614e2c602088016147b2565b94506040870135935060608701359250608087013567ffffffffffffffff811115614e5657600080fd5b614e6289828a01614c9f565b979a9699509497509295939492505050565b600181811c90821680614e8857607f821691505b602082108103614ea857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082821015614eec57614eec614ec4565b500390565b634e487b7160e01b600052603160045260246000fd5b60006000198203614f1a57614f1a614ec4565b5060010190565b600060208284031215614f3357600080fd5b5051919050565b604081526000614f4d604083018561475a565b82810360208401526143fe818561475a565b60008219821115614f7257614f72614ec4565b500190565b600060208284031215614f8957600080fd5b81516127d781614b15565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152614fcc60a083018461475a565b979650505050505050565b6000816000190483118215151615614ff157614ff1614ec4565b500290565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161502e81601785016020880161472e565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161506b81602884016020880161472e565b01602801949350505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526150a9608083018461475a565b9695505050505050565b6000602082840312156150c557600080fd5b81516127d7816146fb565b6000816150df576150df614ec4565b506000190190565b600082516150f981846020870161472e565b919091019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220800eab3b34f09f884388f17d859bb07638320f62913eebeb868929938a81cea264736f6c634300080d0033
Deployed Bytecode
0x6080604052600436106103bc5760003560e01c80637ab4d1de116101f2578063b88d4fde1161010d578063da72c1e8116100a0578063f23a6e611161006f578063f23a6e6114610c5e578063f2fde38b14610ca4578063f62d188814610cc4578063f72c0d8b14610ce457600080fd5b8063da72c1e814610ba0578063e127c45014610bc0578063e985e9c514610be0578063ec87621c14610c2a57600080fd5b8063cfba9fab116100dc578063cfba9fab14610b11578063d4a6a2fd14610b45578063d4d9b34314610b60578063d547741f14610b8057600080fd5b8063b88d4fde14610a43578063bc197c8114610a63578063c23dc68f14610ac4578063c87b56dd14610af157600080fd5b806395d89b4111610185578063a217fddf11610154578063a217fddf146109d7578063a22cb465146109ec578063ae34490414610a0c578063b2ea46c114610a2c57600080fd5b806395d89b41146109625780639937b0ce1461097757806399a2557a146109975780639a760fc6146109b757600080fd5b80638df9389c116101c15780638df9389c146108b95780638ef1e259146108e15780638faf6c311461090157806391d148541461091c57600080fd5b80637ab4d1de1461083f5780637ccd134a146108565780638462151c146108785780638da5cb5b1461089857600080fd5b80633ccfd60b116102e25780635a50fd50116102755780636a9d57fd116102445780636a9d57fd146107c85780636c0360eb146107ea57806370a08231146107ff57806373417b091461081f57600080fd5b80635a50fd50146107465780635bbb2177146107665780636352211e14610793578063658247a0146107b357600080fd5b806342966c68116102b157806342966c68146106de5780634f1ef286146106fe57806352d1902d1461071157806355f804b31461072657600080fd5b80633ccfd60b1461067657806342842e0e1461067e5780634294e5441461069e578063429644d9146106be57600080fd5b8063248a9ca31161035a57806336568abe1161032957806336568abe146105f65780633659cfe61461061657806337cb2e091461063657806338d023c21461065657600080fd5b8063248a9ca31461056f57806328bbc5c11461059f5780632efbeccd146105b65780632f2ff15d146105d657600080fd5b8063095ea7b311610396578063095ea7b3146104e6578063154974091461050857806318160ddd1461052857806323b872dd1461054f57600080fd5b806301ffc9a71461045757806306fdde031461048c578063081812fc146104ae57600080fd5b36610452576103ca33610d18565b61041b5760405162461bcd60e51b815260206004820152601460248201527f4d5648513a206e6f7420617574686f72697a656400000000000000000000000060448201526064015b60405180910390fd5b60405134815233907f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f885258749060200160405180910390a2005b600080fd5b34801561046357600080fd5b50610477610472366004614711565b610d9b565b60405190151581526020015b60405180910390f35b34801561049857600080fd5b506104a1610e75565b6040516104839190614786565b3480156104ba57600080fd5b506104ce6104c9366004614799565b610f07565b6040516001600160a01b039091168152602001610483565b3480156104f257600080fd5b506105066105013660046147c9565b610f65565b005b34801561051457600080fd5b50610506610523366004614799565b611024565b34801561053457600080fd5b5060fc5460fb5403600019015b604051908152602001610483565b34801561055b57600080fd5b5061050661056a3660046147f3565b6110e8565b34801561057b57600080fd5b5061054161058a366004614799565b60009081526065602052604090206001015490565b3480156105ab57600080fd5b5061054161010a5481565b3480156105c257600080fd5b506105066105d1366004614799565b6110f3565b3480156105e257600080fd5b506105066105f136600461482f565b611106565b34801561060257600080fd5b5061050661061136600461482f565b61112c565b34801561062257600080fd5b5061050661063136600461485b565b6111b8565b34801561064257600080fd5b5061050661065136600461485b565b611355565b34801561066257600080fd5b50610506610671366004614799565b611438565b6105066114d6565b34801561068a57600080fd5b506105066106993660046147f3565b61157a565b3480156106aa57600080fd5b506105066106b936600461485b565b611595565b3480156106ca57600080fd5b506105416106d936600461485b565b611740565b3480156106ea57600080fd5b506105066106f9366004614799565b6117e3565b61050661070c366004614935565b61182c565b34801561071d57600080fd5b506105416119b6565b34801561073257600080fd5b50610506610741366004614983565b611a7b565b34801561075257600080fd5b50610506610761366004614799565b611b76565b34801561077257600080fd5b506107866107813660046149cc565b611cbc565b6040516104839190614a72565b34801561079f57600080fd5b506104ce6107ae366004614799565b611d83565b3480156107bf57600080fd5b50610506611d95565b3480156107d457600080fd5b506107dd61223e565b6040516104839190614add565b3480156107f657600080fd5b506104a1612296565b34801561080b57600080fd5b5061054161081a36600461485b565b612325565b34801561082b57600080fd5b5061050661083a366004614b23565b61238e565b34801561084b57600080fd5b506105416101085481565b34801561086257600080fd5b5061086b6123de565b6040516104839190614b40565b34801561088457600080fd5b506107dd61089336600461485b565b612440565b3480156108a457600080fd5b50610105546104ce906001600160a01b031681565b3480156108c557600080fd5b506104ce73495f947276749ce646f68ac8c248420045cb7b5e81565b3480156108ed57600080fd5b506104776108fc36600461485b565b612582565b34801561090d57600080fd5b50610109546104779060ff1681565b34801561092857600080fd5b5061047761093736600461482f565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561096e57600080fd5b506104a1612599565b34801561098357600080fd5b50610477610992366004614799565b6125a8565b3480156109a357600080fd5b506107dd6109b2366004614b81565b612600565b3480156109c357600080fd5b506104776109d236600461485b565b6127de565b3480156109e357600080fd5b50610541600081565b3480156109f857600080fd5b50610506610a07366004614bb4565b612840565b348015610a1857600080fd5b50610506610a27366004614b23565b6128ef565b348015610a3857600080fd5b5061054161010b5481565b348015610a4f57600080fd5b50610506610a5e366004614beb565b612910565b348015610a6f57600080fd5b50610aab610a7e366004614ce1565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b6040516001600160e01b03199091168152602001610483565b348015610ad057600080fd5b50610ae4610adf366004614799565b612961565b6040516104839190614d9c565b348015610afd57600080fd5b506104a1610b0c366004614799565b612a1c565b348015610b1d57600080fd5b506105417f9b318f4ce0672a3f1ac661d9739a947f38b863a00000000000000100000005dc81565b348015610b5157600080fd5b50610103546104779060ff1681565b348015610b6c57600080fd5b50610506610b7b366004614799565b612b21565b348015610b8c57600080fd5b50610506610b9b36600461482f565b612b34565b348015610bac57600080fd5b50610506610bbb3660046147f3565b612b5a565b348015610bcc57600080fd5b50610506610bdb36600461485b565b612bc4565b348015610bec57600080fd5b50610477610bfb366004614dd2565b6001600160a01b0391821660009081526101026020908152604080832093909416825291909152205460ff1690565b348015610c3657600080fd5b506105417f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0881565b348015610c6a57600080fd5b50610aab610c79366004614dfc565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b348015610cb057600080fd5b50610506610cbf36600461485b565b612dd8565b348015610cd057600080fd5b50610506610cdf366004614983565b612e4e565b348015610cf057600080fd5b506105417f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e381565b6001600160a01b03811660009081527fcee91eb23e767f0f440dd9fce5554f355614443931e9ac5ce78c67b9e06e6f70602052604081205460ff1680610d9557506001600160a01b03821660009081527fffdfc1249c027f9191656349feb0761381bb32c9f557e01f419fd08754bf5a1b602052604090205460ff165b92915050565b60006001600160e01b031982167f80ac58cd000000000000000000000000000000000000000000000000000000001480610dfe57506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610e3257506001600160e01b031982167fda8def7300000000000000000000000000000000000000000000000000000000145b80610e6657506001600160e01b031982167f01ffc9a700000000000000000000000000000000000000000000000000000000145b80610d955750610d9582613033565b606060fd8054610e8490614e74565b80601f0160208091040260200160405190810160405280929190818152602001828054610eb090614e74565b8015610efd5780601f10610ed257610100808354040283529160200191610efd565b820191906000526020600020905b815481529060010190602001808311610ee057829003601f168201915b5050505050905090565b6000610f12826130a5565b610f48576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50600090815261010160205260409020546001600160a01b031690565b6000610f7082611d83565b9050806001600160a01b0316836001600160a01b031603610fbd576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614801590610fdd5750610fdb8133610bfb565b155b15611014576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61101f8383836130df565b505050565b61102d33610d18565b6110795760405162461bcd60e51b815260206004820152601460248201527f4d5648513a206e6f7420617574686f72697a65640000000000000000000000006044820152606401610412565b61010680546001810182556000919091527fc9ef9fceea91e87b2c84ea400a44fde78842aae8aa24cd4b502ce5fb4d91e63b0181905560405181815233907f540e004b1e599d2b6e04cb22f77b5c15ed1a83347064d867e964e25a073f5dd7906020015b60405180910390a250565b61101f838383613149565b60006110ff8133613156565b5061010a55565b6000828152606560205260409020600101546111228133613156565b61101f83836131d6565b6001600160a01b03811633146111aa5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610412565b6111b48282613278565b5050565b6001600160a01b037f00000000000000000000000090f125232712a156b7166ff2aba1ce1e67ece03f1630036112565760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152608401610412565b7f00000000000000000000000090f125232712a156b7166ff2aba1ce1e67ece03f6001600160a01b03166112b17f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b03161461132d5760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401610412565b611336816132fb565b6040805160008082526020820190925261135291839190613326565b50565b61135e33610d18565b6113aa5760405162461bcd60e51b815260206004820152601460248201527f4d5648513a206e6f7420617574686f72697a65640000000000000000000000006044820152606401610412565b61010780546001810182556000919091527f47c4908e245f386bfc1825973249847f4053a761ddb4880ad63c323a7b5a2a2501805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03831690811790915560405190815233907ff34c09a7cee2ec36676b00d8197a8db8ba2c6e091727126e27c8e3c34747f1a3906020016110dd565b61144133610d18565b61148d5760405162461bcd60e51b815260206004820152601460248201527f4d5648513a206e6f7420617574686f72697a65640000000000000000000000006044820152606401610412565b610108805490829055604080518281526020810184905233917fa091af460c0b001329ed8c9156f41f3efcc95ae5136f2c44f6746c4d778cf7fc91015b60405180910390a25050565b60006114e28133613156565b604051600090339047908381818185875af1925050503d8060008114611524576040519150601f19603f3d011682016040523d82523d6000602084013e611529565b606091505b50509050806111b45760405162461bcd60e51b815260206004820152601860248201527f4d5648513a206661696c656420746f20776974686472617700000000000000006044820152606401610412565b61101f83838360405180602001604052806000815250612910565b61159e33610d18565b6115ea5760405162461bcd60e51b815260206004820152601460248201527f4d5648513a206e6f7420617574686f72697a65640000000000000000000000006044820152606401610412565b60005b6101075481101561170457816001600160a01b0316610107828154811061161657611616614eae565b6000918252602090912001546001600160a01b0316036116f257610107805461164190600190614eda565b8154811061165157611651614eae565b60009182526020909120015461010780546001600160a01b03909216918390811061167e5761167e614eae565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506101078054806116be576116be614ef1565b6000828152602090208101600019908101805473ffffffffffffffffffffffffffffffffffffffff19169055019055611704565b806116fc81614f07565b9150506115ed565b506040516001600160a01b038216815233907fcc229432447e3f287b17d54ea5b3efb13d26e022102362f4d8eba4ac37fb8c76906020016110dd565b604051627eeac760e11b81526001600160a01b03821660048201527f9b318f4ce0672a3f1ac661d9739a947f38b863a00000000000000100000005dc602482015260009073495f947276749ce646f68ac8c248420045cb7b5e9062fdd58e90604401602060405180830381865afa1580156117bf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d959190614f21565b60006117ef8133613156565b6117fa8260006134c6565b60405182815233907feb1a139f5480882ec767b34b3d7386a850268910ed1dc7acb55c88a1e3a238ec906020016114ca565b6001600160a01b037f00000000000000000000000090f125232712a156b7166ff2aba1ce1e67ece03f1630036118ca5760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152608401610412565b7f00000000000000000000000090f125232712a156b7166ff2aba1ce1e67ece03f6001600160a01b03166119257f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b0316146119a15760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401610412565b6119aa826132fb565b6111b482826001613326565b6000306001600160a01b037f00000000000000000000000090f125232712a156b7166ff2aba1ce1e67ece03f1614611a565760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610412565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b6000611a878133613156565b60006101048054611a9790614e74565b80601f0160208091040260200160405190810160405280929190818152602001828054611ac390614e74565b8015611b105780601f10611ae557610100808354040283529160200191611b10565b820191906000526020600020905b815481529060010190602001808311611af357829003601f168201915b50508651939450611b2d9361010493506020880192509050614662565b50336001600160a01b03167f92bf6a7b8937c17e6781a68d61f9fe6a5ce08604b96ca2206f311049a3a295ea8285604051611b69929190614f3a565b60405180910390a2505050565b611b7f33610d18565b611bcb5760405162461bcd60e51b815260206004820152601460248201527f4d5648513a206e6f7420617574686f72697a65640000000000000000000000006044820152606401610412565b60005b61010654811015611c8957816101068281548110611bee57611bee614eae565b906000526020600020015403611c77576101068054611c0f90600190614eda565b81548110611c1f57611c1f614eae565b90600052602060002001546101068281548110611c3e57611c3e614eae565b600091825260209091200155610106805480611c5c57611c5c614ef1565b60019003818190600052602060002001600090559055611c89565b80611c8181614f07565b915050611bce565b5060405181815233907f5bff50bb0ea7b604b792895e3a30ed31d4502d8c105e5c7c7982c8ac765beb81906020016110dd565b805160609060008167ffffffffffffffff811115611cdc57611cdc614876565b604051908082528060200260200182016040528015611d2757816020015b6040805160608101825260008082526020808301829052928201528252600019909201910181611cfa5790505b50905060005b828114611d7b57611d56858281518110611d4957611d49614eae565b6020026020010151612961565b828281518110611d6857611d68614eae565b6020908102919091010152600101611d2d565b509392505050565b6000611d8e826136e5565b5192915050565b600061010b545a611da69190614f5f565b9050611db133610d18565b80611dbf57506101035460ff165b611e0b5760405162461bcd60e51b815260206004820152601960248201527f4d5648513a20636c61696d696e67206e6f7420616374697665000000000000006044820152606401610412565b6040517fe985e9c500000000000000000000000000000000000000000000000000000000815233600482015230602482015273495f947276749ce646f68ac8c248420045cb7b5e9063e985e9c590604401602060405180830381865afa158015611e79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9d9190614f77565b611ee95760405162461bcd60e51b815260206004820152601760248201527f4d5648513a20617070726f76616c2072657175697265640000000000000000006044820152606401610412565b604051627eeac760e11b81523360048201527f9b318f4ce0672a3f1ac661d9739a947f38b863a00000000000000100000005dc602482015260009073495f947276749ce646f68ac8c248420045cb7b5e9062fdd58e90604401602060405180830381865afa158015611f5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f839190614f21565b905060008111611fd55760405162461bcd60e51b815260206004820152601760248201527f4d5648513a206e6f20636c61696d61626c65206b6579730000000000000000006044820152606401610412565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602080830190803683370190505090507f9b318f4ce0672a3f1ac661d9739a947f38b863a00000000000000100000005dc8260008151811061204e5761204e614eae565b602002602001018181525050828160008151811061206e5761206e614eae565b60200260200101818152505073495f947276749ce646f68ac8c248420045cb7b5e6001600160a01b031663f242432a33307f9b318f4ce0672a3f1ac661d9739a947f38b863a00000000000000100000005dc876040518060400160405280600381526020017f30783000000000000000000000000000000000000000000000000000000000008152506040518663ffffffff1660e01b8152600401612117959493929190614f94565b600060405180830381600087803b15801561213157600080fd5b505af1158015612145573d6000803e3d6000fd5b505050506121533384613828565b60405183815233907f6df341e167ad905feb841b44d47d5589106540c65e6fe465047aaf23cd30c5a89060200160405180910390a250506101095460ff16905080156121a2575061010a544710155b156113525760003a5a6121b59084614eda565b6121bf9190614fd7565b9050336001600160a01b03166108fc61010a5483116121de57826121e3565b61010a545b6040518115909202916000818181858888f1935050505015801561220b573d6000803e3d6000fd5b5060405181815233907fd7dee2702d63ad89917b6a4da9981c90c4d24f8c2bdfd64c604ecae57d8d0651906020016114ca565b6060610106805480602002602001604051908101604052809291908181526020018280548015610efd57602002820191906000526020600020905b815481526020019060010190808311612279575050505050905090565b61010480546122a490614e74565b80601f01602080910402602001604051908101604052809291908181526020018280546122d090614e74565b801561231d5780601f106122f25761010080835404028352916020019161231d565b820191906000526020600020905b81548152906001019060200180831161230057829003601f168201915b505050505081565b60006001600160a01b038216612367576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b03166000908152610100602052604090205467ffffffffffffffff1690565b600061239a8133613156565b610103805460ff191683151590811790915560405190815233907fcfac0d114d14393344fe66cb124151c2877a3634ed09c8ee2994553274cbc256906020016114ca565b6060610107805480602002602001604051908101604052809291908181526020018280548015610efd57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612419575050505050905090565b6060600080600061245085612325565b905060008167ffffffffffffffff81111561246d5761246d614876565b604051908082528060200260200182016040528015612496578160200160208202803683370190505b50604080516060810182526000808252602082018190529181019190915290915060015b83861461257657600081815260ff6020818152604092839020835160608101855290546001600160a01b038116825267ffffffffffffffff600160a01b82041692820192909252600160e01b9091049091161515918101829052925061256e5781516001600160a01b03161561252f57815194505b876001600160a01b0316856001600160a01b03160361256e578083878060010198508151811061256157612561614eae565b6020026020010181815250505b6001016124ba565b50909695505050505050565b60006101085461259183612325565b101592915050565b606060fe8054610e8490614e74565b6000805b610106548110156125f7578261010682815481106125cc576125cc614eae565b9060005260206000200154036125e55750600192915050565b806125ef81614f07565b9150506125ac565b50600092915050565b606081831061263b576040517f32c1995a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fb54600090600185101561264f57600194505b8084111561265b578093505b600061266687612325565b905084861015612685578585038181101561267f578091505b50612689565b5060005b60008167ffffffffffffffff8111156126a4576126a4614876565b6040519080825280602002602001820160405280156126cd578160200160208202803683370190505b509050816000036126e35793506127d792505050565b60006126ee88612961565b9050600081604001516126ff575080515b885b8881141580156127115750848714155b156127cb57600081815260ff6020818152604092839020835160608101855290546001600160a01b038116825267ffffffffffffffff600160a01b82041692820192909252600160e01b909104909116151591810182905293506127c35782516001600160a01b03161561278457825191505b8a6001600160a01b0316826001600160a01b0316036127c357808488806001019950815181106127b6576127b6614eae565b6020026020010181815250505b600101612701565b50505092835250909150505b9392505050565b6000805b610107548110156125f757826001600160a01b0316610107828154811061280b5761280b614eae565b6000918252602090912001546001600160a01b03160361282e5750600192915050565b8061283881614f07565b9150506127e2565b336001600160a01b03831603612882576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000818152610102602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b60006128fb8133613156565b50610109805460ff1916911515919091179055565b61291b848484613149565b6001600160a01b0383163b1515801561293d575061293b84848484613842565b155b1561295b576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b604080516060808201835260008083526020808401829052838501829052845192830185528183528201819052928101929092529060018310806129a7575060fb548310155b156129b25792915050565b50600082815260ff6020818152604092839020835160608101855290546001600160a01b038116825267ffffffffffffffff600160a01b82041692820192909252600160e01b9091049091161580159282019290925290612a135792915050565b6127d7836136e5565b6060612a27826130a5565b612a5d576040517fa14c4b5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006101048054612a6d90614e74565b90501115612b08576101048054612a8390614e74565b80601f0160208091040260200160405190810160405280929190818152602001828054612aaf90614e74565b8015612afc5780601f10612ad157610100808354040283529160200191612afc565b820191906000526020600020905b815481529060010190602001808311612adf57829003601f168201915b50505050509050919050565b505060408051602081019091526000815290565b919050565b6000612b2d8133613156565b5061010b55565b600082815260656020526040902060010154612b508133613156565b61101f8383613278565b6000612b668133613156565b612b71848484613960565b604080516001600160a01b0386811682528516602082015290810183905233907f360bb0808951709e17b8c0ff5cf74aa15579508d1227398aac32794efdfe75ea9060600160405180910390a250505050565b6000612bd08133613156565b604051627eeac760e11b81523060048201527f9b318f4ce0672a3f1ac661d9739a947f38b863a00000000000000100000005dc602482015260009073495f947276749ce646f68ac8c248420045cb7b5e9062fdd58e90604401602060405180830381865afa158015612c46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c6a9190614f21565b905060008111612cbc5760405162461bcd60e51b815260206004820181905260248201527f4d5648513a206e6f206c6567616379206b65797320746f207472616e736665726044820152606401610412565b604080518082018252600381527f3078300000000000000000000000000000000000000000000000000000000000602082015290517ff242432a00000000000000000000000000000000000000000000000000000000815273495f947276749ce646f68ac8c248420045cb7b5e9163f242432a91612d6591309188917f9b318f4ce0672a3f1ac661d9739a947f38b863a00000000000000100000005dc91889190600401614f94565b600060405180830381600087803b158015612d7f57600080fd5b505af1158015612d93573d6000803e3d6000fd5b5050604080516001600160a01b0387168152602081018590523393507ffeb6c27c598d8581a441fc8e59e9ef9fc43c0a609af2aed0554a05b5aaa6fca6925001611b69565b6000612de48133613156565b61010580546001600160a01b0384811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040805191909216808252602082019390935233917fc8894f26f396ce8c004245c8b7cd1b92103a6e4302fcbab883987149ac01b7ec9101611b69565b600054610100900460ff16612e695760005460ff1615612e6d565b303b155b612edf5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610412565b600054610100900460ff16158015612f1e57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b612f926040518060400160405280600481526020017f4d564851000000000000000000000000000000000000000000000000000000008152506040518060400160405280600481526020017f4d5648510000000000000000000000000000000000000000000000000000000081525061396d565b612f9a613a00565b612fa56000336131d6565b8151612fb990610104906020850190614662565b50600561010855610105805473ffffffffffffffffffffffffffffffffffffffff191633179055610109805460ff19166001179055662386f26fc1000061010a55617dc461010b5580156111b457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555050565b60006001600160e01b031982167f80ac58cd00000000000000000000000000000000000000000000000000000000148061309657506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610d955750610d9582613a7f565b6000816001111580156130b9575060fb5482105b8015610d95575050600090815260ff6020819052604090912054600160e01b9004161590565b60008281526101016020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b61101f8383836001613ae6565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff166111b457613194816001600160a01b03166014613d38565b61319f836020613d38565b6040516020016131b0929190614ff6565b60408051601f198184030181529082905262461bcd60e51b825261041291600401614786565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff166111b45760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556132343390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16156111b45760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b7f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e36111b48133613156565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156133595761101f83613f61565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156133b3575060408051601f3d908101601f191682019092526133b091810190614f21565b60015b6134255760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152608401610412565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81146134ba5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c655555494400000000000000000000000000000000000000000000006064820152608401610412565b5061101f83838361402c565b60006134d1836136e5565b80519091508215613550576000336001600160a01b03831614806134fa57506134fa8233610bfb565b8061351557503361350a86610f07565b6001600160a01b0316145b90508061354e576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b61355e816000866001614051565b61356a600085836130df565b6001600160a01b03808216600081815261010060209081526040808320805470010000000000000000000000000000000060001967ffffffffffffffff80841691909101811667ffffffffffffffff19841681178390048216600190810183169093027fffffffffffffffff0000000000000000ffffffffffffffff0000000000000000909416179290921783558b865260ff90945282852080547fffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffff42909316600160a01b026001600160e01b03199091169097179690961716600160e01b17855591890180845292208054919490911661369a5760fb54821461369a578054602087015167ffffffffffffffff16600160a01b026001600160e01b03199091166001600160a01b038716171781555b5050604051869250600091506001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a4505060fc805460010190555050565b60408051606081018252600080825260208201819052918101919091528180600111158015613715575060fb5481105b156137f657600081815260ff6020818152604092839020835160608101855290546001600160a01b038116825267ffffffffffffffff600160a01b82041692820192909252600160e01b9091049091161515918101829052906137f45780516001600160a01b031615613789579392505050565b5060001901600081815260ff6020818152604092839020835160608101855290546001600160a01b03811680835267ffffffffffffffff600160a01b83041693830193909352600160e01b900490921615159282019290925290156137ef579392505050565b613789565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111b4828260405180602001604052806000815250614201565b6040517f150b7a020000000000000000000000000000000000000000000000000000000081526000906001600160a01b0385169063150b7a0290613890903390899088908890600401615077565b6020604051808303816000875af19250505080156138cb575060408051601f3d908101601f191682019092526138c8918101906150b3565b60015b613929573d8080156138f9576040519150601f19603f3d011682016040523d82523d6000602084013e6138fe565b606091505b508051600003613921576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b0319167f150b7a02000000000000000000000000000000000000000000000000000000001490505b949350505050565b61101f8383836000613ae6565b600054610100900460ff166139ea5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610412565b6139f4828261420e565b6139fc613a00565b6111b45b600054610100900460ff16613a7d5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610412565b565b60006001600160e01b031982167f7965db0b000000000000000000000000000000000000000000000000000000001480610d9557507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610d95565b6000613af1836136e5565b9050846001600160a01b031681600001516001600160a01b031614613b42576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8115613bfc576000336001600160a01b0387161480613b665750613b668633610bfb565b80613b81575033613b7685610f07565b6001600160a01b0316145b905080613bba576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516613bfa576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b613c098585856001614051565b613c15600084876130df565b6001600160a01b03858116600090815261010060209081526040808320805467ffffffffffffffff1980821667ffffffffffffffff9283166000190183161790925589861680865283862080549384169383166001908101841694909417905589865260ff90945282852080546001600160e01b031916909417600160a01b42909216919091021783558701808452922080549193909116613cec5760fb548214613cec578054602085015167ffffffffffffffff16600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b60606000613d47836002614fd7565b613d52906002614f5f565b67ffffffffffffffff811115613d6a57613d6a614876565b6040519080825280601f01601f191660200182016040528015613d94576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110613dcb57613dcb614eae565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110613e2e57613e2e614eae565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000613e6a846002614fd7565b613e75906001614f5f565b90505b6001811115613f12577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110613eb657613eb6614eae565b1a60f81b828281518110613ecc57613ecc614eae565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93613f0b816150d0565b9050613e78565b5083156127d75760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610412565b6001600160a01b0381163b613fde5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152608401610412565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b614035836142bc565b6000825111806140425750805b1561101f5761295b83836142fc565b3360009081527fffdfc1249c027f9191656349feb0761381bb32c9f557e01f419fd08754bf5a1b602052604090205460ff166141fc57614090846127de565b156141035760405162461bcd60e51b815260206004820152602360248201527f4d5648513a206b657920686f6c646572206164647265737320697320666c616760448201527f67656400000000000000000000000000000000000000000000000000000000006064820152608401610412565b61410c836127de565b1561417f5760405162461bcd60e51b815260206004820152602560248201527f4d5648513a206b6579207265636569766572206164647265737320697320666c60448201527f61676765640000000000000000000000000000000000000000000000000000006064820152608401610412565b815b61418b8284614f5f565b8110156141fa5761419b816125a8565b156141e85760405162461bcd60e51b815260206004820152601460248201527f4d5648513a206b657920697320666c61676765640000000000000000000000006044820152606401610412565b806141f281614f07565b915050614181565b505b61295b565b61101f8383836001614407565b600054610100900460ff1661428b5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610412565b815161429e9060fd906020850190614662565b5080516142b29060fe906020840190614662565b50600160fb555050565b6142c581613f61565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b61437b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610412565b600080846001600160a01b03168460405161439691906150e7565b600060405180830381855af49150503d80600081146143d1576040519150601f19603f3d011682016040523d82523d6000602084013e6143d6565b606091505b50915091506143fe828260405180606001604052806027815260200161510460279139614629565b95945050505050565b60fb546001600160a01b03851661444a576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83600003614484576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6144916000868387614051565b6001600160a01b03851660008181526101006020908152604080832080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000811667ffffffffffffffff8083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c0181169092021790915585845260ff90925290912080546001600160e01b031916909217600160a01b42909216919091021790558080850183801561455357506001600160a01b0387163b15155b156145db575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46145a46000888480600101955088613842565b6145c1576040516368d2bf6b60e11b815260040160405180910390fd5b808203614559578260fb54146145d657600080fd5b614620565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a48082036145dc575b5060fb55613d31565b606083156146385750816127d7565b8251156146485782518084602001fd5b8160405162461bcd60e51b81526004016104129190614786565b82805461466e90614e74565b90600052602060002090601f01602090048101928261469057600085556146d6565b82601f106146a957805160ff19168380011785556146d6565b828001600101855582156146d6579182015b828111156146d65782518255916020019190600101906146bb565b506146e29291506146e6565b5090565b5b808211156146e257600081556001016146e7565b6001600160e01b03198116811461135257600080fd5b60006020828403121561472357600080fd5b81356127d7816146fb565b60005b83811015614749578181015183820152602001614731565b8381111561295b5750506000910152565b6000815180845261477281602086016020860161472e565b601f01601f19169290920160200192915050565b6020815260006127d7602083018461475a565b6000602082840312156147ab57600080fd5b5035919050565b80356001600160a01b0381168114612b1c57600080fd5b600080604083850312156147dc57600080fd5b6147e5836147b2565b946020939093013593505050565b60008060006060848603121561480857600080fd5b614811846147b2565b925061481f602085016147b2565b9150604084013590509250925092565b6000806040838503121561484257600080fd5b82359150614852602084016147b2565b90509250929050565b60006020828403121561486d57600080fd5b6127d7826147b2565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156148b5576148b5614876565b604052919050565b600067ffffffffffffffff8311156148d7576148d7614876565b6148ea6020601f19601f8601160161488c565b90508281528383830111156148fe57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261492657600080fd5b6127d7838335602085016148bd565b6000806040838503121561494857600080fd5b614951836147b2565b9150602083013567ffffffffffffffff81111561496d57600080fd5b61497985828601614915565b9150509250929050565b60006020828403121561499557600080fd5b813567ffffffffffffffff8111156149ac57600080fd5b8201601f810184136149bd57600080fd5b613958848235602084016148bd565b600060208083850312156149df57600080fd5b823567ffffffffffffffff808211156149f757600080fd5b818501915085601f830112614a0b57600080fd5b813581811115614a1d57614a1d614876565b8060051b9150614a2e84830161488c565b8181529183018401918481019088841115614a4857600080fd5b938501935b83851015614a6657843582529385019390850190614a4d565b98975050505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561257657614aca83855180516001600160a01b0316825260208082015167ffffffffffffffff16908301526040908101511515910152565b9284019260609290920191600101614a8e565b6020808252825182820181905260009190848201906040850190845b8181101561257657835183529284019291840191600101614af9565b801515811461135257600080fd5b600060208284031215614b3557600080fd5b81356127d781614b15565b6020808252825182820181905260009190848201906040850190845b818110156125765783516001600160a01b031683529284019291840191600101614b5c565b600080600060608486031215614b9657600080fd5b614b9f846147b2565b95602085013595506040909401359392505050565b60008060408385031215614bc757600080fd5b614bd0836147b2565b91506020830135614be081614b15565b809150509250929050565b60008060008060808587031215614c0157600080fd5b614c0a856147b2565b9350614c18602086016147b2565b925060408501359150606085013567ffffffffffffffff811115614c3b57600080fd5b614c4787828801614915565b91505092959194509250565b60008083601f840112614c6557600080fd5b50813567ffffffffffffffff811115614c7d57600080fd5b6020830191508360208260051b8501011115614c9857600080fd5b9250929050565b60008083601f840112614cb157600080fd5b50813567ffffffffffffffff811115614cc957600080fd5b602083019150836020828501011115614c9857600080fd5b60008060008060008060008060a0898b031215614cfd57600080fd5b614d06896147b2565b9750614d1460208a016147b2565b9650604089013567ffffffffffffffff80821115614d3157600080fd5b614d3d8c838d01614c53565b909850965060608b0135915080821115614d5657600080fd5b614d628c838d01614c53565b909650945060808b0135915080821115614d7b57600080fd5b50614d888b828c01614c9f565b999c989b5096995094979396929594505050565b81516001600160a01b0316815260208083015167ffffffffffffffff169082015260408083015115159082015260608101610d95565b60008060408385031215614de557600080fd5b614dee836147b2565b9150614852602084016147b2565b60008060008060008060a08789031215614e1557600080fd5b614e1e876147b2565b9550614e2c602088016147b2565b94506040870135935060608701359250608087013567ffffffffffffffff811115614e5657600080fd5b614e6289828a01614c9f565b979a9699509497509295939492505050565b600181811c90821680614e8857607f821691505b602082108103614ea857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082821015614eec57614eec614ec4565b500390565b634e487b7160e01b600052603160045260246000fd5b60006000198203614f1a57614f1a614ec4565b5060010190565b600060208284031215614f3357600080fd5b5051919050565b604081526000614f4d604083018561475a565b82810360208401526143fe818561475a565b60008219821115614f7257614f72614ec4565b500190565b600060208284031215614f8957600080fd5b81516127d781614b15565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152614fcc60a083018461475a565b979650505050505050565b6000816000190483118215151615614ff157614ff1614ec4565b500290565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161502e81601785016020880161472e565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161506b81602884016020880161472e565b01602801949350505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526150a9608083018461475a565b9695505050505050565b6000602082840312156150c557600080fd5b81516127d7816146fb565b6000816150df576150df614ec4565b506000190190565b600082516150f981846020870161472e565b919091019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220800eab3b34f09f884388f17d859bb07638320f62913eebeb868929938a81cea264736f6c634300080d0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.