Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
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:
PropsERC721ARIPTCG
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 1 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Apache 2.0 pragma solidity ^0.8.4; // ========== External imports ========== import 'erc721a-upgradeable/contracts/ERC721AUpgradeable.sol'; import 'erc721a-upgradeable/contracts/extensions/ERC721AQueryableUpgradeable.sol'; import 'erc721a-upgradeable/contracts/extensions/IERC721AQueryableUpgradeable.sol'; import 'erc721a-upgradeable/contracts/extensions/ERC721ABurnableUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/interfaces/IERC2981Upgradeable.sol'; import '@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/interfaces/IERC2981Upgradeable.sol'; import '@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol'; import '@openzeppelin/contracts/token/common/ERC2981.sol'; import '@thirdweb-dev/contracts/openzeppelin-presets/metatx/ERC2771ContextUpgradeable.sol'; import '@thirdweb-dev/contracts/feature/interface/IOwnable.sol'; import '@thirdweb-dev/contracts/lib/MerkleProof.sol'; // ========== Internal imports ========== import '../../interfaces/ISignatureMinting.sol'; import '../../interfaces/IPropsContract.sol'; import '../../interfaces/ISanctionsList.sol'; import {DefaultOperatorFiltererUpgradeable} from '../../external/opensea/DefaultOperatorFiltererUpgradeable.sol'; //@dev RIPTCG vaults will be bridged to SKALE using IMA bridge contract PropsERC721ARIPTCG is Initializable, IOwnable, IPropsContract, ReentrancyGuardUpgradeable, PausableUpgradeable, ERC2771ContextUpgradeable, DefaultOperatorFiltererUpgradeable, MulticallUpgradeable, AccessControlEnumerableUpgradeable, ERC721AUpgradeable, ERC721AQueryableUpgradeable, ERC721ABurnableUpgradeable, ERC2981 { using StringsUpgradeable for uint256; using EnumerableSetUpgradeable for EnumerableSetUpgradeable.Bytes32Set; using ECDSAUpgradeable for bytes32; ////////////////////////////////////////////// // State Vars ///////////////////////////////////////////// bytes32 private constant MODULE_TYPE = bytes32('PropsERC721ARIPTCG'); uint256 private constant _VERSION = 1; uint256 private nextTokenId; mapping(address => uint256) public minted; bytes32 private constant CONTRACT_ADMIN_ROLE = keccak256('CONTRACT_ADMIN_ROLE'); bytes32 private constant MINTER_ROLE = keccak256('MINTER_ROLE'); bytes32 private constant PRODUCER_ROLE = keccak256('PRODUCER_ROLE'); uint256 public MAX_SUPPLY; mapping(string => mapping(address => uint256)) public mintedByID; string private baseURI_; string public contractURI; address private _owner; address private accessRegistry; address public project; address public receivingWallet; address public rWallet; address public signatureVerifier; address[] private trustedForwarders; address public SANCTIONS_CONTRACT; ////////////////////////////////////////////// // Errors ///////////////////////////////////////////// error AllowlistInactive(); error AllowlistSupplyExhausted(); error MintQuantityInvalid(); error MerkleProofInvalid(); error MintClosed(); error InsufficientFunds(); error InvalidSignature(); error Sanctioned(); error ExpiredSignature(); ////////////////////////////////////////////// // Events ///////////////////////////////////////////// event Minted(address indexed account, string tokens); event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId); ////////////////////////////////////////////// // Init ///////////////////////////////////////////// bool private initialized; function initialize( address _defaultAdmin, string memory _name, string memory _symbol, string memory _baseURI, address[] memory _trustedForwarders, address _sigVerifier, address _receivingWallet, address _royaltyWallet, uint96 _royaltyBIPs, uint256 _maxSupply, address _accessRegistry, address _OFAC ) public initializerERC721A initializer { require(!initialized, "Contract instance has already been initialized"); initialized = true; __ReentrancyGuard_init(); __ERC2771Context_init(_trustedForwarders); __ERC721A_init(_name, _symbol); receivingWallet = _receivingWallet; rWallet = _royaltyWallet; _owner = _defaultAdmin; accessRegistry = _accessRegistry; signatureVerifier = _sigVerifier; baseURI_ = _baseURI; MAX_SUPPLY = _maxSupply; SANCTIONS_CONTRACT = _OFAC; _setDefaultRoyalty(rWallet, _royaltyBIPs); _setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin); _setRoleAdmin(CONTRACT_ADMIN_ROLE, DEFAULT_ADMIN_ROLE); _setRoleAdmin(PRODUCER_ROLE, CONTRACT_ADMIN_ROLE); _setRoleAdmin(MINTER_ROLE, PRODUCER_ROLE); nextTokenId = 1; } /*/////////////////////////////////////////////////////////////// Generic contract logic //////////////////////////////////////////////////////////////*/ /// @dev Returns the type of the contract. function contractType() external pure returns (bytes32) { return MODULE_TYPE; } /// @dev Returns the version of the contract. function contractVersion() external pure returns (uint8) { return uint8(_VERSION); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return hasRole(DEFAULT_ADMIN_ROLE, _owner) ? _owner : address(0); } /*/////////////////////////////////////////////////////////////// ERC 165 / 721A logic //////////////////////////////////////////////////////////////*/ /** * @dev see {ERC721AUpgradeable} */ function _startTokenId() internal view virtual override returns (uint256) { return 1; } /** * @dev see {IERC721Metadata} */ function tokenURI( uint256 _tokenId ) public view virtual override(ERC721AUpgradeable, IERC721AUpgradeable) returns (string memory) { require(_exists(_tokenId), '!t'); return string(abi.encodePacked(baseURI_, _tokenId.toString(), '.json')); } /** * @dev see {IERC165-supportsInterface} */ function supportsInterface( bytes4 interfaceId ) public view virtual override( AccessControlEnumerableUpgradeable, ERC721AUpgradeable, IERC721AUpgradeable, ERC2981 ) returns (bool) { return super.supportsInterface(interfaceId) || ERC721AUpgradeable.supportsInterface(interfaceId) || ERC2981.supportsInterface(interfaceId); } function mintWithSignature( ISignatureMinting.SignatureMintCart calldata cart ) external payable nonReentrant { uint256 _cost = 0; uint256 _quantity = 0; for (uint256 i = 0; i < cart.items.length; i++) { ISignatureMinting.SignatureMintCartItem memory _item = cart.items[i]; revertOnInvalidMintSignature(_msgSender(), _item); _logMintActivity(cart.items[i].uid, address(_msgSender()), cart.items[i].quantity); _quantity += _item.quantity; _cost += _item.price * _item.quantity; } require(nextTokenId + _quantity - 1 <= MAX_SUPPLY, 'Max Supply'); if (_cost > msg.value) revert InsufficientFunds(); (bool sent, bytes memory data) = receivingWallet.call{value: msg.value}(''); // mint _quantity tokens string memory tokensMinted = ''; unchecked { for (uint256 i = nextTokenId; i < nextTokenId + _quantity; i++) { tokensMinted = string(abi.encodePacked(tokensMinted, i.toString(), ',')); } minted[address(_msgSender())] += _quantity; nextTokenId += _quantity; _safeMint(_msgSender(), _quantity); emit Minted(_msgSender(), tokensMinted); } } /*/////////////////////////////////////////////////////////////// Signature Enforcement //////////////////////////////////////////////////////////////*/ function revertOnInvalidMintSignature( address sender, ISignatureMinting.SignatureMintCartItem memory cartItem ) internal view { if (cartItem.expirationTime < block.timestamp) revert ExpiredSignature(); if (mintedByID[cartItem.uid][sender] + cartItem.quantity > cartItem.allocation) revert MintQuantityInvalid(); if (mintedByID[cartItem.uid][address(0)] + cartItem.quantity > cartItem.maxSupply) revert AllowlistSupplyExhausted(); address recoveredAddress = ECDSAUpgradeable.recover( keccak256( abi.encodePacked( sender, cartItem.uid, cartItem.quantity, cartItem.price, cartItem.allocation, cartItem.expirationTime, cartItem.maxSupply ) ).toEthSignedMessageHash(), cartItem.signature ); if (recoveredAddress != signatureVerifier) revert InvalidSignature(); } function _logMintActivity( string memory uid, address wallet_address, uint256 incrementalQuantity ) internal { mintedByID[uid][wallet_address] += incrementalQuantity; mintedByID[uid][address(0)] += incrementalQuantity; } function setMaxSupply(uint256 _maxSupply) external { require(_hasMinRole(PRODUCER_ROLE)); MAX_SUPPLY = _maxSupply; } function setRoyaltyConfig(address _address, uint96 _royalty) external { require(_hasMinRole(PRODUCER_ROLE)); rWallet = _address; _setDefaultRoyalty(rWallet, _royalty); } function setReceivingWallet(address _address) external { require(_hasMinRole(PRODUCER_ROLE)); receivingWallet = _address; } function getReceivingWallet() external view returns (address) { return receivingWallet; } /// @dev Lets a contract admin set a new owner for the contract. The new owner must be a contract admin. function setOwner(address _newOwner) external { require(_hasMinRole(DEFAULT_ADMIN_ROLE)); require(hasRole(DEFAULT_ADMIN_ROLE, _newOwner), '!Admin'); address _prevOwner = _owner; _owner = _newOwner; emit OwnerUpdated(_prevOwner, _newOwner); } /// @dev Lets a contract admin set the URI for contract-level metadata. function setContractURI(string calldata _uri) external { require(_hasMinRole(CONTRACT_ADMIN_ROLE)); contractURI = _uri; } /// @dev Lets a contract admin set the URI for the baseURI. function setBaseURI(string calldata _baseURI, uint256 _startTokenId, uint256 _endTokenId) external { require(_hasMinRole(CONTRACT_ADMIN_ROLE)); baseURI_ = _baseURI; emit BatchMetadataUpdate(_startTokenId, _endTokenId); } function setSignatureVerifier(address _address) external { require(_hasMinRole(CONTRACT_ADMIN_ROLE)); signatureVerifier = _address; } /*/////////////////////////////////////////////////////////////// Miscellaneous / Overrides //////////////////////////////////////////////////////////////*/ function togglePause(bool isPaused) external { require(_hasMinRole(MINTER_ROLE)); if (isPaused) { _pause(); } else { _unpause(); } } function grantRole( bytes32 role, address account ) public virtual override(AccessControlUpgradeable, IAccessControlUpgradeable) { require(_hasMinRole(CONTRACT_ADMIN_ROLE)); if (!hasRole(role, account)) { super._grantRole(role, account); } } function revokeRole( bytes32 role, address account ) public virtual override(AccessControlUpgradeable, IAccessControlUpgradeable) { require(_hasMinRole(CONTRACT_ADMIN_ROLE)); if (hasRole(role, account)) { if (role == DEFAULT_ADMIN_ROLE && account == owner()) revert(); super._revokeRole(role, account); } } function _hasMinRole(bytes32 _role) internal view returns (bool) { // @dev does account have role? if (hasRole(_role, _msgSender())) return true; // @dev are we checking against default admin? if (_role == DEFAULT_ADMIN_ROLE) return false; // @dev walk up tree to check if user has role admin role return _hasMinRole(getRoleAdmin(_role)); } // @dev See {ERC721-_beforeTokenTransfer}. function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal override(ERC721AUpgradeable) { super._beforeTokenTransfers(from, to, startTokenId, quantity); if (isSanctioned(from) || isSanctioned(to)) revert Sanctioned(); } function setApprovalForAll( address operator, bool approved ) public override(ERC721AUpgradeable, IERC721AUpgradeable) { require(onlyAllowedOperatorApproval(operator), 'Operator not allowed'); super.setApprovalForAll(operator, approved); } function approve( address operator, uint256 tokenId ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) { require(onlyAllowedOperatorApproval(operator), 'Operator not allowed'); super.approve(operator, tokenId); } function transferFrom( address from, address to, uint256 tokenId ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) { require(onlyAllowedOperatorApproval(from), 'Operator not allowed'); super.transferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) { require(onlyAllowedOperatorApproval(from), 'Operator not allowed'); super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public payable override(ERC721AUpgradeable, IERC721AUpgradeable) { require(onlyAllowedOperatorApproval(from), 'Operator not allowed'); super.safeTransferFrom(from, to, tokenId, data); } function _msgSender() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (address sender) { return ERC2771ContextUpgradeable._msgSender(); } function _msgData() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (bytes calldata) { return ERC2771ContextUpgradeable._msgData(); } function isSanctioned(address _operatorAddress) public view returns (bool) { SanctionsList sanctionsList = SanctionsList(SANCTIONS_CONTRACT); bool isToSanctioned = sanctionsList.isSanctioned(_operatorAddress); return isToSanctioned; } function setSanctionsContract(address _address) external { require(_hasMinRole(CONTRACT_ADMIN_ROLE)); SANCTIONS_CONTRACT = _address; } /// @dev Returns the number of minted tokens for sender by allowlist. function getMintedByUid(string calldata _uid, address _wallet) external view returns (uint256) { return mintedByID[_uid][_wallet]; } uint256[46] private ___gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerableUpgradeable.sol"; import "./AccessControlUpgradeable.sol"; import "../utils/structs/EnumerableSetUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable { function __AccessControlEnumerable_init() internal onlyInitializing { } function __AccessControlEnumerable_init_unchained() internal onlyInitializing { } using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override { super._revokeRole(role, account); _roleMembers[role].remove(account); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract 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); _; } /** * @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 `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @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(account), " 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. * * May emit a {RoleGranted} event. */ 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. * * May emit a {RoleRevoked} event. */ 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`. * * May emit a {RoleRevoked} event. */ 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. * * May emit a {RoleGranted} event. * * [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. * * May emit a {RoleGranted} event. */ 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. * * May emit a {RoleRevoked} event. */ 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 // OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT // 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 (last updated v4.9.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981Upgradeable is IERC165Upgradeable { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_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 // OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardUpgradeable is Initializable { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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 * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [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://consensys.net/diligence/blog/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.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../StringsUpgradeable.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSAUpgradeable { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) { // 32 is the length in bytes of hash, // enforced by the type signature above /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") mstore(0x1c, hash) message := keccak256(0x00, 0x3c) } } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, "\x19\x01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) data := keccak256(ptr, 0x42) } } /** * @dev Returns an Ethereum Signed Data with intended validator, created from a * `validator` and `data` according to the version 0 of EIP-191. * * See {recover}. */ function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x00", validator, data)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library MathUpgradeable { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMathUpgradeable { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Multicall.sol) pragma solidity ^0.8.0; import "./AddressUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Provides a function to batch together multiple calls in a single external call. * * _Available since v4.1._ */ abstract contract MulticallUpgradeable is Initializable { function __Multicall_init() internal onlyInitializing { } function __Multicall_init_unchained() internal onlyInitializing { } /** * @dev Receives and executes a batch of function calls on this contract. * @custom:oz-upgrades-unsafe-allow-reachable delegatecall */ function multicall(bytes[] calldata data) external virtual returns (bytes[] memory results) { results = new bytes[](data.length); for (uint256 i = 0; i < data.length; i++) { results[i] = AddressUpgradeable.functionDelegateCall(address(this), data[i]); } return results; } /** * @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.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/MathUpgradeable.sol"; import "./math/SignedMathUpgradeable.sol"; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = MathUpgradeable.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMathUpgradeable.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, MathUpgradeable.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ```solidity * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSetUpgradeable { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts 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); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /** * Thirdweb's `Ownable` is a contract extension to be used with any base contract. It exposes functions for setting and reading * who the 'owner' of the inheriting smart contract is, and lets the inheriting contract perform conditional logic that uses * information about who the contract's owner is. */ interface IOwnable { /// @dev Returns the owner of the contract. function owner() external view returns (address); /// @dev Lets a module admin set a new owner for the contract. The new owner must be a module admin. function setOwner(address _newOwner) external; /// @dev Emitted when a new Owner is set. event OwnerUpdated(address indexed prevOwner, address indexed newOwner); }
// SPDX-License-Identifier: MIT // Modified from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.3.0/contracts/utils/cryptography/MerkleProof.sol // Copied from https://github.com/ensdomains/governance/blob/master/contracts/MerkleProof.sol pragma solidity ^0.8.11; /** * @dev These functions deal with verification of Merkle Trees proofs. * * The proofs can be generated using the JavaScript library * https://github.com/miguelmota/merkletreejs[merkletreejs]. * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled. * * See `test/utils/cryptography/MerkleProof.test.js` for some examples. * * Source: https://github.com/ensdomains/governance/blob/master/contracts/MerkleProof.sol */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool, uint256) { bytes32 computedHash = leaf; uint256 index = 0; for (uint256 i = 0; i < proof.length; i++) { index *= 2; bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = keccak256(abi.encodePacked(computedHash, proofElement)); } else { // Hash(current element of the proof + current computed hash) computedHash = keccak256(abi.encodePacked(proofElement, computedHash)); index += 1; } } // Check if the computed hash (root) is equal to the provided root return (computedHash == root, index); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (metatx/ERC2771Context.sol) pragma solidity ^0.8.11; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /** * @dev Context variant with ERC2771 support. */ abstract contract ERC2771ContextUpgradeable is Initializable, ContextUpgradeable { mapping(address => bool) private _trustedForwarder; function __ERC2771Context_init(address[] memory trustedForwarder) internal onlyInitializing { __Context_init_unchained(); __ERC2771Context_init_unchained(trustedForwarder); } function __ERC2771Context_init_unchained(address[] memory trustedForwarder) internal onlyInitializing { for (uint256 i = 0; i < trustedForwarder.length; i++) { _trustedForwarder[trustedForwarder[i]] = true; } } function isTrustedForwarder(address forwarder) public view virtual returns (bool) { return _trustedForwarder[forwarder]; } function _msgSender() internal view virtual override returns (address sender) { if (isTrustedForwarder(msg.sender)) { // The assembly code is more direct than the Solidity version using `abi.decode`. assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) } } else { return super._msgSender(); } } function _msgData() internal view virtual override returns (bytes calldata) { if (isTrustedForwarder(msg.sender)) { return msg.data[:msg.data.length - 20]; } else { return super._msgData(); } } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {OperatorFiltererUpgradeable} from './OperatorFiltererUpgradeable.sol'; abstract contract DefaultOperatorFiltererUpgradeable is OperatorFiltererUpgradeable { address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6); function __DefaultOperatorFilterer_init() internal onlyInitializing { OperatorFiltererUpgradeable.__OperatorFilterer_init(DEFAULT_SUBSCRIPTION, true); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IOperatorFilterRegistry { function isOperatorAllowed(address registrant, address operator) external view returns (bool); function register(address registrant) external; function registerAndSubscribe(address registrant, address subscription) external; function registerAndCopyEntries(address registrant, address registrantToCopy) external; function unregister(address addr) external; function updateOperator(address registrant, address operator, bool filtered) external; function updateOperators( address registrant, address[] calldata operators, bool filtered ) external; function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external; function updateCodeHashes( address registrant, bytes32[] calldata codeHashes, bool filtered ) external; function subscribe(address registrant, address registrantToSubscribe) external; function unsubscribe(address registrant, bool copyExistingEntries) external; function subscriptionOf(address addr) external returns (address registrant); function subscribers(address registrant) external returns (address[] memory); function subscriberAt(address registrant, uint256 index) external returns (address); function copyEntriesOf(address registrant, address registrantToCopy) external; function isOperatorFiltered(address registrant, address operator) external returns (bool); function isCodeHashOfFiltered( address registrant, address operatorWithCode ) external returns (bool); function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); function filteredOperators(address addr) external returns (address[] memory); function filteredCodeHashes(address addr) external returns (bytes32[] memory); function filteredOperatorAt(address registrant, uint256 index) external returns (address); function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); function isRegistered(address addr) external returns (bool); function codeHashOf(address addr) external returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IOperatorFilterRegistry} from './IOperatorFilterRegistry.sol'; import {Initializable} from '@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol'; abstract contract OperatorFiltererUpgradeable is Initializable { error OperatorNotAllowed(address operator); IOperatorFilterRegistry constant operatorFilterRegistry = IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E); function __OperatorFilterer_init( address subscriptionOrRegistrantToCopy, bool subscribe ) internal onlyInitializing { // If an inheriting token contract is deployed to a network without the registry deployed, the modifier // will not revert, but the contract will need to be registered with the registry once it is deployed in // order for the modifier to filter addresses. if (address(operatorFilterRegistry).code.length > 0) { if (!operatorFilterRegistry.isRegistered(address(this))) { if (subscribe) { operatorFilterRegistry.registerAndSubscribe( address(this), subscriptionOrRegistrantToCopy ); } else { if (subscriptionOrRegistrantToCopy != address(0)) { operatorFilterRegistry.registerAndCopyEntries( address(this), subscriptionOrRegistrantToCopy ); } else { operatorFilterRegistry.register(address(this)); } } } } } modifier onlyAllowedOperator(address from) virtual { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(operatorFilterRegistry).code.length > 0) { // Allow spending tokens from addresses with balance // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred // from an EOA. if (from == msg.sender) { _; return; } if (!operatorFilterRegistry.isOperatorAllowed(address(this), msg.sender)) { revert OperatorNotAllowed(msg.sender); } } _; } function onlyAllowedOperatorApproval(address operator) public view returns (bool) { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(operatorFilterRegistry).code.length > 0) { if (!operatorFilterRegistry.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(operator); } } return true; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.11; interface IPropsContract { /// @dev Returns the module type of the contract. function contractType() external pure returns (bytes32); /// @dev Returns the version of the contract. function contractVersion() external pure returns (uint8); /// @dev Returns the metadata URI of the contract. function contractURI() external view returns (string memory); /** * @dev Sets contract URI for the storefront-level metadata of the contract. * Only module admin can call this function. */ function setContractURI(string calldata _uri) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; interface SanctionsList { function isSanctioned(address addr) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; interface ISignatureMinting { struct SignatureMintCart { SignatureMintCartItem[] items; } struct SignatureMintCartItem{ string uid; uint256 quantity; uint256 price; uint256 allocation; uint256 expirationTime; uint256 maxSupply; bytes signature; } struct MintSignature { address wallet_address; string uid; uint256 quantity; uint256 price; uint256 allocation; uint256 startTime; uint256 endTime; } struct Version { uint256 major; uint256 minor; uint256 patch; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is a base contract to aid in writing upgradeable diamond facet 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. */ import {ERC721A__InitializableStorage} from './ERC721A__InitializableStorage.sol'; abstract contract ERC721A__Initializable { using ERC721A__InitializableStorage for ERC721A__InitializableStorage.Layout; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializerERC721A() { // 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( ERC721A__InitializableStorage.layout()._initializing ? _isConstructor() : !ERC721A__InitializableStorage.layout()._initialized, 'ERC721A__Initializable: contract is already initialized' ); bool isTopLevelCall = !ERC721A__InitializableStorage.layout()._initializing; if (isTopLevelCall) { ERC721A__InitializableStorage.layout()._initializing = true; ERC721A__InitializableStorage.layout()._initialized = true; } _; if (isTopLevelCall) { ERC721A__InitializableStorage.layout()._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 onlyInitializingERC721A() { require( ERC721A__InitializableStorage.layout()._initializing, 'ERC721A__Initializable: contract is not initializing' ); _; } /// @dev Returns true if and only if the function is running in the constructor function _isConstructor() private view returns (bool) { // extcodesize checks the size of the code stored in an address, and // address returns the current address. Since the code is still not // deployed when running a constructor, any checks on its code size will // yield zero, making it an effective way to detect if a contract is // under construction or not. address self = address(this); uint256 cs; assembly { cs := extcodesize(self) } return cs == 0; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is a base storage for the initialization function for upgradeable diamond facet contracts **/ library ERC721A__InitializableStorage { struct Layout { /* * Indicates that the contract has been initialized. */ bool _initialized; /* * Indicates that the contract is in the process of being initialized. */ bool _initializing; } bytes32 internal constant STORAGE_SLOT = keccak256('ERC721A.contracts.storage.initializable.facet'); function layout() internal pure returns (Layout storage l) { bytes32 slot = STORAGE_SLOT; assembly { l.slot := slot } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library ERC721AStorage { // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364). struct TokenApprovalRef { address value; } struct Layout { // ============================================================= // STORAGE // ============================================================= // The next token ID to be minted. uint256 _currentIndex; // The number of tokens burned. uint256 _burnCounter; // Token name string _name; // Token symbol string _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. // See {_packedOwnershipOf} implementation for details. // // Bits Layout: // - [0..159] `addr` // - [160..223] `startTimestamp` // - [224] `burned` // - [225] `nextInitialized` // - [232..255] `extraData` mapping(uint256 => uint256) _packedOwnerships; // Mapping owner address to address data. // // Bits Layout: // - [0..63] `balance` // - [64..127] `numberMinted` // - [128..191] `numberBurned` // - [192..255] `aux` mapping(address => uint256) _packedAddressData; // Mapping from token ID to approved address. mapping(uint256 => ERC721AStorage.TokenApprovalRef) _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) _operatorApprovals; } bytes32 internal constant STORAGE_SLOT = keccak256('ERC721A.contracts.storage.ERC721A'); function layout() internal pure returns (Layout storage l) { bytes32 slot = STORAGE_SLOT; assembly { l.slot := slot } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721AUpgradeable.sol'; import {ERC721AStorage} from './ERC721AStorage.sol'; import './ERC721A__Initializable.sol'; /** * @dev Interface of ERC721 token receiver. */ interface ERC721A__IERC721ReceiverUpgradeable { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @title ERC721A * * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) * Non-Fungible Token Standard, including the Metadata extension. * Optimized for lower gas during batch mints. * * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) * starting from `_startTokenId()`. * * Assumptions: * * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721AUpgradeable is ERC721A__Initializable, IERC721AUpgradeable { using ERC721AStorage for ERC721AStorage.Layout; // ============================================================= // CONSTANTS // ============================================================= // Mask of an entry in packed address data. uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1; // The bit position of `numberMinted` in packed address data. uint256 private constant _BITPOS_NUMBER_MINTED = 64; // The bit position of `numberBurned` in packed address data. uint256 private constant _BITPOS_NUMBER_BURNED = 128; // The bit position of `aux` in packed address data. uint256 private constant _BITPOS_AUX = 192; // Mask of all 256 bits in packed address data except the 64 bits for `aux`. uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1; // The bit position of `startTimestamp` in packed ownership. uint256 private constant _BITPOS_START_TIMESTAMP = 160; // The bit mask of the `burned` bit in packed ownership. uint256 private constant _BITMASK_BURNED = 1 << 224; // The bit position of the `nextInitialized` bit in packed ownership. uint256 private constant _BITPOS_NEXT_INITIALIZED = 225; // The bit mask of the `nextInitialized` bit in packed ownership. uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225; // The bit position of `extraData` in packed ownership. uint256 private constant _BITPOS_EXTRA_DATA = 232; // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`. uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1; // The mask of the lower 160 bits for addresses. uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; // The maximum `quantity` that can be minted with {_mintERC2309}. // This limit is to prevent overflows on the address data entries. // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309} // is required to cause an overflow, which is unrealistic. uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000; // The `Transfer` event signature is given by: // `keccak256(bytes("Transfer(address,address,uint256)"))`. bytes32 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; // ============================================================= // CONSTRUCTOR // ============================================================= function __ERC721A_init(string memory name_, string memory symbol_) internal onlyInitializingERC721A { __ERC721A_init_unchained(name_, symbol_); } function __ERC721A_init_unchained(string memory name_, string memory symbol_) internal onlyInitializingERC721A { ERC721AStorage.layout()._name = name_; ERC721AStorage.layout()._symbol = symbol_; ERC721AStorage.layout()._currentIndex = _startTokenId(); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @dev Returns the starting token ID. * To change the starting token ID, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId() internal view virtual returns (uint256) { return ERC721AStorage.layout()._currentIndex; } /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() public view virtual override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than `_currentIndex - _startTokenId()` times. unchecked { return ERC721AStorage.layout()._currentIndex - ERC721AStorage.layout()._burnCounter - _startTokenId(); } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view virtual returns (uint256) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { return ERC721AStorage.layout()._currentIndex - _startTokenId(); } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return ERC721AStorage.layout()._burnCounter; } // ============================================================= // ADDRESS DATA OPERATIONS // ============================================================= /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) public view virtual override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return ERC721AStorage.layout()._packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return (ERC721AStorage.layout()._packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return (ERC721AStorage.layout()._packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return uint64(ERC721AStorage.layout()._packedAddressData[owner] >> _BITPOS_AUX); } /** * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal virtual { uint256 packed = ERC721AStorage.layout()._packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); ERC721AStorage.layout()._packedAddressData[owner] = packed; } // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { // The interface IDs are constants representing the first 4 bytes // of the XOR of all function selectors in the interface. // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165) // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`) return interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. } // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() public view virtual override returns (string memory) { return ERC721AStorage.layout()._name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return ERC721AStorage.layout()._symbol; } /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : ''; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, it can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } // ============================================================= // OWNERSHIPS OPERATIONS // ============================================================= /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @dev Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around over time. */ function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @dev Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(ERC721AStorage.layout()._packedOwnerships[index]); } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal virtual { if (ERC721AStorage.layout()._packedOwnerships[index] == 0) { ERC721AStorage.layout()._packedOwnerships[index] = _packedOwnershipOf(index); } } /** * Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) { if (_startTokenId() <= tokenId) { packed = ERC721AStorage.layout()._packedOwnerships[tokenId]; // If not burned. if (packed & _BITMASK_BURNED == 0) { // If the data at the starting slot does not exist, start the scan. if (packed == 0) { if (tokenId >= ERC721AStorage.layout()._currentIndex) revert OwnerQueryForNonexistentToken(); // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `tokenId` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. for (;;) { unchecked { packed = ERC721AStorage.layout()._packedOwnerships[--tokenId]; } if (packed == 0) continue; return packed; } } // Otherwise, the data exists and is not burned. We can skip the scan. // This is possible because we have already achieved the target condition. // This saves 2143 gas on transfers of initialized tokens. return packed; } } revert OwnerQueryForNonexistentToken(); } /** * @dev Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); ownership.burned = packed & _BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)) } } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. See {ERC721A-_approve}. * * Requirements: * * - The caller must own the token or be an approved operator. */ function approve(address to, uint256 tokenId) public payable virtual override { _approve(to, tokenId, true); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return ERC721AStorage.layout()._tokenApprovals[tokenId].value; } /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) public virtual override { ERC721AStorage.layout()._operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return ERC721AStorage.layout()._operatorApprovals[owner][operator]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted. See {_mint}. */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _startTokenId() <= tokenId && tokenId < ERC721AStorage.layout()._currentIndex && // If within bounds, ERC721AStorage.layout()._packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned. } /** * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`. */ function _isSenderApprovedOrOwner( address approvedAddress, address owner, address msgSender ) private pure returns (bool result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, _BITMASK_ADDRESS) // `msgSender == owner || msgSender == approvedAddress`. result := or(eq(msgSender, owner), eq(msgSender, approvedAddress)) } } /** * @dev Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedSlotAndAddress(uint256 tokenId) private view returns (uint256 approvedAddressSlot, address approvedAddress) { ERC721AStorage.TokenApprovalRef storage tokenApproval = ERC721AStorage.layout()._tokenApprovals[tokenId]; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`. assembly { approvedAddressSlot := tokenApproval.slot approvedAddress := sload(approvedAddressSlot) } } // ============================================================= // TRANSFER OPERATIONS // ============================================================= /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) public payable virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // We can directly increment and decrement the balances. --ERC721AStorage.layout()._packedAddressData[from]; // Updates: `balance -= 1`. ++ERC721AStorage.layout()._packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. ERC721AStorage.layout()._packedOwnerships[tokenId] = _packOwnershipData( to, _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (ERC721AStorage.layout()._packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != ERC721AStorage.layout()._currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. ERC721AStorage.layout()._packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public payable virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public payable virtual override { transferFrom(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @dev Hook that is called before a set of serially-ordered token IDs * are about to be transferred. This includes minting. * And also called before burning one token. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token IDs * have been transferred. This includes minting. * And also called after one token has been burned. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * `from` - Previous owner of the given token ID. * `to` - Target address that will receive the token. * `tokenId` - Token ID to be transferred. * `_data` - Optional data to send along with the call. * * Returns whether the call correctly returned the expected magic value. */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try ERC721A__IERC721ReceiverUpgradeable(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (bytes4 retval) { return retval == ERC721A__IERC721ReceiverUpgradeable(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } // ============================================================= // MINT OPERATIONS // ============================================================= /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event for each mint. */ function _mint(address to, uint256 quantity) internal virtual { uint256 startTokenId = ERC721AStorage.layout()._currentIndex; if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // `balance` and `numberMinted` have a maximum limit of 2**64. // `tokenId` has a maximum limit of 2**256. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. ERC721AStorage.layout()._packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. ERC721AStorage.layout()._packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); uint256 toMasked; uint256 end = startTokenId + quantity; // Use assembly to loop and emit the `Transfer` event for gas savings. // The duplicated `log4` removes an extra check and reduces stack juggling. // The assembly, together with the surrounding Solidity code, have been // delicately arranged to nudge the compiler into producing optimized opcodes. assembly { // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. toMasked := and(to, _BITMASK_ADDRESS) // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. startTokenId // `tokenId`. ) // The `iszero(eq(,))` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. // The compiler will optimize the `iszero` away for performance. for { let tokenId := add(startTokenId, 1) } iszero(eq(tokenId, end)) { tokenId := add(tokenId, 1) } { // Emit the `Transfer` event. Similar to above. log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId) } } if (toMasked == 0) revert MintToZeroAddress(); ERC721AStorage.layout()._currentIndex = end; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * This function is intended for efficient minting only during contract creation. * * It emits only one {ConsecutiveTransfer} as defined in * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). * * Calling this function outside of contract creation WILL make your contract * non-compliant with the ERC721 standard. * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 * {ConsecutiveTransfer} event is only permissible during contract creation. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {ConsecutiveTransfer} event. */ function _mintERC2309(address to, uint256 quantity) internal virtual { uint256 startTokenId = ERC721AStorage.layout()._currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are unrealistic due to the above check for `quantity` to be below the limit. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. ERC721AStorage.layout()._packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. ERC721AStorage.layout()._packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to); ERC721AStorage.layout()._currentIndex = startTokenId + quantity; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * See {_mint}. * * Emits a {Transfer} event for each mint. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = ERC721AStorage.layout()._currentIndex; uint256 index = end - quantity; do { if (!_checkContractOnERC721Received(address(0), to, index++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (index < end); // Reentrancy protection. if (ERC721AStorage.layout()._currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Equivalent to `_approve(to, tokenId, false)`. */ function _approve(address to, uint256 tokenId) internal virtual { _approve(to, tokenId, false); } /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - `tokenId` must exist. * * Emits an {Approval} event. */ function _approve( address to, uint256 tokenId, bool approvalCheck ) internal virtual { address owner = ownerOf(tokenId); if (approvalCheck) if (_msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } ERC721AStorage.layout()._tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // Updates: // - `balance -= 1`. // - `numberBurned += 1`. // // We can directly decrement the balance, and increment the number burned. // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`. ERC721AStorage.layout()._packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1; // Updates: // - `address` to the last owner. // - `startTimestamp` to the timestamp of burning. // - `burned` to `true`. // - `nextInitialized` to `true`. ERC721AStorage.layout()._packedOwnerships[tokenId] = _packOwnershipData( from, (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (ERC721AStorage.layout()._packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != ERC721AStorage.layout()._currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. ERC721AStorage.layout()._packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { ERC721AStorage.layout()._burnCounter++; } } // ============================================================= // EXTRA DATA OPERATIONS // ============================================================= /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { uint256 packed = ERC721AStorage.layout()._packedOwnerships[index]; if (packed == 0) revert OwnershipNotInitializedForExtraData(); uint256 extraDataCasted; // Cast `extraData` with assembly to avoid redundant masking. assembly { extraDataCasted := extraData } packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA); ERC721AStorage.layout()._packedOwnerships[index] = packed; } /** * @dev Called during each token transfer to set the 24bit `extraData` field. * Intended to be overridden by the cosumer contract. * * `previousExtraData` - the value of `extraData` before transfer. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _extraData( address from, address to, uint24 previousExtraData ) internal view virtual returns (uint24) {} /** * @dev Returns the next extra data for the packed ownership data. * The returned result is shifted into position. */ function _nextExtraData( address from, address to, uint256 prevOwnershipPacked ) private view returns (uint256) { uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA); return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA; } // ============================================================= // OTHER OPERATIONS // ============================================================= /** * @dev Returns the message sender (defaults to `msg.sender`). * * If you are writing GSN compatible contracts, you need to override this function. */ function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; } /** * @dev Converts a uint256 to its ASCII string decimal representation. */ function _toString(uint256 value) internal pure virtual returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0. let m := add(mload(0x40), 0xa0) // Update the free memory pointer to allocate. mstore(0x40, m) // Assign the `str` to the end. str := sub(m, 0x20) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 1) // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) // prettier-ignore if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721ABurnableUpgradeable.sol'; import '../ERC721AUpgradeable.sol'; import '../ERC721A__Initializable.sol'; /** * @title ERC721ABurnable. * * @dev ERC721A token that can be irreversibly burned (destroyed). */ abstract contract ERC721ABurnableUpgradeable is ERC721A__Initializable, ERC721AUpgradeable, IERC721ABurnableUpgradeable { function __ERC721ABurnable_init() internal onlyInitializingERC721A { __ERC721ABurnable_init_unchained(); } function __ERC721ABurnable_init_unchained() internal onlyInitializingERC721A {} /** * @dev Burns `tokenId`. See {ERC721A-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) public virtual override { _burn(tokenId, true); } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721AQueryableUpgradeable.sol'; import '../ERC721AUpgradeable.sol'; import '../ERC721A__Initializable.sol'; /** * @title ERC721AQueryable. * * @dev ERC721A subclass with convenience query functions. */ abstract contract ERC721AQueryableUpgradeable is ERC721A__Initializable, ERC721AUpgradeable, IERC721AQueryableUpgradeable { function __ERC721AQueryable_init() internal onlyInitializingERC721A { __ERC721AQueryable_init_unchained(); } function __ERC721AQueryable_init_unchained() internal onlyInitializingERC721A {} /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * * - `addr = address(0)` * - `startTimestamp = 0` * - `burned = false` * - `extraData = 0` * * If the `tokenId` is burned: * * - `addr = <Address of owner before token was burned>` * - `startTimestamp = <Timestamp when token was burned>` * - `burned = true` * - `extraData = <Extra data when token was burned>` * * Otherwise: * * - `addr = <Address of owner>` * - `startTimestamp = <Timestamp of start of ownership>` * - `burned = false` * - `extraData = <Extra data at start of ownership>` */ function explicitOwnershipOf(uint256 tokenId) public view virtual override returns (TokenOwnership memory) { TokenOwnership memory ownership; if (tokenId < _startTokenId() || tokenId >= _nextTokenId()) { return ownership; } ownership = _ownershipAt(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[] calldata tokenIds) external view virtual override 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 virtual override returns (uint256[] memory) { unchecked { if (start >= stop) revert InvalidQueryRange(); uint256 tokenIdsIdx; uint256 stopLimit = _nextTokenId(); // Set `start = max(start, _startTokenId())`. if (start < _startTokenId()) { start = _startTokenId(); } // Set `stop = min(stop, stopLimit)`. 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 = _ownershipAt(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 collections should be fine). */ function tokensOfOwner(address owner) external view virtual override 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 = _ownershipAt(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 // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import '../IERC721AUpgradeable.sol'; /** * @dev Interface of ERC721ABurnable. */ interface IERC721ABurnableUpgradeable is IERC721AUpgradeable { /** * @dev Burns `tokenId`. See {ERC721A-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) external; }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import '../IERC721AUpgradeable.sol'; /** * @dev Interface of ERC721AQueryable. */ interface IERC721AQueryableUpgradeable is IERC721AUpgradeable { /** * Invalid query range (`start` >= `stop`). */ error InvalidQueryRange(); /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * * - `addr = address(0)` * - `startTimestamp = 0` * - `burned = false` * - `extraData = 0` * * If the `tokenId` is burned: * * - `addr = <Address of owner before token was burned>` * - `startTimestamp = <Timestamp when token was burned>` * - `burned = true` * - `extraData = <Extra data when token was burned>` * * Otherwise: * * - `addr = <Address of owner>` * - `startTimestamp = <Timestamp of start of ownership>` * - `burned = false` * - `extraData = <Extra data at start of ownership>` */ function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory); /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory); /** * @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); /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(`totalSupply`) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K collections should be fine). */ function tokensOfOwner(address owner) external view returns (uint256[] memory); }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721A. */ interface IERC721AUpgradeable { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * Cannot query the balance for the zero address. */ error BalanceQueryForZeroAddress(); /** * Cannot mint to the zero address. */ error MintToZeroAddress(); /** * The quantity of tokens minted must be more than zero. */ error MintZeroQuantity(); /** * The token does not exist. */ error OwnerQueryForNonexistentToken(); /** * The caller must own the token or be an approved operator. */ error TransferCallerNotOwnerNorApproved(); /** * The token must be owned by `from`. */ error TransferFromIncorrectOwner(); /** * Cannot safely transfer to a contract that does not implement the * ERC721Receiver interface. */ error TransferToNonERC721ReceiverImplementer(); /** * Cannot transfer to the zero address. */ error TransferToZeroAddress(); /** * The token does not exist. */ error URIQueryForNonexistentToken(); /** * The `quantity` minted with ERC2309 exceeds the safety limit. */ error MintERC2309QuantityExceedsLimit(); /** * The `extraData` cannot be set on an unintialized ownership slot. */ error OwnershipNotInitializedForExtraData(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. uint24 extraData; } // ============================================================= // TOKEN COUNTERS // ============================================================= /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() external view returns (uint256); // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================================================= // IERC721 // ============================================================= /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables * (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, * checking first that contract recipients are aware of the ERC721 protocol * to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move * this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external payable; /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Transfers `tokenId` from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} * whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external payable; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) external view returns (bool); // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); // ============================================================= // IERC2309 // ============================================================= /** * @dev Emitted when tokens in `fromTokenId` to `toTokenId` * (inclusive) is transferred from `from` to `to`, as defined in the * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard. * * See {_mintERC2309} for more details. */ event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); }
{ "metadata": { "bytecodeHash": "none", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 1 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"name":"AllowlistInactive","type":"error"},{"inputs":[],"name":"AllowlistSupplyExhausted","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"ExpiredSignature","type":"error"},{"inputs":[],"name":"InsufficientFunds","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"MerkleProofInvalid","type":"error"},{"inputs":[],"name":"MintClosed","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintQuantityInvalid","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"Sanctioned","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"string","name":"tokens","type":"string"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prevOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SANCTIONS_CONTRACT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractType","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractVersion","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721AUpgradeable.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":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721AUpgradeable.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_uid","type":"string"},{"internalType":"address","name":"_wallet","type":"address"}],"name":"getMintedByUid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReceivingWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_defaultAdmin","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_baseURI","type":"string"},{"internalType":"address[]","name":"_trustedForwarders","type":"address[]"},{"internalType":"address","name":"_sigVerifier","type":"address"},{"internalType":"address","name":"_receivingWallet","type":"address"},{"internalType":"address","name":"_royaltyWallet","type":"address"},{"internalType":"uint96","name":"_royaltyBIPs","type":"uint96"},{"internalType":"uint256","name":"_maxSupply","type":"uint256"},{"internalType":"address","name":"_accessRegistry","type":"address"},{"internalType":"address","name":"_OFAC","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_operatorAddress","type":"address"}],"name":"isSanctioned","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"string","name":"uid","type":"string"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"allocation","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct ISignatureMinting.SignatureMintCartItem[]","name":"items","type":"tuple[]"}],"internalType":"struct ISignatureMinting.SignatureMintCart","name":"cart","type":"tuple"}],"name":"mintWithSignature","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"minted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"},{"internalType":"address","name":"","type":"address"}],"name":"mintedByID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"onlyAllowedOperatorApproval","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"project","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"receivingWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseURI","type":"string"},{"internalType":"uint256","name":"_startTokenId","type":"uint256"},{"internalType":"uint256","name":"_endTokenId","type":"uint256"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxSupply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setReceivingWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint96","name":"_royalty","type":"uint96"}],"name":"setRoyaltyConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setSanctionsContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setSignatureVerifier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signatureVerifier","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":"bool","name":"isPaused","type":"bool"}],"name":"togglePause","outputs":[],"stateMutability":"nonpayable","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":"payable","type":"function"}]
Contract Creation Code
608060405234801561000f575f80fd5b5061499d8061001d5f395ff3fe608060405260043610610290575f3560e01c806301ffc9a71461029457806306fdde03146102c8578063081812fc146102e9578063095ea7b31461031557806313af40351461032a57806318160ddd146103495780631bbea7d61461036b5780631e7269c51461037e57806323b872dd146103aa578063248a9ca3146103bd5780632a55205a146103dc5780632f2ff15d1461041a578063323018341461043957806332cb6b0c1461045857806336568abe1461046e5780633dc3df7d1461048d57806342842e0e146104ad57806342966c68146104c057806348f3afed146104df578063572b6c05146104fe57806357d159c61461051d5780635ace63521461053c5780635bbb21771461055b5780635c975abb146105875780636131bc4a1461059e5780636352211e146105bc5780636f8b44b0146105db57806370a08231146105fa578063738170a4146106195780638462151c146106395780638da5cb5b146106655780638ead7b3d146106795780638ff992ae146106995780639010d07c146106b857806391d14854146106d7578063938e3d7b146106f657806395d89b411461071557806399a2557a14610729578063a0a8e46014610748578063a217fddf14610763578063a22cb46514610776578063ac9650d814610795578063b522ecff146107c1578063b88d4fde146107e0578063c23dc68f146107f3578063c87b56dd1461081f578063ca15c8731461083e578063cb2ef6f71461085d578063d05a381a14610884578063d547741f146108a3578063df592f7d146108c2578063e08a6605146108e1578063e8a3d48514610900578063e8f984fa14610914578063e985e9c514610933578063ea140bea14610952578063f60ca60d14610999578063fde919f6146109b9575b5f80fd5b34801561029f575f80fd5b506102b36102ae3660046139dc565b6109d9565b60405190151581526020015b60405180910390f35b3480156102d3575f80fd5b506102dc610a07565b6040516102bf9190613a44565b3480156102f4575f80fd5b50610308610303366004613a56565b610aa0565b6040516102bf9190613a6d565b610328610323366004613a97565b610aeb565b005b348015610335575f80fd5b50610328610344366004613abf565b610b27565b348015610354575f80fd5b5061035d610bc9565b6040519081526020016102bf565b610328610379366004613ad8565b610be8565b348015610389575f80fd5b5061035d610398366004613abf565b6101946020525f908152604090205481565b6103286103b8366004613b0e565b610f0d565b3480156103c8575f80fd5b5061035d6103d7366004613a56565b610f42565b3480156103e7575f80fd5b506103fb6103f6366004613b47565b610f57565b604080516001600160a01b0390931683526020830191909152016102bf565b348015610425575f80fd5b50610328610434366004613b67565b611005565b348015610444575f80fd5b50610328610453366004613d01565b61103b565b348015610463575f80fd5b5061035d6101955481565b348015610479575f80fd5b50610328610488366004613b67565b61146b565b348015610498575f80fd5b5061019d54610308906001600160a01b031681565b6103286104bb366004613b0e565b6114f5565b3480156104cb575f80fd5b506103286104da366004613a56565b611525565b3480156104ea575f80fd5b506103286104f9366004613e78565b611530565b348015610509575f80fd5b506102b3610518366004613abf565b61159c565b348015610528575f80fd5b50610328610537366004613ed1565b6115b9565b348015610547575f80fd5b50610328610556366004613abf565b6115ed565b348015610566575f80fd5b5061057a610575366004613f2c565b61162e565b6040516102bf9190613fa6565b348015610592575f80fd5b5060655460ff166102b3565b3480156105a9575f80fd5b5061019c546001600160a01b0316610308565b3480156105c7575f80fd5b506103086105d6366004613a56565b6116de565b3480156105e6575f80fd5b506103286105f5366004613a56565b6116e8565b348015610605575f80fd5b5061035d610614366004613abf565b61170c565b348015610624575f80fd5b5061019c54610308906001600160a01b031681565b348015610644575f80fd5b50610658610653366004613abf565b611771565b6040516102bf9190613fe7565b348015610670575f80fd5b50610308611854565b348015610684575f80fd5b506101a054610308906001600160a01b031681565b3480156106a4575f80fd5b5061035d6106b336600461401e565b61188a565b3480156106c3575f80fd5b506103086106d2366004613b47565b6118cc565b3480156106e2575f80fd5b506102b36106f1366004613b67565b6118e4565b348015610701575f80fd5b5061032861071036600461406d565b61190f565b348015610720575f80fd5b506102dc61193b565b348015610734575f80fd5b5061065861074336600461409f565b611953565b348015610753575f80fd5b50604051600181526020016102bf565b34801561076e575f80fd5b5061035d5f81565b348015610781575f80fd5b506103286107903660046140cf565b611ad0565b3480156107a0575f80fd5b506107b46107af366004613f2c565b611aff565b6040516102bf9190614104565b3480156107cc575f80fd5b506103286107db366004613abf565b611bf1565b6103286107ee366004614164565b611c32565b3480156107fe575f80fd5b5061081261080d366004613a56565b611c69565b6040516102bf91906141c7565b34801561082a575f80fd5b506102dc610839366004613a56565b611cbe565b348015610849575f80fd5b5061035d610858366004613a56565b611d2d565b348015610868575f80fd5b507150726f70734552433732314152495054434760701b61035d565b34801561088f575f80fd5b506102b361089e366004613abf565b611d44565b3480156108ae575f80fd5b506103286108bd366004613b67565b611dfb565b3480156108cd575f80fd5b506102b36108dc366004613abf565b611e57565b3480156108ec575f80fd5b506103286108fb366004613abf565b611ed3565b34801561090b575f80fd5b506102dc611f14565b34801561091f575f80fd5b5061032861092e3660046141d5565b611fa1565b34801561093e575f80fd5b506102b361094d3660046141fd565b611fe8565b34801561095d575f80fd5b5061035d61096c366004614225565b8151602081840181018051610196825292820194820194909420919093529091525f908152604090205481565b3480156109a4575f80fd5b5061019b54610308906001600160a01b031681565b3480156109c4575f80fd5b5061019e54610308906001600160a01b031681565b5f6109e382612023565b806109f257506109f282612057565b80610a015750610a0182612023565b92915050565b6060610a116120a4565b6002018054610a1f90614266565b80601f0160208091040260200160405190810160405280929190818152602001828054610a4b90614266565b8015610a965780601f10610a6d57610100808354040283529160200191610a96565b820191905f5260205f20905b815481529060010190602001808311610a7957829003601f168201915b5050505050905090565b5f610aaa826120c8565b610ac7576040516333d1c03960e21b815260040160405180910390fd5b610acf6120a4565b5f9283526006016020525060409020546001600160a01b031690565b610af482611d44565b610b195760405162461bcd60e51b8152600401610b109061429e565b60405180910390fd5b610b23828261210f565b5050565b610b305f61211b565b610b38575f80fd5b610b425f826118e4565b610b775760405162461bcd60e51b815260206004820152600660248201526510a0b236b4b760d11b6044820152606401610b10565b61019980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76905f90a35050565b5f6001610bd46120a4565b60010154610be06120a4565b540303919050565b610bf0612152565b5f805f5b610bfe84806142cc565b9050811015610d40575f610c1285806142cc565b83818110610c2257610c22614311565b9050602002810190610c349190614325565b610c3d90614343565b9050610c50610c4a6121ab565b826121b4565b610cfb610c5d86806142cc565b84818110610c6d57610c6d614311565b9050602002810190610c7f9190614325565b610c8990806143dd565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250610cc692506121ab915050565b610cd088806142cc565b86818110610ce057610ce0614311565b9050602002810190610cf29190614325565b6020013561235e565b6020810151610d0a9084614433565b925080602001518160400151610d209190614446565b610d2a9085614433565b9350508080610d389061445d565b915050610bf4565b506101955460018261019354610d569190614433565b610d609190614475565b1115610d9b5760405162461bcd60e51b815260206004820152600a6024820152694d617820537570706c7960b01b6044820152606401610b10565b34821115610dbc5760405163356680b760e01b815260040160405180910390fd5b61019c546040515f9182916001600160a01b039091169034908381818185875af1925050503d805f8114610e0b576040519150601f19603f3d011682016040523d82523d5f602084013e610e10565b606091505b5060408051602081019091525f815261019354929450909250905b846101935401811015610e6d5781610e42826123f9565b604051602001610e53929190614488565b60408051601f198184030181529190529150600101610e2b565b50836101945f610e7b6121ab565b6001600160a01b0316815260208101919091526040015f2080549091019055610193805485019055610eb4610eae6121ab565b85612488565b610ebc6121ab565b6001600160a01b03167f0c1b180fbb60448c5491c5ddc7c3a923854214b9ff70f90a7821333338971f9282604051610ef49190613a44565b60405180910390a25050505050610f0a60018055565b50565b610f1683611d44565b610f325760405162461bcd60e51b8152600401610b109061429e565b610f3d8383836124a7565b505050565b5f90815261012d602052604090206001015490565b5f828152610192602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610fcd575060408051808201909152610191546001600160a01b0381168252600160a01b90046001600160601b031660208201525b60208101515f9061271090610feb906001600160601b031687614446565b610ff591906144c2565b91519350909150505b9250929050565b61101b5f8051602061497183398151915261211b565b611023575f80fd5b61102d82826118e4565b610b2357610b238282612691565b6110436126b3565b54610100900460ff16611062576110586126b3565b5460ff1615611066565b303b155b6110bf5760405162461bcd60e51b815260206004820152603760248201525f805160206148ca833981519152604482015276081a5cc8185b1c9958591e481a5b9a5d1a585b1a5e9959604a1b6064820152608401610b10565b5f6110c86126b3565b54610100900460ff1615905080156111145760016110e46126b3565b80549115156101000261ff001990921691909117905560016111046126b3565b805460ff19169115159190911790555b5f54610100900460ff161580801561113257505f54600160ff909116105b806111525750611141306126d7565b15801561115257505f5460ff166001145b6111b55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610b10565b5f805460ff1916600117905580156111d6575f805461ff0019166101001790555b6101a054600160a01b900460ff16156112485760405162461bcd60e51b815260206004820152602e60248201527f436f6e747261637420696e7374616e63652068617320616c726561647920626560448201526d195b881a5b9a5d1a585b1a5e995960921b6064820152608401610b10565b6101a0805460ff60a01b1916600160a01b1790556112646126e6565b61126d8a612716565b6112778d8d61274d565b8761019c5f6101000a8154816001600160a01b0302191690836001600160a01b031602179055508661019d5f6101000a8154816001600160a01b0302191690836001600160a01b031602179055508d6101995f6101000a8154816001600160a01b0302191690836001600160a01b031602179055508361019a5f6101000a8154816001600160a01b0302191690836001600160a01b031602179055508861019e5f6101000a8154816001600160a01b0302191690836001600160a01b031602179055508a610197908161134a919061453a565b506101958590556101a080546001600160a01b0319166001600160a01b038581169190911790915561019d54611381911687612784565b61138b5f8f61287e565b6113a25f805160206149718339815191525f612888565b6113c65f805160206148ea8339815191525f80516020614971833981519152612888565b6113ea5f805160206149318339815191525f805160206148ea833981519152612888565b6001610193558015611435575f805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50801561145c575f6114456126b3565b80549115156101000261ff00199092169190911790555b50505050505050505050505050565b6114736121ab565b6001600160a01b0316816001600160a01b0316146114eb5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610b10565b610b2382826128da565b6114fe83611d44565b61151a5760405162461bcd60e51b8152600401610b109061429e565b610f3d8383836128fc565b610f0a816001612916565b6115465f8051602061497183398151915261211b565b61154e575f80fd5b61019761155c8486836145f0565b5060408051838152602081018390527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c910160405180910390a150505050565b6001600160a01b03165f9081526097602052604090205460ff1690565b6115cf5f8051602061493183398151915261211b565b6115d7575f80fd5b80156115e557610f0a612a81565b610f0a612ad6565b6116035f8051602061497183398151915261211b565b61160b575f80fd5b6101a080546001600160a01b0319166001600160a01b0392909216919091179055565b6060815f816001600160401b0381111561164a5761164a613b91565b60405190808252806020026020018201604052801561168357816020015b6116706139a1565b8152602001906001900390816116685790505b5090505f5b8281146116d5576116b08686838181106116a4576116a4614311565b90506020020135611c69565b8282815181106116c2576116c2614311565b6020908102919091010152600101611688565b50949350505050565b5f610a0182612b11565b6116fe5f805160206148ea83398151915261211b565b611706575f80fd5b61019555565b5f6001600160a01b038216611734576040516323d3ad8160e21b815260040160405180910390fd5b6001600160401b036117446120a4565b6005015f846001600160a01b03166001600160a01b031681526020019081526020015f2054169050919050565b60605f805f61177f8561170c565b90505f816001600160401b0381111561179a5761179a613b91565b6040519080825280602002602001820160405280156117c3578160200160208202803683370190505b5090506117ce6139a1565b60015b838614611848576117e181612bb9565b915081604001516118405781516001600160a01b03161561180157815194505b876001600160a01b0316856001600160a01b031603611840578083878060010198508151811061183357611833614311565b6020026020010181815250505b6001016117d1565b50909695505050505050565b610199545f9061186e9082906001600160a01b03166118e4565b61187757505f90565b610199546001600160a01b03165b905090565b5f610196848460405161189e9291906146a5565b90815260408051602092819003830190206001600160a01b0385165f908152925290205490505b9392505050565b5f82815261015f602052604081206118c59083612be3565b5f91825261012d602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6119255f8051602061497183398151915261211b565b61192d575f80fd5b610198610f3d8284836145f0565b60606119456120a4565b6003018054610a1f90614266565b606081831061197557604051631960ccad60e11b815260040160405180910390fd5b5f8061197f612bee565b9050600185101561198f57600194505b8084111561199b578093505b5f6119a58761170c565b9050848610156119c457858503818110156119be578091505b506119c7565b505f5b5f816001600160401b038111156119e0576119e0613b91565b604051908082528060200260200182016040528015611a09578160200160208202803683370190505b509050815f03611a1e5793506118c592505050565b5f611a2888611c69565b90505f8160400151611a38575080515b885b888114158015611a4a5750848714155b15611abf57611a5881612bb9565b92508260400151611ab75782516001600160a01b031615611a7857825191505b8a6001600160a01b0316826001600160a01b031603611ab75780848880600101995081518110611aaa57611aaa614311565b6020026020010181815250505b600101611a3a565b505050928352509095945050505050565b611ad982611d44565b611af55760405162461bcd60e51b8152600401610b109061429e565b610b238282612bfd565b6060816001600160401b03811115611b1957611b19613b91565b604051908082528060200260200182016040528015611b4c57816020015b6060815260200190600190039081611b375790505b5090505f5b82811015611bea57611bba30858584818110611b6f57611b6f614311565b9050602002810190611b8191906143dd565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250612c7992505050565b828281518110611bcc57611bcc614311565b60200260200101819052508080611be29061445d565b915050611b51565b5092915050565b611c075f805160206148ea83398151915261211b565b611c0f575f80fd5b61019c80546001600160a01b0319166001600160a01b0392909216919091179055565b611c3b84611d44565b611c575760405162461bcd60e51b8152600401610b109061429e565b611c6384848484612c9e565b50505050565b611c716139a1565b611c796139a1565b6001831080611c8f5750611c8b612bee565b8310155b15611c9a5792915050565b611ca383612bb9565b9050806040015115611cb55792915050565b6118c583612ce2565b6060611cc9826120c8565b611cfa5760405162461bcd60e51b8152602060048201526002602482015261085d60f21b6044820152606401610b10565b610197611d06836123f9565b604051602001611d179291906146b4565b6040516020818303038152906040529050919050565b5f81815261015f60205260408120610a0190612cfb565b5f6daaeb6d7670e522a718067333cd4e3b15611df357604051633185c44d60e21b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611db0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611dd49190614747565b611df35781604051633b79c77360e21b8152600401610b109190613a6d565b506001919050565b611e115f8051602061497183398151915261211b565b611e19575f80fd5b611e2382826118e4565b15610b235781158015611e4e5750611e39611854565b6001600160a01b0316816001600160a01b0316145b156114eb575f80fd5b6101a05460405163df592f7d60e01b81525f916001600160a01b0316908290829063df592f7d90611e8c908790600401613a6d565b602060405180830381865afa158015611ea7573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611ecb9190614747565b949350505050565b611ee95f8051602061497183398151915261211b565b611ef1575f80fd5b61019e80546001600160a01b0319166001600160a01b0392909216919091179055565b6101988054611f2290614266565b80601f0160208091040260200160405190810160405280929190818152602001828054611f4e90614266565b8015611f995780601f10611f7057610100808354040283529160200191611f99565b820191905f5260205f20905b815481529060010190602001808311611f7c57829003601f168201915b505050505081565b611fb75f805160206148ea83398151915261211b565b611fbf575f80fd5b61019d80546001600160a01b0319166001600160a01b038416908117909155610b239082612784565b5f611ff16120a4565b6001600160a01b039384165f908152600791909101602090815260408083209490951682529290925250205460ff1690565b5f6001600160e01b0319821663152a902d60e11b1480610a0157506301ffc9a760e01b6001600160e01b0319831614610a01565b5f6301ffc9a760e01b6001600160e01b03198316148061208757506380ac58cd60e01b6001600160e01b03198316145b80610a015750506001600160e01b031916635b5e139f60e01b1490565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b5f816001111580156120e157506120dd6120a4565b5482105b8015610a015750600160e01b6120f56120a4565b5f8481526004919091016020526040902054161592915050565b610b2382826001612d04565b5f612128826106f16121ab565b1561213557506001919050565b8161214157505f919050565b610a0161214d83610f42565b61211b565b6002600154036121a45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b10565b6002600155565b5f611885612db7565b42816080015110156121d95760405163df4cc36d60e01b815260040160405180910390fd5b606081015160208201518251604051610196916121f591614762565b90815260408051602092819003830190206001600160a01b0387165f90815292529020546122239190614433565b111561224257604051631f43edc360e11b815260040160405180910390fd5b60a0810151602082015182516040516101969161225e91614762565b90815260408051602092819003830190205f80805292529020546122829190614433565b11156122a05760405162ce103d60e71b815260040160405180910390fd5b5f61232c61232284845f015185602001518660400151876060015188608001518960a001516040516020016122db9796959493929190614773565b604051602081830303815290604052805190602001207b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b5f908152601c91909152603c902090565b8360c00151612dd8565b61019e549091506001600160a01b03808316911614610f3d57604051638baa579f60e01b815260040160405180910390fd5b80610196846040516123709190614762565b90815260200160405180910390205f846001600160a01b03166001600160a01b031681526020019081526020015f205f8282546123ad9190614433565b9250508190555080610196846040516123c69190614762565b90815260408051602092819003830190205f8080529252812080549091906123ef908490614433565b9091555050505050565b60605f61240583612dfa565b60010190505f816001600160401b0381111561242357612423613b91565b6040519080825280601f01601f19166020018201604052801561244d576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461245757509392505050565b610b23828260405180602001604052805f815250612ecf565b60018055565b5f6124b182612b11565b9050836001600160a01b0316816001600160a01b0316146124e45760405162a1148160e81b815260040160405180910390fd5b5f806124ef84612f49565b9150915061251481876124ff3390565b6001600160a01b039081169116811491141790565b61253f576125228633611fe8565b61253f57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03851661256657604051633a954ecd60e21b815260040160405180910390fd5b6125738686866001612f6e565b801561257d575f82555b6125856120a4565b6001600160a01b0387165f9081526005919091016020526040902080545f190190556125af6120a4565b6001600160a01b0386165f90815260059190910160205260409020805460010190556125df85600160e11b612fa4565b6125e76120a4565b5f8681526004919091016020526040812091909155600160e11b8416900361265a57600184016126156120a4565b5f82815260049190910160205260408120549003612658576126356120a4565b54811461265857836126456120a4565b5f83815260049190910160205260409020555b505b83856001600160a01b0316876001600160a01b03165f8051602061495183398151915260405160405180910390a45b505050505050565b61269b8282612fb9565b5f82815261015f60205260409020610f3d9082613040565b7fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f90565b6001600160a01b03163b151590565b5f54610100900460ff1661270c5760405162461bcd60e51b8152600401610b10906147c8565b612714613054565b565b5f54610100900460ff1661273c5760405162461bcd60e51b8152600401610b10906147c8565b61274461307a565b610f0a816130a0565b6127556126b3565b54610100900460ff1661277a5760405162461bcd60e51b8152600401610b1090614813565b610b23828261312b565b6127106001600160601b03821611156127f25760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610b10565b6001600160a01b0382166128445760405162461bcd60e51b815260206004820152601960248201527822a921991c9c189d1034b73b30b634b2103932b1b2b4bb32b960391b6044820152606401610b10565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b9091021761019155565b610b238282612691565b5f61289283610f42565b5f84815261012d6020526040808220600101859055519192508391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6128e48282613197565b5f82815261015f60205260409020610f3d908261321c565b610f3d83838360405180602001604052805f815250611c32565b5f61292083612b11565b9050805f8061292e86612f49565b91509150841561296e576129438184336124ff565b61296e576129518333611fe8565b61296e57604051632ce44b5f60e11b815260040160405180910390fd5b61297b835f886001612f6e565b8015612985575f82555b6001600160801b036129956120a4565b6001600160a01b0385165f9081526005919091016020526040902080549190910190556129c683600360e01b612fa4565b6129ce6120a4565b5f8881526004919091016020526040812091909155600160e11b85169003612a4157600186016129fc6120a4565b5f82815260049190910160205260408120549003612a3f57612a1c6120a4565b548114612a3f5784612a2c6120a4565b5f83815260049190910160205260409020555b505b60405186905f906001600160a01b038616905f80516020614951833981519152908390a4612a6d6120a4565b600190810180549091019055505050505050565b612a89613230565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612abf6121ab565b604051612acc9190613a6d565b60405180910390a1565b612ade613276565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612abf6121ab565b5f81600111612ba057612b226120a4565b5f83815260049190910160205260408120549150600160e01b82169003612ba057805f03612b9b57612b526120a4565b548210612b7257604051636f96cda160e11b815260040160405180910390fd5b612b7a6120a4565b5f199092015f81815260049390930160205260409092205490508015612b72575b919050565b604051636f96cda160e11b815260040160405180910390fd5b612bc16139a1565b610a01612bcc6120a4565b5f84815260049190910160205260409020546132bf565b5f6118c58383613302565b5f612bf76120a4565b54919050565b80612c066120a4565b335f818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b60606118c5838360405180606001604052806027815260200161490a60279139613328565b612ca9848484610f0d565b6001600160a01b0383163b15611c6357612cc58484848461339c565b611c63576040516368d2bf6b60e11b815260040160405180910390fd5b612cea6139a1565b610a01612cf683612b11565b6132bf565b5f610a01825490565b5f612d0e836116de565b90508115612d4d57336001600160a01b03821614612d4d57612d308133611fe8565b612d4d576040516367d9dca160e11b815260040160405180910390fd5b83612d566120a4565b5f858152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551859287811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a450505050565b5f612dc13361159c565b15612dd3575060131936013560601c90565b503390565b5f805f612de58585613483565b91509150612df2816134c2565b509392505050565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612e385772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b8310612e62576904ee2d6d415b85acef8160201b830492506020015b662386f26fc100008310612e8057662386f26fc10000830492506010015b6305f5e1008310612e98576305f5e100830492506008015b6127108310612eac57612710830492506004015b60648310612ebe576064830492506002015b600a8310610a015760010192915050565b612ed98383613606565b6001600160a01b0383163b15610f3d575f612ef26120a4565b5490508281035b612f0b5f86838060010194508661339c565b612f28576040516368d2bf6b60e11b815260040160405180910390fd5b818110612ef95781612f386120a4565b5414612f42575f80fd5b5050505050565b5f805f612f546120a4565b5f9485526006016020525050604090912080549092909150565b612f7784611e57565b80612f865750612f8683611e57565b15611c63576040516320cf996960e11b815260040160405180910390fd5b4260a01b176001600160a01b03919091161790565b612fc382826118e4565b610b23575f82815261012d602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612ffc6121ab565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b5f6118c5836001600160a01b03841661371f565b5f54610100900460ff166124a15760405162461bcd60e51b8152600401610b10906147c8565b5f54610100900460ff166127145760405162461bcd60e51b8152600401610b10906147c8565b5f54610100900460ff166130c65760405162461bcd60e51b8152600401610b10906147c8565b5f5b8151811015610b2357600160975f8484815181106130e8576130e8614311565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff1916911515919091179055806131238161445d565b9150506130c8565b6131336126b3565b54610100900460ff166131585760405162461bcd60e51b8152600401610b1090614813565b816131616120a4565b6002019061316f908261453a565b50806131796120a4565b60030190613187908261453a565b5060016131926120a4565b555050565b6131a182826118e4565b15610b23575f82815261012d602090815260408083206001600160a01b03851684529091529020805460ff191690556131d86121ab565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b5f6118c5836001600160a01b03841661376b565b60655460ff16156127145760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610b10565b60655460ff166127145760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b10565b6132c76139a1565b6001600160a01b03821681526001600160401b0360a083901c166020820152600160e01b82161515604082015260e89190911c606082015290565b5f825f01828154811061331757613317614311565b905f5260205f200154905092915050565b60605f80856001600160a01b0316856040516133449190614762565b5f60405180830381855af49150503d805f811461337c576040519150601f19603f3d011682016040523d82523d5f602084013e613381565b606091505b50915091506133928683838761384e565b9695505050505050565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a02906133d0903390899088908890600401614854565b6020604051808303815f875af192505050801561340a575060408051601f3d908101601f1916820190925261340791810190614886565b60015b613466573d808015613437576040519150601f19603f3d011682016040523d82523d5f602084013e61343c565b606091505b5080515f0361345e576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b5f8082516041036134b7576020830151604084015160608501515f1a6134ab878285856138c4565b94509450505050610ffe565b505f90506002610ffe565b5f8160048111156134d5576134d56148a1565b036134dd5750565b60018160048111156134f1576134f16148a1565b036135395760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606401610b10565b600281600481111561354d5761354d6148a1565b0361359a5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b10565b60038160048111156135ae576135ae6148a1565b03610f0a5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610b10565b5f61360f6120a4565b5490505f8290036136335760405163b562e8dd60e01b815260040160405180910390fd5b61363f5f848385612f6e565b6001600160401b0182026136516120a4565b6001600160a01b0385165f908152600591909101602052604090208054919091019055613684836001841460e11b612fa4565b61368c6120a4565b5f83815260049190910160205260408120919091556001600160a01b0384169083830190839083905f805160206149518339815191528180a4600183015b8181146136ed5780835f5f805160206149518339815191525f80a46001016136ca565b50815f0361370d57604051622e076360e81b815260040160405180910390fd5b806137166120a4565b5550610f3d9050565b5f81815260018301602052604081205461376457508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610a01565b505f610a01565b5f8181526001830160205260408120548015613845575f61378d600183614475565b85549091505f906137a090600190614475565b90508181146137ff575f865f0182815481106137be576137be614311565b905f5260205f200154905080875f0184815481106137de576137de614311565b5f918252602080832090910192909255918252600188019052604090208390555b8554869080613810576138106148b5565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050610a01565b5f915050610a01565b606083156138ba5782515f036138b357613867856126d7565b6138b35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b10565b5081611ecb565b611ecb8383613977565b5f806fa2a8918ca85bafe22016d0b997e4df60600160ff1b038311156138ef57505f9050600361396e565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613940573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b038116613968575f6001925092505061396e565b91505f90505b94509492505050565b8151156139875781518083602001fd5b8060405162461bcd60e51b8152600401610b109190613a44565b604080516080810182525f80825260208201819052918101829052606081019190915290565b6001600160e01b031981168114610f0a575f80fd5b5f602082840312156139ec575f80fd5b81356118c5816139c7565b5f5b83811015613a115781810151838201526020016139f9565b50505f910152565b5f8151808452613a308160208601602086016139f7565b601f01601f19169290920160200192915050565b602081525f6118c56020830184613a19565b5f60208284031215613a66575f80fd5b5035919050565b6001600160a01b0391909116815260200190565b80356001600160a01b0381168114612b9b575f80fd5b5f8060408385031215613aa8575f80fd5b613ab183613a81565b946020939093013593505050565b5f60208284031215613acf575f80fd5b6118c582613a81565b5f60208284031215613ae8575f80fd5b81356001600160401b03811115613afd575f80fd5b8201602081850312156118c5575f80fd5b5f805f60608486031215613b20575f80fd5b613b2984613a81565b9250613b3760208501613a81565b9150604084013590509250925092565b5f8060408385031215613b58575f80fd5b50508035926020909101359150565b5f8060408385031215613b78575f80fd5b82359150613b8860208401613a81565b90509250929050565b634e487b7160e01b5f52604160045260245ffd5b60405160e081016001600160401b0381118282101715613bc757613bc7613b91565b60405290565b604051601f8201601f191681016001600160401b0381118282101715613bf557613bf5613b91565b604052919050565b5f82601f830112613c0c575f80fd5b81356001600160401b03811115613c2557613c25613b91565b613c38601f8201601f1916602001613bcd565b818152846020838601011115613c4c575f80fd5b816020850160208301375f918101602001919091529392505050565b5f82601f830112613c77575f80fd5b813560206001600160401b03821115613c9257613c92613b91565b8160051b613ca1828201613bcd565b9283528481018201928281019087851115613cba575f80fd5b83870192505b84831015613ce057613cd183613a81565b82529183019190830190613cc0565b979650505050505050565b80356001600160601b0381168114612b9b575f80fd5b5f805f805f805f805f805f806101808d8f031215613d1d575f80fd5b613d268d613a81565b9b506001600160401b0360208e01351115613d3f575f80fd5b613d4f8e60208f01358f01613bfd565b9a506001600160401b0360408e01351115613d68575f80fd5b613d788e60408f01358f01613bfd565b99506001600160401b0360608e01351115613d91575f80fd5b613da18e60608f01358f01613bfd565b98506001600160401b0360808e01351115613dba575f80fd5b613dca8e60808f01358f01613c68565b9750613dd860a08e01613a81565b9650613de660c08e01613a81565b9550613df460e08e01613a81565b9450613e036101008e01613ceb565b93506101208d01359250613e1a6101408e01613a81565b9150613e296101608e01613a81565b90509295989b509295989b509295989b565b5f8083601f840112613e4b575f80fd5b5081356001600160401b03811115613e61575f80fd5b602083019150836020828501011115610ffe575f80fd5b5f805f8060608587031215613e8b575f80fd5b84356001600160401b03811115613ea0575f80fd5b613eac87828801613e3b565b90989097506020870135966040013595509350505050565b8015158114610f0a575f80fd5b5f60208284031215613ee1575f80fd5b81356118c581613ec4565b5f8083601f840112613efc575f80fd5b5081356001600160401b03811115613f12575f80fd5b6020830191508360208260051b8501011115610ffe575f80fd5b5f8060208385031215613f3d575f80fd5b82356001600160401b03811115613f52575f80fd5b613f5e85828601613eec565b90969095509350505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b602080825282518282018190525f9190848201906040850190845b8181101561184857613fd4838551613f6a565b9284019260809290920191600101613fc1565b602080825282518282018190525f9190848201906040850190845b8181101561184857835183529284019291840191600101614002565b5f805f60408486031215614030575f80fd5b83356001600160401b03811115614045575f80fd5b61405186828701613e3b565b9094509250614064905060208501613a81565b90509250925092565b5f806020838503121561407e575f80fd5b82356001600160401b03811115614093575f80fd5b613f5e85828601613e3b565b5f805f606084860312156140b1575f80fd5b6140ba84613a81565b95602085013595506040909401359392505050565b5f80604083850312156140e0575f80fd5b6140e983613a81565b915060208301356140f981613ec4565b809150509250929050565b5f602080830181845280855180835260408601915060408160051b87010192508387015f5b8281101561415757603f19888603018452614145858351613a19565b94509285019290850190600101614129565b5092979650505050505050565b5f805f8060808587031215614177575f80fd5b61418085613a81565b935061418e60208601613a81565b92506040850135915060608501356001600160401b038111156141af575f80fd5b6141bb87828801613bfd565b91505092959194509250565b60808101610a018284613f6a565b5f80604083850312156141e6575f80fd5b6141ef83613a81565b9150613b8860208401613ceb565b5f806040838503121561420e575f80fd5b61421783613a81565b9150613b8860208401613a81565b5f8060408385031215614236575f80fd5b82356001600160401b0381111561424b575f80fd5b61425785828601613bfd565b925050613b8860208401613a81565b600181811c9082168061427a57607f821691505b60208210810361429857634e487b7160e01b5f52602260045260245ffd5b50919050565b60208082526014908201527313dc195c985d1bdc881b9bdd08185b1b1bddd95960621b604082015260600190565b5f808335601e198436030181126142e1575f80fd5b8301803591506001600160401b038211156142fa575f80fd5b6020019150600581901b3603821315610ffe575f80fd5b634e487b7160e01b5f52603260045260245ffd5b5f823560de19833603018112614339575f80fd5b9190910192915050565b5f60e08236031215614353575f80fd5b61435b613ba5565b82356001600160401b0380821115614371575f80fd5b61437d36838701613bfd565b83526020850135602084015260408501356040840152606085013560608401526080850135608084015260a085013560a084015260c08501359150808211156143c4575f80fd5b506143d136828601613bfd565b60c08301525092915050565b5f808335601e198436030181126143f2575f80fd5b8301803591506001600160401b0382111561440b575f80fd5b602001915036819003821315610ffe575f80fd5b634e487b7160e01b5f52601160045260245ffd5b80820180821115610a0157610a0161441f565b8082028115828204841417610a0157610a0161441f565b5f6001820161446e5761446e61441f565b5060010190565b81810381811115610a0157610a0161441f565b5f83516144998184602088016139f7565b8351908301906144ad8183602088016139f7565b600b60fa1b9101908152600101949350505050565b5f826144dc57634e487b7160e01b5f52601260045260245ffd5b500490565b601f821115610f3d575f81815260208120601f850160051c810160208610156145075750805b601f850160051c820191505b8181101561268957828155600101614513565b5f19600383901b1c191660019190911b1790565b81516001600160401b0381111561455357614553613b91565b614567816145618454614266565b846144e1565b602080601f831160018114614595575f84156145835750858301515b61458d8582614526565b865550612689565b5f85815260208120601f198616915b828110156145c3578886015182559484019460019091019084016145a4565b50858210156145e057878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160401b0383111561460757614607613b91565b61461b836146158354614266565b836144e1565b5f601f841160018114614647575f85156146355750838201355b61463f8682614526565b845550612f42565b5f83815260209020601f19861690835b828110156146775786850135825560209485019460019092019101614657565b5086821015614693575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b818382375f9101908152919050565b5f8084546146c181614266565b600182811680156146d957600181146146ee5761471a565b60ff198416875282151583028701945061471a565b885f526020805f205f5b858110156147115781548a8201529084019082016146f8565b50505082870194505b50505050835161472e8183602088016139f7565b64173539b7b760d91b9101908152600501949350505050565b5f60208284031215614757575f80fd5b81516118c581613ec4565b5f82516143398184602087016139f7565b606088901b6001600160601b031916815286515f90614799816014850160208c016139f7565b6014920191820196909652603481019490945260548401929092526074830152609482015260b4019392505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526034908201525f805160206148ca833981519152604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f9061339290830184613a19565b5f60208284031215614896575f80fd5b81516118c5816139c7565b634e487b7160e01b5f52602160045260245ffd5b634e487b7160e01b5f52603160045260245ffdfe455243373231415f5f496e697469616c697a61626c653a20636f6e74726163748eb467f061ca67f42a2d2ca4a346fc9fb645efc0ba75056ee9f71c3a0ccc10a8416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65649f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef2ce8d04a9c35987429af538825cd2438cc5c5bb5dc427955f84daaa3ea105016a164736f6c6343000815000a
Deployed Bytecode
0x608060405260043610610290575f3560e01c806301ffc9a71461029457806306fdde03146102c8578063081812fc146102e9578063095ea7b31461031557806313af40351461032a57806318160ddd146103495780631bbea7d61461036b5780631e7269c51461037e57806323b872dd146103aa578063248a9ca3146103bd5780632a55205a146103dc5780632f2ff15d1461041a578063323018341461043957806332cb6b0c1461045857806336568abe1461046e5780633dc3df7d1461048d57806342842e0e146104ad57806342966c68146104c057806348f3afed146104df578063572b6c05146104fe57806357d159c61461051d5780635ace63521461053c5780635bbb21771461055b5780635c975abb146105875780636131bc4a1461059e5780636352211e146105bc5780636f8b44b0146105db57806370a08231146105fa578063738170a4146106195780638462151c146106395780638da5cb5b146106655780638ead7b3d146106795780638ff992ae146106995780639010d07c146106b857806391d14854146106d7578063938e3d7b146106f657806395d89b411461071557806399a2557a14610729578063a0a8e46014610748578063a217fddf14610763578063a22cb46514610776578063ac9650d814610795578063b522ecff146107c1578063b88d4fde146107e0578063c23dc68f146107f3578063c87b56dd1461081f578063ca15c8731461083e578063cb2ef6f71461085d578063d05a381a14610884578063d547741f146108a3578063df592f7d146108c2578063e08a6605146108e1578063e8a3d48514610900578063e8f984fa14610914578063e985e9c514610933578063ea140bea14610952578063f60ca60d14610999578063fde919f6146109b9575b5f80fd5b34801561029f575f80fd5b506102b36102ae3660046139dc565b6109d9565b60405190151581526020015b60405180910390f35b3480156102d3575f80fd5b506102dc610a07565b6040516102bf9190613a44565b3480156102f4575f80fd5b50610308610303366004613a56565b610aa0565b6040516102bf9190613a6d565b610328610323366004613a97565b610aeb565b005b348015610335575f80fd5b50610328610344366004613abf565b610b27565b348015610354575f80fd5b5061035d610bc9565b6040519081526020016102bf565b610328610379366004613ad8565b610be8565b348015610389575f80fd5b5061035d610398366004613abf565b6101946020525f908152604090205481565b6103286103b8366004613b0e565b610f0d565b3480156103c8575f80fd5b5061035d6103d7366004613a56565b610f42565b3480156103e7575f80fd5b506103fb6103f6366004613b47565b610f57565b604080516001600160a01b0390931683526020830191909152016102bf565b348015610425575f80fd5b50610328610434366004613b67565b611005565b348015610444575f80fd5b50610328610453366004613d01565b61103b565b348015610463575f80fd5b5061035d6101955481565b348015610479575f80fd5b50610328610488366004613b67565b61146b565b348015610498575f80fd5b5061019d54610308906001600160a01b031681565b6103286104bb366004613b0e565b6114f5565b3480156104cb575f80fd5b506103286104da366004613a56565b611525565b3480156104ea575f80fd5b506103286104f9366004613e78565b611530565b348015610509575f80fd5b506102b3610518366004613abf565b61159c565b348015610528575f80fd5b50610328610537366004613ed1565b6115b9565b348015610547575f80fd5b50610328610556366004613abf565b6115ed565b348015610566575f80fd5b5061057a610575366004613f2c565b61162e565b6040516102bf9190613fa6565b348015610592575f80fd5b5060655460ff166102b3565b3480156105a9575f80fd5b5061019c546001600160a01b0316610308565b3480156105c7575f80fd5b506103086105d6366004613a56565b6116de565b3480156105e6575f80fd5b506103286105f5366004613a56565b6116e8565b348015610605575f80fd5b5061035d610614366004613abf565b61170c565b348015610624575f80fd5b5061019c54610308906001600160a01b031681565b348015610644575f80fd5b50610658610653366004613abf565b611771565b6040516102bf9190613fe7565b348015610670575f80fd5b50610308611854565b348015610684575f80fd5b506101a054610308906001600160a01b031681565b3480156106a4575f80fd5b5061035d6106b336600461401e565b61188a565b3480156106c3575f80fd5b506103086106d2366004613b47565b6118cc565b3480156106e2575f80fd5b506102b36106f1366004613b67565b6118e4565b348015610701575f80fd5b5061032861071036600461406d565b61190f565b348015610720575f80fd5b506102dc61193b565b348015610734575f80fd5b5061065861074336600461409f565b611953565b348015610753575f80fd5b50604051600181526020016102bf565b34801561076e575f80fd5b5061035d5f81565b348015610781575f80fd5b506103286107903660046140cf565b611ad0565b3480156107a0575f80fd5b506107b46107af366004613f2c565b611aff565b6040516102bf9190614104565b3480156107cc575f80fd5b506103286107db366004613abf565b611bf1565b6103286107ee366004614164565b611c32565b3480156107fe575f80fd5b5061081261080d366004613a56565b611c69565b6040516102bf91906141c7565b34801561082a575f80fd5b506102dc610839366004613a56565b611cbe565b348015610849575f80fd5b5061035d610858366004613a56565b611d2d565b348015610868575f80fd5b507150726f70734552433732314152495054434760701b61035d565b34801561088f575f80fd5b506102b361089e366004613abf565b611d44565b3480156108ae575f80fd5b506103286108bd366004613b67565b611dfb565b3480156108cd575f80fd5b506102b36108dc366004613abf565b611e57565b3480156108ec575f80fd5b506103286108fb366004613abf565b611ed3565b34801561090b575f80fd5b506102dc611f14565b34801561091f575f80fd5b5061032861092e3660046141d5565b611fa1565b34801561093e575f80fd5b506102b361094d3660046141fd565b611fe8565b34801561095d575f80fd5b5061035d61096c366004614225565b8151602081840181018051610196825292820194820194909420919093529091525f908152604090205481565b3480156109a4575f80fd5b5061019b54610308906001600160a01b031681565b3480156109c4575f80fd5b5061019e54610308906001600160a01b031681565b5f6109e382612023565b806109f257506109f282612057565b80610a015750610a0182612023565b92915050565b6060610a116120a4565b6002018054610a1f90614266565b80601f0160208091040260200160405190810160405280929190818152602001828054610a4b90614266565b8015610a965780601f10610a6d57610100808354040283529160200191610a96565b820191905f5260205f20905b815481529060010190602001808311610a7957829003601f168201915b5050505050905090565b5f610aaa826120c8565b610ac7576040516333d1c03960e21b815260040160405180910390fd5b610acf6120a4565b5f9283526006016020525060409020546001600160a01b031690565b610af482611d44565b610b195760405162461bcd60e51b8152600401610b109061429e565b60405180910390fd5b610b23828261210f565b5050565b610b305f61211b565b610b38575f80fd5b610b425f826118e4565b610b775760405162461bcd60e51b815260206004820152600660248201526510a0b236b4b760d11b6044820152606401610b10565b61019980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d76905f90a35050565b5f6001610bd46120a4565b60010154610be06120a4565b540303919050565b610bf0612152565b5f805f5b610bfe84806142cc565b9050811015610d40575f610c1285806142cc565b83818110610c2257610c22614311565b9050602002810190610c349190614325565b610c3d90614343565b9050610c50610c4a6121ab565b826121b4565b610cfb610c5d86806142cc565b84818110610c6d57610c6d614311565b9050602002810190610c7f9190614325565b610c8990806143dd565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250610cc692506121ab915050565b610cd088806142cc565b86818110610ce057610ce0614311565b9050602002810190610cf29190614325565b6020013561235e565b6020810151610d0a9084614433565b925080602001518160400151610d209190614446565b610d2a9085614433565b9350508080610d389061445d565b915050610bf4565b506101955460018261019354610d569190614433565b610d609190614475565b1115610d9b5760405162461bcd60e51b815260206004820152600a6024820152694d617820537570706c7960b01b6044820152606401610b10565b34821115610dbc5760405163356680b760e01b815260040160405180910390fd5b61019c546040515f9182916001600160a01b039091169034908381818185875af1925050503d805f8114610e0b576040519150601f19603f3d011682016040523d82523d5f602084013e610e10565b606091505b5060408051602081019091525f815261019354929450909250905b846101935401811015610e6d5781610e42826123f9565b604051602001610e53929190614488565b60408051601f198184030181529190529150600101610e2b565b50836101945f610e7b6121ab565b6001600160a01b0316815260208101919091526040015f2080549091019055610193805485019055610eb4610eae6121ab565b85612488565b610ebc6121ab565b6001600160a01b03167f0c1b180fbb60448c5491c5ddc7c3a923854214b9ff70f90a7821333338971f9282604051610ef49190613a44565b60405180910390a25050505050610f0a60018055565b50565b610f1683611d44565b610f325760405162461bcd60e51b8152600401610b109061429e565b610f3d8383836124a7565b505050565b5f90815261012d602052604090206001015490565b5f828152610192602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610fcd575060408051808201909152610191546001600160a01b0381168252600160a01b90046001600160601b031660208201525b60208101515f9061271090610feb906001600160601b031687614446565b610ff591906144c2565b91519350909150505b9250929050565b61101b5f8051602061497183398151915261211b565b611023575f80fd5b61102d82826118e4565b610b2357610b238282612691565b6110436126b3565b54610100900460ff16611062576110586126b3565b5460ff1615611066565b303b155b6110bf5760405162461bcd60e51b815260206004820152603760248201525f805160206148ca833981519152604482015276081a5cc8185b1c9958591e481a5b9a5d1a585b1a5e9959604a1b6064820152608401610b10565b5f6110c86126b3565b54610100900460ff1615905080156111145760016110e46126b3565b80549115156101000261ff001990921691909117905560016111046126b3565b805460ff19169115159190911790555b5f54610100900460ff161580801561113257505f54600160ff909116105b806111525750611141306126d7565b15801561115257505f5460ff166001145b6111b55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610b10565b5f805460ff1916600117905580156111d6575f805461ff0019166101001790555b6101a054600160a01b900460ff16156112485760405162461bcd60e51b815260206004820152602e60248201527f436f6e747261637420696e7374616e63652068617320616c726561647920626560448201526d195b881a5b9a5d1a585b1a5e995960921b6064820152608401610b10565b6101a0805460ff60a01b1916600160a01b1790556112646126e6565b61126d8a612716565b6112778d8d61274d565b8761019c5f6101000a8154816001600160a01b0302191690836001600160a01b031602179055508661019d5f6101000a8154816001600160a01b0302191690836001600160a01b031602179055508d6101995f6101000a8154816001600160a01b0302191690836001600160a01b031602179055508361019a5f6101000a8154816001600160a01b0302191690836001600160a01b031602179055508861019e5f6101000a8154816001600160a01b0302191690836001600160a01b031602179055508a610197908161134a919061453a565b506101958590556101a080546001600160a01b0319166001600160a01b038581169190911790915561019d54611381911687612784565b61138b5f8f61287e565b6113a25f805160206149718339815191525f612888565b6113c65f805160206148ea8339815191525f80516020614971833981519152612888565b6113ea5f805160206149318339815191525f805160206148ea833981519152612888565b6001610193558015611435575f805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50801561145c575f6114456126b3565b80549115156101000261ff00199092169190911790555b50505050505050505050505050565b6114736121ab565b6001600160a01b0316816001600160a01b0316146114eb5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610b10565b610b2382826128da565b6114fe83611d44565b61151a5760405162461bcd60e51b8152600401610b109061429e565b610f3d8383836128fc565b610f0a816001612916565b6115465f8051602061497183398151915261211b565b61154e575f80fd5b61019761155c8486836145f0565b5060408051838152602081018390527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c910160405180910390a150505050565b6001600160a01b03165f9081526097602052604090205460ff1690565b6115cf5f8051602061493183398151915261211b565b6115d7575f80fd5b80156115e557610f0a612a81565b610f0a612ad6565b6116035f8051602061497183398151915261211b565b61160b575f80fd5b6101a080546001600160a01b0319166001600160a01b0392909216919091179055565b6060815f816001600160401b0381111561164a5761164a613b91565b60405190808252806020026020018201604052801561168357816020015b6116706139a1565b8152602001906001900390816116685790505b5090505f5b8281146116d5576116b08686838181106116a4576116a4614311565b90506020020135611c69565b8282815181106116c2576116c2614311565b6020908102919091010152600101611688565b50949350505050565b5f610a0182612b11565b6116fe5f805160206148ea83398151915261211b565b611706575f80fd5b61019555565b5f6001600160a01b038216611734576040516323d3ad8160e21b815260040160405180910390fd5b6001600160401b036117446120a4565b6005015f846001600160a01b03166001600160a01b031681526020019081526020015f2054169050919050565b60605f805f61177f8561170c565b90505f816001600160401b0381111561179a5761179a613b91565b6040519080825280602002602001820160405280156117c3578160200160208202803683370190505b5090506117ce6139a1565b60015b838614611848576117e181612bb9565b915081604001516118405781516001600160a01b03161561180157815194505b876001600160a01b0316856001600160a01b031603611840578083878060010198508151811061183357611833614311565b6020026020010181815250505b6001016117d1565b50909695505050505050565b610199545f9061186e9082906001600160a01b03166118e4565b61187757505f90565b610199546001600160a01b03165b905090565b5f610196848460405161189e9291906146a5565b90815260408051602092819003830190206001600160a01b0385165f908152925290205490505b9392505050565b5f82815261015f602052604081206118c59083612be3565b5f91825261012d602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6119255f8051602061497183398151915261211b565b61192d575f80fd5b610198610f3d8284836145f0565b60606119456120a4565b6003018054610a1f90614266565b606081831061197557604051631960ccad60e11b815260040160405180910390fd5b5f8061197f612bee565b9050600185101561198f57600194505b8084111561199b578093505b5f6119a58761170c565b9050848610156119c457858503818110156119be578091505b506119c7565b505f5b5f816001600160401b038111156119e0576119e0613b91565b604051908082528060200260200182016040528015611a09578160200160208202803683370190505b509050815f03611a1e5793506118c592505050565b5f611a2888611c69565b90505f8160400151611a38575080515b885b888114158015611a4a5750848714155b15611abf57611a5881612bb9565b92508260400151611ab75782516001600160a01b031615611a7857825191505b8a6001600160a01b0316826001600160a01b031603611ab75780848880600101995081518110611aaa57611aaa614311565b6020026020010181815250505b600101611a3a565b505050928352509095945050505050565b611ad982611d44565b611af55760405162461bcd60e51b8152600401610b109061429e565b610b238282612bfd565b6060816001600160401b03811115611b1957611b19613b91565b604051908082528060200260200182016040528015611b4c57816020015b6060815260200190600190039081611b375790505b5090505f5b82811015611bea57611bba30858584818110611b6f57611b6f614311565b9050602002810190611b8191906143dd565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250612c7992505050565b828281518110611bcc57611bcc614311565b60200260200101819052508080611be29061445d565b915050611b51565b5092915050565b611c075f805160206148ea83398151915261211b565b611c0f575f80fd5b61019c80546001600160a01b0319166001600160a01b0392909216919091179055565b611c3b84611d44565b611c575760405162461bcd60e51b8152600401610b109061429e565b611c6384848484612c9e565b50505050565b611c716139a1565b611c796139a1565b6001831080611c8f5750611c8b612bee565b8310155b15611c9a5792915050565b611ca383612bb9565b9050806040015115611cb55792915050565b6118c583612ce2565b6060611cc9826120c8565b611cfa5760405162461bcd60e51b8152602060048201526002602482015261085d60f21b6044820152606401610b10565b610197611d06836123f9565b604051602001611d179291906146b4565b6040516020818303038152906040529050919050565b5f81815261015f60205260408120610a0190612cfb565b5f6daaeb6d7670e522a718067333cd4e3b15611df357604051633185c44d60e21b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611db0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611dd49190614747565b611df35781604051633b79c77360e21b8152600401610b109190613a6d565b506001919050565b611e115f8051602061497183398151915261211b565b611e19575f80fd5b611e2382826118e4565b15610b235781158015611e4e5750611e39611854565b6001600160a01b0316816001600160a01b0316145b156114eb575f80fd5b6101a05460405163df592f7d60e01b81525f916001600160a01b0316908290829063df592f7d90611e8c908790600401613a6d565b602060405180830381865afa158015611ea7573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611ecb9190614747565b949350505050565b611ee95f8051602061497183398151915261211b565b611ef1575f80fd5b61019e80546001600160a01b0319166001600160a01b0392909216919091179055565b6101988054611f2290614266565b80601f0160208091040260200160405190810160405280929190818152602001828054611f4e90614266565b8015611f995780601f10611f7057610100808354040283529160200191611f99565b820191905f5260205f20905b815481529060010190602001808311611f7c57829003601f168201915b505050505081565b611fb75f805160206148ea83398151915261211b565b611fbf575f80fd5b61019d80546001600160a01b0319166001600160a01b038416908117909155610b239082612784565b5f611ff16120a4565b6001600160a01b039384165f908152600791909101602090815260408083209490951682529290925250205460ff1690565b5f6001600160e01b0319821663152a902d60e11b1480610a0157506301ffc9a760e01b6001600160e01b0319831614610a01565b5f6301ffc9a760e01b6001600160e01b03198316148061208757506380ac58cd60e01b6001600160e01b03198316145b80610a015750506001600160e01b031916635b5e139f60e01b1490565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b5f816001111580156120e157506120dd6120a4565b5482105b8015610a015750600160e01b6120f56120a4565b5f8481526004919091016020526040902054161592915050565b610b2382826001612d04565b5f612128826106f16121ab565b1561213557506001919050565b8161214157505f919050565b610a0161214d83610f42565b61211b565b6002600154036121a45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b10565b6002600155565b5f611885612db7565b42816080015110156121d95760405163df4cc36d60e01b815260040160405180910390fd5b606081015160208201518251604051610196916121f591614762565b90815260408051602092819003830190206001600160a01b0387165f90815292529020546122239190614433565b111561224257604051631f43edc360e11b815260040160405180910390fd5b60a0810151602082015182516040516101969161225e91614762565b90815260408051602092819003830190205f80805292529020546122829190614433565b11156122a05760405162ce103d60e71b815260040160405180910390fd5b5f61232c61232284845f015185602001518660400151876060015188608001518960a001516040516020016122db9796959493929190614773565b604051602081830303815290604052805190602001207b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b5f908152601c91909152603c902090565b8360c00151612dd8565b61019e549091506001600160a01b03808316911614610f3d57604051638baa579f60e01b815260040160405180910390fd5b80610196846040516123709190614762565b90815260200160405180910390205f846001600160a01b03166001600160a01b031681526020019081526020015f205f8282546123ad9190614433565b9250508190555080610196846040516123c69190614762565b90815260408051602092819003830190205f8080529252812080549091906123ef908490614433565b9091555050505050565b60605f61240583612dfa565b60010190505f816001600160401b0381111561242357612423613b91565b6040519080825280601f01601f19166020018201604052801561244d576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461245757509392505050565b610b23828260405180602001604052805f815250612ecf565b60018055565b5f6124b182612b11565b9050836001600160a01b0316816001600160a01b0316146124e45760405162a1148160e81b815260040160405180910390fd5b5f806124ef84612f49565b9150915061251481876124ff3390565b6001600160a01b039081169116811491141790565b61253f576125228633611fe8565b61253f57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03851661256657604051633a954ecd60e21b815260040160405180910390fd5b6125738686866001612f6e565b801561257d575f82555b6125856120a4565b6001600160a01b0387165f9081526005919091016020526040902080545f190190556125af6120a4565b6001600160a01b0386165f90815260059190910160205260409020805460010190556125df85600160e11b612fa4565b6125e76120a4565b5f8681526004919091016020526040812091909155600160e11b8416900361265a57600184016126156120a4565b5f82815260049190910160205260408120549003612658576126356120a4565b54811461265857836126456120a4565b5f83815260049190910160205260409020555b505b83856001600160a01b0316876001600160a01b03165f8051602061495183398151915260405160405180910390a45b505050505050565b61269b8282612fb9565b5f82815261015f60205260409020610f3d9082613040565b7fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f90565b6001600160a01b03163b151590565b5f54610100900460ff1661270c5760405162461bcd60e51b8152600401610b10906147c8565b612714613054565b565b5f54610100900460ff1661273c5760405162461bcd60e51b8152600401610b10906147c8565b61274461307a565b610f0a816130a0565b6127556126b3565b54610100900460ff1661277a5760405162461bcd60e51b8152600401610b1090614813565b610b23828261312b565b6127106001600160601b03821611156127f25760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610b10565b6001600160a01b0382166128445760405162461bcd60e51b815260206004820152601960248201527822a921991c9c189d1034b73b30b634b2103932b1b2b4bb32b960391b6044820152606401610b10565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b9091021761019155565b610b238282612691565b5f61289283610f42565b5f84815261012d6020526040808220600101859055519192508391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6128e48282613197565b5f82815261015f60205260409020610f3d908261321c565b610f3d83838360405180602001604052805f815250611c32565b5f61292083612b11565b9050805f8061292e86612f49565b91509150841561296e576129438184336124ff565b61296e576129518333611fe8565b61296e57604051632ce44b5f60e11b815260040160405180910390fd5b61297b835f886001612f6e565b8015612985575f82555b6001600160801b036129956120a4565b6001600160a01b0385165f9081526005919091016020526040902080549190910190556129c683600360e01b612fa4565b6129ce6120a4565b5f8881526004919091016020526040812091909155600160e11b85169003612a4157600186016129fc6120a4565b5f82815260049190910160205260408120549003612a3f57612a1c6120a4565b548114612a3f5784612a2c6120a4565b5f83815260049190910160205260409020555b505b60405186905f906001600160a01b038616905f80516020614951833981519152908390a4612a6d6120a4565b600190810180549091019055505050505050565b612a89613230565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612abf6121ab565b604051612acc9190613a6d565b60405180910390a1565b612ade613276565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612abf6121ab565b5f81600111612ba057612b226120a4565b5f83815260049190910160205260408120549150600160e01b82169003612ba057805f03612b9b57612b526120a4565b548210612b7257604051636f96cda160e11b815260040160405180910390fd5b612b7a6120a4565b5f199092015f81815260049390930160205260409092205490508015612b72575b919050565b604051636f96cda160e11b815260040160405180910390fd5b612bc16139a1565b610a01612bcc6120a4565b5f84815260049190910160205260409020546132bf565b5f6118c58383613302565b5f612bf76120a4565b54919050565b80612c066120a4565b335f818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b60606118c5838360405180606001604052806027815260200161490a60279139613328565b612ca9848484610f0d565b6001600160a01b0383163b15611c6357612cc58484848461339c565b611c63576040516368d2bf6b60e11b815260040160405180910390fd5b612cea6139a1565b610a01612cf683612b11565b6132bf565b5f610a01825490565b5f612d0e836116de565b90508115612d4d57336001600160a01b03821614612d4d57612d308133611fe8565b612d4d576040516367d9dca160e11b815260040160405180910390fd5b83612d566120a4565b5f858152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551859287811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a450505050565b5f612dc13361159c565b15612dd3575060131936013560601c90565b503390565b5f805f612de58585613483565b91509150612df2816134c2565b509392505050565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612e385772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b8310612e62576904ee2d6d415b85acef8160201b830492506020015b662386f26fc100008310612e8057662386f26fc10000830492506010015b6305f5e1008310612e98576305f5e100830492506008015b6127108310612eac57612710830492506004015b60648310612ebe576064830492506002015b600a8310610a015760010192915050565b612ed98383613606565b6001600160a01b0383163b15610f3d575f612ef26120a4565b5490508281035b612f0b5f86838060010194508661339c565b612f28576040516368d2bf6b60e11b815260040160405180910390fd5b818110612ef95781612f386120a4565b5414612f42575f80fd5b5050505050565b5f805f612f546120a4565b5f9485526006016020525050604090912080549092909150565b612f7784611e57565b80612f865750612f8683611e57565b15611c63576040516320cf996960e11b815260040160405180910390fd5b4260a01b176001600160a01b03919091161790565b612fc382826118e4565b610b23575f82815261012d602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612ffc6121ab565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b5f6118c5836001600160a01b03841661371f565b5f54610100900460ff166124a15760405162461bcd60e51b8152600401610b10906147c8565b5f54610100900460ff166127145760405162461bcd60e51b8152600401610b10906147c8565b5f54610100900460ff166130c65760405162461bcd60e51b8152600401610b10906147c8565b5f5b8151811015610b2357600160975f8484815181106130e8576130e8614311565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff1916911515919091179055806131238161445d565b9150506130c8565b6131336126b3565b54610100900460ff166131585760405162461bcd60e51b8152600401610b1090614813565b816131616120a4565b6002019061316f908261453a565b50806131796120a4565b60030190613187908261453a565b5060016131926120a4565b555050565b6131a182826118e4565b15610b23575f82815261012d602090815260408083206001600160a01b03851684529091529020805460ff191690556131d86121ab565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b5f6118c5836001600160a01b03841661376b565b60655460ff16156127145760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610b10565b60655460ff166127145760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b10565b6132c76139a1565b6001600160a01b03821681526001600160401b0360a083901c166020820152600160e01b82161515604082015260e89190911c606082015290565b5f825f01828154811061331757613317614311565b905f5260205f200154905092915050565b60605f80856001600160a01b0316856040516133449190614762565b5f60405180830381855af49150503d805f811461337c576040519150601f19603f3d011682016040523d82523d5f602084013e613381565b606091505b50915091506133928683838761384e565b9695505050505050565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a02906133d0903390899088908890600401614854565b6020604051808303815f875af192505050801561340a575060408051601f3d908101601f1916820190925261340791810190614886565b60015b613466573d808015613437576040519150601f19603f3d011682016040523d82523d5f602084013e61343c565b606091505b5080515f0361345e576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b5f8082516041036134b7576020830151604084015160608501515f1a6134ab878285856138c4565b94509450505050610ffe565b505f90506002610ffe565b5f8160048111156134d5576134d56148a1565b036134dd5750565b60018160048111156134f1576134f16148a1565b036135395760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606401610b10565b600281600481111561354d5761354d6148a1565b0361359a5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b10565b60038160048111156135ae576135ae6148a1565b03610f0a5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610b10565b5f61360f6120a4565b5490505f8290036136335760405163b562e8dd60e01b815260040160405180910390fd5b61363f5f848385612f6e565b6001600160401b0182026136516120a4565b6001600160a01b0385165f908152600591909101602052604090208054919091019055613684836001841460e11b612fa4565b61368c6120a4565b5f83815260049190910160205260408120919091556001600160a01b0384169083830190839083905f805160206149518339815191528180a4600183015b8181146136ed5780835f5f805160206149518339815191525f80a46001016136ca565b50815f0361370d57604051622e076360e81b815260040160405180910390fd5b806137166120a4565b5550610f3d9050565b5f81815260018301602052604081205461376457508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610a01565b505f610a01565b5f8181526001830160205260408120548015613845575f61378d600183614475565b85549091505f906137a090600190614475565b90508181146137ff575f865f0182815481106137be576137be614311565b905f5260205f200154905080875f0184815481106137de576137de614311565b5f918252602080832090910192909255918252600188019052604090208390555b8554869080613810576138106148b5565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050610a01565b5f915050610a01565b606083156138ba5782515f036138b357613867856126d7565b6138b35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b10565b5081611ecb565b611ecb8383613977565b5f806fa2a8918ca85bafe22016d0b997e4df60600160ff1b038311156138ef57505f9050600361396e565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613940573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b038116613968575f6001925092505061396e565b91505f90505b94509492505050565b8151156139875781518083602001fd5b8060405162461bcd60e51b8152600401610b109190613a44565b604080516080810182525f80825260208201819052918101829052606081019190915290565b6001600160e01b031981168114610f0a575f80fd5b5f602082840312156139ec575f80fd5b81356118c5816139c7565b5f5b83811015613a115781810151838201526020016139f9565b50505f910152565b5f8151808452613a308160208601602086016139f7565b601f01601f19169290920160200192915050565b602081525f6118c56020830184613a19565b5f60208284031215613a66575f80fd5b5035919050565b6001600160a01b0391909116815260200190565b80356001600160a01b0381168114612b9b575f80fd5b5f8060408385031215613aa8575f80fd5b613ab183613a81565b946020939093013593505050565b5f60208284031215613acf575f80fd5b6118c582613a81565b5f60208284031215613ae8575f80fd5b81356001600160401b03811115613afd575f80fd5b8201602081850312156118c5575f80fd5b5f805f60608486031215613b20575f80fd5b613b2984613a81565b9250613b3760208501613a81565b9150604084013590509250925092565b5f8060408385031215613b58575f80fd5b50508035926020909101359150565b5f8060408385031215613b78575f80fd5b82359150613b8860208401613a81565b90509250929050565b634e487b7160e01b5f52604160045260245ffd5b60405160e081016001600160401b0381118282101715613bc757613bc7613b91565b60405290565b604051601f8201601f191681016001600160401b0381118282101715613bf557613bf5613b91565b604052919050565b5f82601f830112613c0c575f80fd5b81356001600160401b03811115613c2557613c25613b91565b613c38601f8201601f1916602001613bcd565b818152846020838601011115613c4c575f80fd5b816020850160208301375f918101602001919091529392505050565b5f82601f830112613c77575f80fd5b813560206001600160401b03821115613c9257613c92613b91565b8160051b613ca1828201613bcd565b9283528481018201928281019087851115613cba575f80fd5b83870192505b84831015613ce057613cd183613a81565b82529183019190830190613cc0565b979650505050505050565b80356001600160601b0381168114612b9b575f80fd5b5f805f805f805f805f805f806101808d8f031215613d1d575f80fd5b613d268d613a81565b9b506001600160401b0360208e01351115613d3f575f80fd5b613d4f8e60208f01358f01613bfd565b9a506001600160401b0360408e01351115613d68575f80fd5b613d788e60408f01358f01613bfd565b99506001600160401b0360608e01351115613d91575f80fd5b613da18e60608f01358f01613bfd565b98506001600160401b0360808e01351115613dba575f80fd5b613dca8e60808f01358f01613c68565b9750613dd860a08e01613a81565b9650613de660c08e01613a81565b9550613df460e08e01613a81565b9450613e036101008e01613ceb565b93506101208d01359250613e1a6101408e01613a81565b9150613e296101608e01613a81565b90509295989b509295989b509295989b565b5f8083601f840112613e4b575f80fd5b5081356001600160401b03811115613e61575f80fd5b602083019150836020828501011115610ffe575f80fd5b5f805f8060608587031215613e8b575f80fd5b84356001600160401b03811115613ea0575f80fd5b613eac87828801613e3b565b90989097506020870135966040013595509350505050565b8015158114610f0a575f80fd5b5f60208284031215613ee1575f80fd5b81356118c581613ec4565b5f8083601f840112613efc575f80fd5b5081356001600160401b03811115613f12575f80fd5b6020830191508360208260051b8501011115610ffe575f80fd5b5f8060208385031215613f3d575f80fd5b82356001600160401b03811115613f52575f80fd5b613f5e85828601613eec565b90969095509350505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b602080825282518282018190525f9190848201906040850190845b8181101561184857613fd4838551613f6a565b9284019260809290920191600101613fc1565b602080825282518282018190525f9190848201906040850190845b8181101561184857835183529284019291840191600101614002565b5f805f60408486031215614030575f80fd5b83356001600160401b03811115614045575f80fd5b61405186828701613e3b565b9094509250614064905060208501613a81565b90509250925092565b5f806020838503121561407e575f80fd5b82356001600160401b03811115614093575f80fd5b613f5e85828601613e3b565b5f805f606084860312156140b1575f80fd5b6140ba84613a81565b95602085013595506040909401359392505050565b5f80604083850312156140e0575f80fd5b6140e983613a81565b915060208301356140f981613ec4565b809150509250929050565b5f602080830181845280855180835260408601915060408160051b87010192508387015f5b8281101561415757603f19888603018452614145858351613a19565b94509285019290850190600101614129565b5092979650505050505050565b5f805f8060808587031215614177575f80fd5b61418085613a81565b935061418e60208601613a81565b92506040850135915060608501356001600160401b038111156141af575f80fd5b6141bb87828801613bfd565b91505092959194509250565b60808101610a018284613f6a565b5f80604083850312156141e6575f80fd5b6141ef83613a81565b9150613b8860208401613ceb565b5f806040838503121561420e575f80fd5b61421783613a81565b9150613b8860208401613a81565b5f8060408385031215614236575f80fd5b82356001600160401b0381111561424b575f80fd5b61425785828601613bfd565b925050613b8860208401613a81565b600181811c9082168061427a57607f821691505b60208210810361429857634e487b7160e01b5f52602260045260245ffd5b50919050565b60208082526014908201527313dc195c985d1bdc881b9bdd08185b1b1bddd95960621b604082015260600190565b5f808335601e198436030181126142e1575f80fd5b8301803591506001600160401b038211156142fa575f80fd5b6020019150600581901b3603821315610ffe575f80fd5b634e487b7160e01b5f52603260045260245ffd5b5f823560de19833603018112614339575f80fd5b9190910192915050565b5f60e08236031215614353575f80fd5b61435b613ba5565b82356001600160401b0380821115614371575f80fd5b61437d36838701613bfd565b83526020850135602084015260408501356040840152606085013560608401526080850135608084015260a085013560a084015260c08501359150808211156143c4575f80fd5b506143d136828601613bfd565b60c08301525092915050565b5f808335601e198436030181126143f2575f80fd5b8301803591506001600160401b0382111561440b575f80fd5b602001915036819003821315610ffe575f80fd5b634e487b7160e01b5f52601160045260245ffd5b80820180821115610a0157610a0161441f565b8082028115828204841417610a0157610a0161441f565b5f6001820161446e5761446e61441f565b5060010190565b81810381811115610a0157610a0161441f565b5f83516144998184602088016139f7565b8351908301906144ad8183602088016139f7565b600b60fa1b9101908152600101949350505050565b5f826144dc57634e487b7160e01b5f52601260045260245ffd5b500490565b601f821115610f3d575f81815260208120601f850160051c810160208610156145075750805b601f850160051c820191505b8181101561268957828155600101614513565b5f19600383901b1c191660019190911b1790565b81516001600160401b0381111561455357614553613b91565b614567816145618454614266565b846144e1565b602080601f831160018114614595575f84156145835750858301515b61458d8582614526565b865550612689565b5f85815260208120601f198616915b828110156145c3578886015182559484019460019091019084016145a4565b50858210156145e057878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160401b0383111561460757614607613b91565b61461b836146158354614266565b836144e1565b5f601f841160018114614647575f85156146355750838201355b61463f8682614526565b845550612f42565b5f83815260209020601f19861690835b828110156146775786850135825560209485019460019092019101614657565b5086821015614693575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b818382375f9101908152919050565b5f8084546146c181614266565b600182811680156146d957600181146146ee5761471a565b60ff198416875282151583028701945061471a565b885f526020805f205f5b858110156147115781548a8201529084019082016146f8565b50505082870194505b50505050835161472e8183602088016139f7565b64173539b7b760d91b9101908152600501949350505050565b5f60208284031215614757575f80fd5b81516118c581613ec4565b5f82516143398184602087016139f7565b606088901b6001600160601b031916815286515f90614799816014850160208c016139f7565b6014920191820196909652603481019490945260548401929092526074830152609482015260b4019392505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526034908201525f805160206148ca833981519152604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f9061339290830184613a19565b5f60208284031215614896575f80fd5b81516118c5816139c7565b634e487b7160e01b5f52602160045260245ffd5b634e487b7160e01b5f52603160045260245ffdfe455243373231415f5f496e697469616c697a61626c653a20636f6e74726163748eb467f061ca67f42a2d2ca4a346fc9fb645efc0ba75056ee9f71c3a0ccc10a8416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65649f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef2ce8d04a9c35987429af538825cd2438cc5c5bb5dc427955f84daaa3ea105016a164736f6c6343000815000a
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.