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
Contract Name:
ValeriaUpgradeable
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 900 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IERC2981Upgradeable, ERC2981Upgradeable} from "@openzeppelin/contracts-upgradeable/token/common/ERC2981Upgradeable.sol"; import {StringsUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import {SafeMathUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol"; import {OperatorFilterer} from "closedsea/src/OperatorFilterer.sol"; import {ERC721BUpgradeable} from "./abstract/ERC721BUpgradeable.sol"; import {IERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol"; import "./abstract/LockRegistry.sol"; import "./interfaces/IDelegationRegistry.sol"; import "./interfaces/IValeria.sol"; /** * @title ValeriaUpgradeable * @custom:website https://valeriagames.com * @author @ValeriaStudios */ contract ValeriaUpgradeable is Initializable, AccessControlUpgradeable, ERC2981Upgradeable, ERC721BUpgradeable, OperatorFilterer, LockRegistry, IValeria { using StringsUpgradeable for uint256; using SafeMathUpgradeable for uint256; // Roles bytes32 constant EXTERNAL_STAKE_ROLE = keccak256("EXTERNAL_STAKE_ROLE"); bytes32 constant OWNER_ROLE = keccak256("OWNER_ROLE"); /// @notice Base uri string public baseURI; /// @notice Maximum supply for the collection uint256 public constant MAX_SUPPLY = 10001; /// @notice Total supply uint256 private _totalMinted; /// @notice Operator filter toggle switch bool private operatorFilteringEnabled; /// @notice Delegation registry address public delegationRegistryAddress; modifier isDelegate(address vault) { bool isDelegateValid = IDelegationRegistry(delegationRegistryAddress) .checkDelegateForContract(_msgSender(), vault, address(this)); require(isDelegateValid, "Invalid delegate-vault pairing"); _; } /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } function initialize( address _delegationRegistryAddress ) public virtual initializer { __ERC721B_init("Land of Valeria", "VOL"); LockRegistry.__LockRegistry_init(); __AccessControl_init(); __ERC2981_init(); // Setup access control _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(OWNER_ROLE, _msgSender()); _setupRole(EXTERNAL_STAKE_ROLE, _msgSender()); // Setup filter registry _registerForOperatorFiltering(); operatorFilteringEnabled = true; // Setup royalties to 6.5% (default denominator is 10000) _setDefaultRoyalty(_msgSender(), 650); // Setup contracts delegationRegistryAddress = _delegationRegistryAddress; // Set metadata baseURI = "ipfs://Qmc8QDbpwQ2QjbHEDJahS1kWN7Km8AhxjGReNLJ4gbxRMH/"; } /** * @notice Migrate NFTs from a snapshot * @param tokenIds - The token ids * @param owners - The token owners */ function migrateTokens( uint256[] calldata tokenIds, address[] calldata owners ) external onlyOwner { uint256 inputSize = tokenIds.length; uint256 newTotalMinted = _totalMinted + inputSize; require(owners.length == inputSize); require(newTotalMinted <= MAX_SUPPLY); uint256 tokenId; address owner; for (uint256 i; i < inputSize; ) { tokenId = tokenIds[i]; owner = owners[i]; // Mint new token token id to previous owner _mint(owner, tokenId); unchecked { i++; } } _totalMinted = newTotalMinted; } /** * @notice Total supply of the collection * @return uint256 The total supply */ function totalSupply() external view returns (uint256) { return _totalMinted; } function supportsInterface( bytes4 interfaceId ) public view virtual override( ERC721BUpgradeable, ERC2981Upgradeable, AccessControlUpgradeable, IERC165Upgradeable ) returns (bool) { return ERC721BUpgradeable.supportsInterface(interfaceId) || ERC2981Upgradeable.supportsInterface(interfaceId) || AccessControlUpgradeable.supportsInterface(interfaceId); } function setApprovalForAll( address operator, bool approved ) public override(ERC721BUpgradeable, IERC721Upgradeable) onlyAllowedOperatorApproval(operator) { super.setApprovalForAll(operator, approved); } function approve( address operator, uint256 tokenId ) public override(ERC721BUpgradeable, IERC721Upgradeable) onlyAllowedOperatorApproval(operator) { require(isUnlocked(tokenId), "!unlocked"); super.approve(operator, tokenId); } function transferFrom( address from, address to, uint256 tokenId ) public override(ERC721BUpgradeable, IERC721Upgradeable) onlyAllowedOperator(from) { require(isUnlocked(tokenId), "!unlocked"); super.transferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId ) public override(ERC721BUpgradeable, IERC721Upgradeable) onlyAllowedOperator(from) { require(isUnlocked(tokenId), "!unlocked"); super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public override(ERC721BUpgradeable, IERC721Upgradeable) onlyAllowedOperator(from) { require(isUnlocked(tokenId), "!unlocked"); super.safeTransferFrom(from, to, tokenId, data); } function lockId(uint256 _id) external onlyRole(EXTERNAL_STAKE_ROLE) { require(_exists(_id), "!exists"); _lockId(_id); } function unlockId(uint256 _id) external onlyRole(EXTERNAL_STAKE_ROLE) { require(_exists(_id), "!exists"); _unlockId(_id); } function freeId( uint256 _id, address _contract ) external onlyRole(EXTERNAL_STAKE_ROLE) { require(_exists(_id), "!exists"); _freeId(_id, _contract); } /** * @notice Sets the delegation registry address * @param _delegationRegistryAddress The delegation registry address */ function setDelegationRegistry( address _delegationRegistryAddress ) external onlyOwner { delegationRegistryAddress = _delegationRegistryAddress; } /** * @notice Token uri * @param tokenId The token id */ function tokenURI( uint256 tokenId ) public view override returns (string memory) { require(_exists(tokenId), "!exists"); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString(), ".json")) : ""; } /** * @notice Sets the base uri for the token metadata * @param _baseURI The base uri */ function setBaseURI(string memory _baseURI) external onlyOwner { baseURI = _baseURI; } /** * @notice Set default royalty * @param receiver The royalty receiver address * @param feeNumerator A number for 10k basis */ function setDefaultRoyalty( address receiver, uint96 feeNumerator ) external onlyOwner { _setDefaultRoyalty(receiver, feeNumerator); } /** * @notice Sets whether the operator filter is enabled or disabled * @param operatorFilteringEnabled_ A boolean value for the operator filter */ function setOperatorFilteringEnabled( bool operatorFilteringEnabled_ ) public onlyOwner { operatorFilteringEnabled = operatorFilteringEnabled_; } function _operatorFilteringEnabled() internal view override returns (bool) { return operatorFilteringEnabled; } function _isPriorityOperator( address operator ) internal pure override returns (bool) { // OpenSea Seaport Conduit: // https://etherscan.io/address/0x1E0049783F008A0085193E00003D00cd54003c71 return operator == address(0x1E0049783F008A0085193E00003D00cd54003c71); } /** * @notice Return token ids owned by user * @param account Account to query * @return tokenIds */ function tokensOfOwner( address account ) external view returns (uint256[] memory) { unchecked { uint256 tokenIdsIdx; uint256 tokenIdsLength = balanceOf(account); uint256[] memory tokenIds = new uint256[](tokenIdsLength); for (uint256 i; tokenIdsIdx != tokenIdsLength; ++i) { if (!_exists(i)) { continue; } if (ownerOf(i) == account) { tokenIds[tokenIdsIdx++] = i; } } return tokenIds; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @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/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.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.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.8.1) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981Upgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.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 ERC2981Upgradeable is Initializable, IERC2981Upgradeable, ERC165Upgradeable { function __ERC2981_init() internal onlyInitializing { } function __ERC2981_init_unchained() internal onlyInitializing { } 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(IERC165Upgradeable, ERC165Upgradeable) returns (bool) { return interfaceId == type(IERC2981Upgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981Upgradeable */ 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]; } /** * @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[48] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721EnumerableUpgradeable is IERC721Upgradeable { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721ReceiverUpgradeable { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library MathUpgradeable { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMathUpgradeable { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/MathUpgradeable.sol"; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = MathUpgradeable.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, MathUpgradeable.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Optimized and flexible operator filterer to abide to OpenSea's /// mandatory on-chain royalty enforcement in order for new collections to /// receive royalties. /// For more information, see: /// See: https://github.com/ProjectOpenSea/operator-filter-registry abstract contract OperatorFilterer { /// @dev The default OpenSea operator blocklist subscription. address internal constant _DEFAULT_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6; /// @dev The OpenSea operator filter registry. address internal constant _OPERATOR_FILTER_REGISTRY = 0x000000000000AAeB6D7670E522A718067333cd4E; /// @dev Registers the current contract to OpenSea's operator filter, /// and subscribe to the default OpenSea operator blocklist. /// Note: Will not revert nor update existing settings for repeated registration. function _registerForOperatorFiltering() internal virtual { _registerForOperatorFiltering(_DEFAULT_SUBSCRIPTION, true); } /// @dev Registers the current contract to OpenSea's operator filter. /// Note: Will not revert nor update existing settings for repeated registration. function _registerForOperatorFiltering(address subscriptionOrRegistrantToCopy, bool subscribe) internal virtual { /// @solidity memory-safe-assembly assembly { let functionSelector := 0x7d3e3dbe // `registerAndSubscribe(address,address)`. // Clean the upper 96 bits of `subscriptionOrRegistrantToCopy` in case they are dirty. subscriptionOrRegistrantToCopy := shr(96, shl(96, subscriptionOrRegistrantToCopy)) for {} iszero(subscribe) {} { if iszero(subscriptionOrRegistrantToCopy) { functionSelector := 0x4420e486 // `register(address)`. break } functionSelector := 0xa0af2903 // `registerAndCopyEntries(address,address)`. break } // Store the function selector. mstore(0x00, shl(224, functionSelector)) // Store the `address(this)`. mstore(0x04, address()) // Store the `subscriptionOrRegistrantToCopy`. mstore(0x24, subscriptionOrRegistrantToCopy) // Register into the registry. if iszero(call(gas(), _OPERATOR_FILTER_REGISTRY, 0, 0x00, 0x44, 0x00, 0x04)) { // If the function selector has not been overwritten, // it is an out-of-gas error. if eq(shr(224, mload(0x00)), functionSelector) { // To prevent gas under-estimation. revert(0, 0) } } // Restore the part of the free memory pointer that was overwritten, // which is guaranteed to be zero, because of Solidity's memory size limits. mstore(0x24, 0) } } /// @dev Modifier to guard a function and revert if the caller is a blocked operator. modifier onlyAllowedOperator(address from) virtual { if (from != msg.sender) { if (!_isPriorityOperator(msg.sender)) { if (_operatorFilteringEnabled()) _revertIfBlocked(msg.sender); } } _; } /// @dev Modifier to guard a function from approving a blocked operator.. modifier onlyAllowedOperatorApproval(address operator) virtual { if (!_isPriorityOperator(operator)) { if (_operatorFilteringEnabled()) _revertIfBlocked(operator); } _; } /// @dev Helper function that reverts if the `operator` is blocked by the registry. function _revertIfBlocked(address operator) private view { /// @solidity memory-safe-assembly assembly { // Store the function selector of `isOperatorAllowed(address,address)`, // shifted left by 6 bytes, which is enough for 8tb of memory. // We waste 6-3 = 3 bytes to save on 6 runtime gas (PUSH1 0x224 SHL). mstore(0x00, 0xc6171134001122334455) // Store the `address(this)`. mstore(0x1a, address()) // Store the `operator`. mstore(0x3a, operator) // `isOperatorAllowed` always returns true if it does not revert. if iszero(staticcall(gas(), _OPERATOR_FILTER_REGISTRY, 0x16, 0x44, 0x00, 0x00)) { // Bubble up the revert if the staticcall reverts. returndatacopy(0x00, 0x00, returndatasize()) revert(0x00, returndatasize()) } // We'll skip checking if `from` is inside the blacklist. // Even though that can block transferring out of wrapper contracts, // we don't want tokens to be stuck. // Restore the part of the free memory pointer that was overwritten, // which is guaranteed to be zero, if less than 8tb of memory is used. mstore(0x3a, 0) } } /// @dev For deriving contracts to override, so that operator filtering /// can be turned on / off. /// Returns true by default. function _operatorFilteringEnabled() internal view virtual returns (bool) { return true; } /// @dev For deriving contracts to override, so that preferred marketplaces can /// skip operator filtering, helping users save gas. /// Returns false for all inputs by default. function _isPriorityOperator(address) internal view virtual returns (bool) { return false; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /************************* * @author: @scottybmitch ************************/ abstract contract ERC721BUpgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable for uint256; string private _name; string private _symbol; // Mapping from token ID to owner address address[] internal _owners; mapping(uint256 => address) private _tokenApprovals; mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ function __ERC721B_init( string memory name_, string memory symbol_ ) internal onlyInitializing { __ERC721B_init_unchained(name_, symbol_); } function __ERC721B_init_unchained( string memory name_, string memory symbol_ ) internal onlyInitializing { _name = name_; _symbol = symbol_; _owners.push(address(0)); } /** * @dev See {ERC165Upgradeable-supportsInterface}. */ function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId || interfaceId == type(IERC721EnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf( address owner ) public view virtual override returns (uint256) { require( owner != address(0), "ERC721: balance query for the zero address" ); uint256 count = 0; uint256 length = _owners.length; for (uint256 i = 0; i < length; ++i) { if (owner == _owners[i]) ++count; } return count; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf( uint256 tokenId ) public view virtual override returns (address) { address owner = _owners[tokenId]; require( owner != address(0), "ERC721: owner query for nonexistent token" ); return owner; } /** * @dev See {IERC721UpgradeableMetadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721UpgradeableMetadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI( uint256 tokenId ) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721B: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved( uint256 tokenId ) public view virtual override returns (address) { require( _exists(tokenId), "ERC721: approved query for nonexistent token" ); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll( address operator, bool approved ) public virtual override { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll( address owner, address operator ) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved" ); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved" ); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721ReceiverUpgradeable-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require( _checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return tokenId < _owners.length && _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner( address spender, uint256 tokenId ) internal view virtual returns (bool) { require( _exists(tokenId), "ERC721: operator query for nonexistent token" ); address owner = ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721ReceiverUpgradeable-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721ReceiverUpgradeable-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _owners.push(to); emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _owners[tokenId] = address(0); emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require( ownerOf(tokenId) == from, "ERC721: transfer of token that is not own" ); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ownerOf(tokenId), to, tokenId); } /** * @dev Internal function to invoke {IERC721ReceiverUpgradeable-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721ReceiverUpgradeable(to).onERC721Received( _msgSender(), from, tokenId, _data ) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert( "ERC721: transfer to non ERC721Receiver implementer" ); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * 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, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.17; /* * ,_, * (',') * {/"\\} * -"-"- */ import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; abstract contract LockRegistry is OwnableUpgradeable { mapping(address => bool) public approvedContract; mapping(uint256 => uint256) public lockCount; mapping(uint256 => mapping(uint256 => address)) public lockMap; mapping(uint256 => mapping(address => uint256)) public lockMapIndex; event TokenLocked( uint256 indexed tokenId, address indexed approvedContract ); event TokenUnlocked( uint256 indexed tokenId, address indexed approvedContract ); function __LockRegistry_init() internal onlyInitializing { OwnableUpgradeable.__Ownable_init(); } function isUnlocked(uint256 _id) public view returns (bool) { return lockCount[_id] == 0; } function updateApprovedContracts( address[] calldata _contracts, bool[] calldata _values ) external onlyOwner { require(_contracts.length == _values.length, "!length"); for (uint256 i = 0; i < _contracts.length; i++) approvedContract[_contracts[i]] = _values[i]; } function _lockId(uint256 _id) internal { require(approvedContract[msg.sender], "Cannot update map"); require( lockMapIndex[_id][msg.sender] == 0, "ID already locked by caller" ); uint256 count = lockCount[_id] + 1; lockMap[_id][count] = msg.sender; lockMapIndex[_id][msg.sender] = count; lockCount[_id]++; emit TokenLocked(_id, msg.sender); } function _unlockId(uint256 _id) internal { require(approvedContract[msg.sender], "Cannot update map"); uint256 index = lockMapIndex[_id][msg.sender]; require(index != 0, "ID not locked by caller"); uint256 last = lockCount[_id]; if (index != last) { address lastContract = lockMap[_id][last]; lockMap[_id][index] = lastContract; lockMap[_id][last] = address(0); lockMapIndex[_id][lastContract] = index; } else lockMap[_id][index] = address(0); lockMapIndex[_id][msg.sender] = 0; lockCount[_id]--; emit TokenUnlocked(_id, msg.sender); } function _freeId(uint256 _id, address _contract) internal { require(!approvedContract[_contract], "Cannot update map"); uint256 index = lockMapIndex[_id][_contract]; require(index != 0, "ID not locked"); uint256 last = lockCount[_id]; if (index != last) { address lastContract = lockMap[_id][last]; lockMap[_id][index] = lastContract; lockMap[_id][last] = address(0); lockMapIndex[_id][lastContract] = index; } else lockMap[_id][index] = address(0); lockMapIndex[_id][_contract] = 0; lockCount[_id]--; emit TokenUnlocked(_id, _contract); } }
// SPDX-License-Identifier: CC0-1.0 pragma solidity ^0.8.17; /** * @title An immutable registry contract to be deployed as a standalone primitive * @dev See EIP-5639, new project launches can read previous cold wallet -> hot wallet delegations * from here and integrate those permissions into their flow */ interface IDelegationRegistry { /// @notice Delegation type enum DelegationType { NONE, ALL, CONTRACT, TOKEN } /// @notice Info about a single delegation, used for onchain enumeration struct DelegationInfo { DelegationType type_; address vault; address delegate; address contract_; uint256 tokenId; } /// @notice Info about a single contract-level delegation struct ContractDelegation { address contract_; address delegate; } /// @notice Info about a single token-level delegation struct TokenDelegation { address contract_; uint256 tokenId; address delegate; } /// @notice Emitted when a user delegates their entire wallet event DelegateForAll(address vault, address delegate, bool value); /// @notice Emitted when a user delegates a specific contract event DelegateForContract( address vault, address delegate, address contract_, bool value ); /// @notice Emitted when a user delegates a specific token event DelegateForToken( address vault, address delegate, address contract_, uint256 tokenId, bool value ); /// @notice Emitted when a user revokes all delegations event RevokeAllDelegates(address vault); /// @notice Emitted when a user revoes all delegations for a given delegate event RevokeDelegate(address vault, address delegate); /** * ----------- WRITE ----------- */ /** * @notice Allow the delegate to act on your behalf for all contracts * @param delegate The hotwallet to act on your behalf * @param value Whether to enable or disable delegation for this address, true for setting and false for revoking */ function delegateForAll(address delegate, bool value) external; /** * @notice Allow the delegate to act on your behalf for a specific contract * @param delegate The hotwallet to act on your behalf * @param contract_ The address for the contract you're delegating * @param value Whether to enable or disable delegation for this address, true for setting and false for revoking */ function delegateForContract( address delegate, address contract_, bool value ) external; /** * @notice Allow the delegate to act on your behalf for a specific token * @param delegate The hotwallet to act on your behalf * @param contract_ The address for the contract you're delegating * @param tokenId The token id for the token you're delegating * @param value Whether to enable or disable delegation for this address, true for setting and false for revoking */ function delegateForToken( address delegate, address contract_, uint256 tokenId, bool value ) external; /** * @notice Revoke all delegates */ function revokeAllDelegates() external; /** * @notice Revoke a specific delegate for all their permissions * @param delegate The hotwallet to revoke */ function revokeDelegate(address delegate) external; /** * @notice Remove yourself as a delegate for a specific vault * @param vault The vault which delegated to the msg.sender, and should be removed */ function revokeSelf(address vault) external; /** * ----------- READ ----------- */ /** * @notice Returns all active delegations a given delegate is able to claim on behalf of * @param delegate The delegate that you would like to retrieve delegations for * @return info Array of DelegationInfo structs */ function getDelegationsByDelegate( address delegate ) external view returns (DelegationInfo[] memory); /** * @notice Returns an array of wallet-level delegates for a given vault * @param vault The cold wallet who issued the delegation * @return addresses Array of wallet-level delegates for a given vault */ function getDelegatesForAll( address vault ) external view returns (address[] memory); /** * @notice Returns an array of contract-level delegates for a given vault and contract * @param vault The cold wallet who issued the delegation * @param contract_ The address for the contract you're delegating * @return addresses Array of contract-level delegates for a given vault and contract */ function getDelegatesForContract( address vault, address contract_ ) external view returns (address[] memory); /** * @notice Returns an array of contract-level delegates for a given vault's token * @param vault The cold wallet who issued the delegation * @param contract_ The address for the contract holding the token * @param tokenId The token id for the token you're delegating * @return addresses Array of contract-level delegates for a given vault's token */ function getDelegatesForToken( address vault, address contract_, uint256 tokenId ) external view returns (address[] memory); /** * @notice Returns all contract-level delegations for a given vault * @param vault The cold wallet who issued the delegations * @return delegations Array of ContractDelegation structs */ function getContractLevelDelegations( address vault ) external view returns (ContractDelegation[] memory delegations); /** * @notice Returns all token-level delegations for a given vault * @param vault The cold wallet who issued the delegations * @return delegations Array of TokenDelegation structs */ function getTokenLevelDelegations( address vault ) external view returns (TokenDelegation[] memory delegations); /** * @notice Returns true if the address is delegated to act on the entire vault * @param delegate The hotwallet to act on your behalf * @param vault The cold wallet who issued the delegation */ function checkDelegateForAll( address delegate, address vault ) external view returns (bool); /** * @notice Returns true if the address is delegated to act on your behalf for a token contract or an entire vault * @param delegate The hotwallet to act on your behalf * @param contract_ The address for the contract you're delegating * @param vault The cold wallet who issued the delegation */ function checkDelegateForContract( address delegate, address vault, address contract_ ) external view returns (bool); /** * @notice Returns true if the address is delegated to act on your behalf for a specific token, the token's contract or an entire vault * @param delegate The hotwallet to act on your behalf * @param contract_ The address for the contract you're delegating * @param tokenId The token id for the token you're delegating * @param vault The cold wallet who issued the delegation */ function checkDelegateForToken( address delegate, address vault, address contract_, uint256 tokenId ) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import {IERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; interface IValeria is IERC721Upgradeable { function totalSupply() external view returns (uint256); function migrateTokens( uint256[] calldata tokenIds, address[] calldata owners ) external; function setDelegationRegistry(address _delegationRegistryAddress) external; function setDefaultRoyalty(address receiver, uint96 feeNumerator) external; function setOperatorFilteringEnabled( bool _operatorFilteringEnabled ) external; }
{ "optimizer": { "enabled": true, "runs": 900 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"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":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"approvedContract","type":"address"}],"name":"TokenLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"approvedContract","type":"address"}],"name":"TokenUnlocked","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"},{"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":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"approvedContract","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"delegationRegistryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"address","name":"_contract","type":"address"}],"name":"freeId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_delegationRegistryAddress","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":"uint256","name":"_id","type":"uint256"}],"name":"isUnlocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"lockCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"lockId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"lockMap","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"lockMapIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"owners","type":"address[]"}],"name":"migrateTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"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":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegationRegistryAddress","type":"address"}],"name":"setDelegationRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"operatorFilteringEnabled_","type":"bool"}],"name":"setOperatorFilteringEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"unlockId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_contracts","type":"address[]"},{"internalType":"bool[]","name":"_values","type":"bool[]"}],"name":"updateApprovedContracts","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61396e80620000f46000396000f3fe608060405234801561001057600080fd5b50600436106102e95760003560e01c806370a0823111610191578063ac52e644116100e3578063bf5bf5f811610097578063d547741f11610071578063d547741f146106b4578063e985e9c5146106c7578063f2fde38b1461070357600080fd5b8063bf5bf5f814610675578063c4d66de81461068e578063c87b56dd146106a157600080fd5b8063b1a6505f116100c8578063b1a6505f1461062b578063b7c0b8e81461064f578063b88d4fde1461066257600080fd5b8063ac52e64414610605578063b0e25d1f1461061857600080fd5b80638da5cb5b1161014557806395d89b411161011f57806395d89b41146105e2578063a217fddf146105ea578063a22cb465146105f257600080fd5b80638da5cb5b1461058557806391d148541461059657806394d216d6146105cf57600080fd5b806372abc8b71161017657806372abc8b71461053057806373aa9e94146105525780638462151c1461056557600080fd5b806370a0823114610515578063715018a61461052857600080fd5b80632a55205a1161024a57806340a9c8df116101fe5780636352211e116101d85780636352211e146104d9578063650b00f6146104ec5780636c0360eb1461050d57600080fd5b806340a9c8df146104a057806342842e0e146104b357806355f804b3146104c657600080fd5b80632f2ff15d1161022f5780632f2ff15d1461047157806332cb6b0c1461048457806336568abe1461048d57600080fd5b80632a55205a1461040a5780632cba81231461043c57600080fd5b8063095ea7b3116102a157806323b872dd1161028657806323b872dd146103c1578063248a9ca3146103d45780632799cde0146103f757600080fd5b8063095ea7b3146103a557806318160ddd146103b857600080fd5b806306fdde03116102d257806306fdde031461032b578063081812fc1461034057806309308e5d1461036b57600080fd5b806301ffc9a7146102ee57806304634d8d14610316575b600080fd5b6103016102fc3660046130f8565b610716565b60405190151581526020015b60405180910390f35b610329610324366004613131565b610745565b005b61033361075b565b60405161030d91906131c9565b61035361034e3660046131dc565b6107ed565b6040516001600160a01b03909116815260200161030d565b6103976103793660046131f5565b61010360209081526000928352604080842090915290825290205481565b60405190815260200161030d565b6103296103b3366004613221565b61087a565b61010554610397565b6103296103cf36600461324b565b61090c565b6103976103e23660046131dc565b60009081526065602052604090206001015490565b6103296104053660046131dc565b6109a7565b61041d610418366004613287565b610a19565b604080516001600160a01b03909316835260208301919091520161030d565b61035361044a366004613287565b6101026020908152600092835260408084209091529082529020546001600160a01b031681565b61032961047f3660046131f5565b610ad6565b61039761271181565b61032961049b3660046131f5565b610afb565b6103296104ae3660046131dc565b610b83565b6103296104c136600461324b565b610bf5565b6103296104d4366004613335565b610c8a565b6103536104e73660046131dc565b610c9f565b6103976104fa3660046131dc565b6101016020526000908152604090205481565b610333610d3f565b61039761052336600461337e565b610dce565b610329610eb3565b61030161053e3660046131dc565b600090815261010160205260409020541590565b61032961056036600461337e565b610ec7565b61057861057336600461337e565b610f05565b60405161030d9190613399565b60ce546001600160a01b0316610353565b6103016105a43660046131f5565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6103296105dd3660046131f5565b610fcc565b61033361103f565b610397600081565b6103296106003660046133ed565b61104e565b61032961061336600461345c565b611092565b61032961062636600461345c565b611188565b61030161063936600461337e565b6101006020526000908152604090205460ff1681565b61032961065d3660046134c8565b611233565b6103296106703660046134e3565b61124f565b610106546103539061010090046001600160a01b031681565b61032961069c36600461337e565b6112e5565b6103336106af3660046131dc565b611565565b6103296106c23660046131f5565b611604565b6103016106d536600461355f565b6001600160a01b03918216600090815260cd6020908152604080832093909416825291909152205460ff1690565b61032961071136600461337e565b611629565b6000610721826116b9565b8061073057506107308261175b565b8061073f575061073f82611795565b92915050565b61074d6117fc565b6107578282611856565b5050565b606060c9805461076a90613589565b80601f016020809104026020016040519081016040528092919081815260200182805461079690613589565b80156107e35780601f106107b8576101008083540402835291602001916107e3565b820191906000526020600020905b8154815290600101906020018083116107c657829003601f168201915b5050505050905090565b60006107f882611970565b61085e5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b50600090815260cc60205260409020546001600160a01b031690565b81731e0049783f008a0085193e00003d00cd54003c716001600160a01b038216146108b4576101065460ff16156108b4576108b4816119ba565b60008281526101016020526040902054156108fd5760405162461bcd60e51b8152602060048201526009602482015268085d5b9b1bd8dad95960ba1b6044820152606401610855565b61090783836119fe565b505050565b826001600160a01b038116331461094d57731e0049783f008a0085193e00003d00cd54003c71331461094d576101065460ff161561094d5761094d336119ba565b60008281526101016020526040902054156109965760405162461bcd60e51b8152602060048201526009602482015268085d5b9b1bd8dad95960ba1b6044820152606401610855565b6109a1848484611b0e565b50505050565b7f07454e0c519d1acf802b31f5a8b363de38a0e959080fe8d1d1d1f1b25eabc4376109d181611b95565b6109da82611970565b610a105760405162461bcd60e51b81526020600482015260076024820152662165786973747360c81b6044820152606401610855565b61075782611b9f565b60008281526098602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046bffffffffffffffffffffffff16928201929092528291610a985750604080518082019091526097546001600160a01b0381168252600160a01b90046bffffffffffffffffffffffff1660208201525b602081015160009061271090610abc906bffffffffffffffffffffffff16876135d9565b610ac691906135f0565b91519350909150505b9250929050565b600082815260656020526040902060010154610af181611b95565b6109078383611d09565b6001600160a01b0381163314610b795760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610855565b6107578282611dab565b7f07454e0c519d1acf802b31f5a8b363de38a0e959080fe8d1d1d1f1b25eabc437610bad81611b95565b610bb682611970565b610bec5760405162461bcd60e51b81526020600482015260076024820152662165786973747360c81b6044820152606401610855565b61075782611e2e565b826001600160a01b0381163314610c3657731e0049783f008a0085193e00003d00cd54003c713314610c36576101065460ff1615610c3657610c36336119ba565b6000828152610101602052604090205415610c7f5760405162461bcd60e51b8152602060048201526009602482015268085d5b9b1bd8dad95960ba1b6044820152606401610855565b6109a1848484611ffa565b610c926117fc565b6101046107578282613660565b60008060cb8381548110610cb557610cb5613720565b6000918252602090912001546001600160a01b031690508061073f5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610855565b6101048054610d4d90613589565b80601f0160208091040260200160405190810160405280929190818152602001828054610d7990613589565b8015610dc65780601f10610d9b57610100808354040283529160200191610dc6565b820191906000526020600020905b815481529060010190602001808311610da957829003601f168201915b505050505081565b60006001600160a01b038216610e4c5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610855565b60cb54600090815b81811015610eaa5760cb8181548110610e6f57610e6f613720565b6000918252602090912001546001600160a01b0390811690861603610e9a57610e9783613736565b92505b610ea381613736565b9050610e54565b50909392505050565b610ebb6117fc565b610ec56000612015565b565b610ecf6117fc565b61010680546001600160a01b039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b6060600080610f1384610dce565b905060008167ffffffffffffffff811115610f3057610f306132a9565b604051908082528060200260200182016040528015610f59578160200160208202803683370190505b50905060005b828414610fc357610f6f81611970565b15610fbb57856001600160a01b0316610f8782610c9f565b6001600160a01b031603610fbb5780828580600101965081518110610fae57610fae613720565b6020026020010181815250505b600101610f5f565b50949350505050565b7f07454e0c519d1acf802b31f5a8b363de38a0e959080fe8d1d1d1f1b25eabc437610ff681611b95565b610fff83611970565b6110355760405162461bcd60e51b81526020600482015260076024820152662165786973747360c81b6044820152606401610855565b6109078383612067565b606060ca805461076a90613589565b81731e0049783f008a0085193e00003d00cd54003c716001600160a01b03821614611088576101065460ff161561108857611088816119ba565b6109078383612259565b61109a6117fc565b8281146110e95760405162461bcd60e51b815260206004820152600760248201527f216c656e677468000000000000000000000000000000000000000000000000006044820152606401610855565b60005b838110156111815782828281811061110657611106613720565b905060200201602081019061111b91906134c8565b610100600087878581811061113257611132613720565b9050602002016020810190611147919061337e565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558061117981613736565b9150506110ec565b5050505050565b6111906117fc565b6101055483906000906111a490839061374f565b90508282146111b257600080fd5b6127118111156111c157600080fd5b60008060005b84811015611225578888828181106111e1576111e1613720565b9050602002013592508686828181106111fc576111fc613720565b9050602002016020810190611211919061337e565b915061121d828461231d565b6001016111c7565b505050610105555050505050565b61123b6117fc565b610106805460ff1916911515919091179055565b836001600160a01b038116331461129057731e0049783f008a0085193e00003d00cd54003c713314611290576101065460ff161561129057611290336119ba565b60008381526101016020526040902054156112d95760405162461bcd60e51b8152602060048201526009602482015268085d5b9b1bd8dad95960ba1b6044820152606401610855565b61118185858585612445565b600054610100900460ff16158080156113055750600054600160ff909116105b8061131f5750303b15801561131f575060005460ff166001145b6113915760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610855565b6000805460ff1916600117905580156113b4576000805461ff0019166101001790555b6114286040518060400160405280600f81526020017f4c616e64206f662056616c6572696100000000000000000000000000000000008152506040518060400160405280600381526020017f564f4c00000000000000000000000000000000000000000000000000000000008152506124cd565b611430612542565b6114386125b5565b6114406125b5565b61144b600033612620565b6114757fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e33612620565b61149f7f07454e0c519d1acf802b31f5a8b363de38a0e959080fe8d1d1d1f1b25eabc43733612620565b6114a761262a565b610106805460ff191660011790556114c76114bf3390565b61028a611856565b610106805474ffffffffffffffffffffffffffffffffffffffff0019166101006001600160a01b038516021790556040805160608101909152603680825261390360208301396101049061151b9082613660565b508015610757576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b606061157082611970565b6115a65760405162461bcd60e51b81526020600482015260076024820152662165786973747360c81b6044820152606401610855565b600061010480546115b690613589565b9050116115d2576040518060200160405280600081525061073f565b6101046115de83612649565b6040516020016115ef929190613762565b60405160208183030381529060405292915050565b60008281526065602052604090206001015461161f81611b95565b6109078383611dab565b6116316117fc565b6001600160a01b0381166116ad5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610855565b6116b681612015565b50565b60006001600160e01b031982167f80ac58cd00000000000000000000000000000000000000000000000000000000148061171c57506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061175057506001600160e01b031982167f780e9d6300000000000000000000000000000000000000000000000000000000145b8061073f575061073f825b60006001600160e01b031982167f2a55205a00000000000000000000000000000000000000000000000000000000148061073f575061073f825b60006001600160e01b031982167f7965db0b00000000000000000000000000000000000000000000000000000000148061073f57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b031983161461073f565b60ce546001600160a01b03163314610ec55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610855565b6127106bffffffffffffffffffffffff821611156118dc5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152608401610855565b6001600160a01b0382166119325760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610855565b604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff9091166020909201829052600160a01b90910217609755565b60cb546000908210801561073f575060006001600160a01b031660cb838154811061199d5761199d613720565b6000918252602090912001546001600160a01b0316141592915050565b69c617113400112233445560005230601a5280603a52600080604460166daaeb6d7670e522a718067333cd4e5afa6119f6573d6000803e3d6000fd5b6000603a5250565b6000611a0982610c9f565b9050806001600160a01b0316836001600160a01b031603611a765760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610855565b336001600160a01b0382161480611a925750611a9281336106d5565b611b045760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610855565b61090783836126e9565b611b183382612757565b611b8a5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610855565b610907838383612841565b6116b681336129c4565b336000908152610100602052604090205460ff16611bf35760405162461bcd60e51b8152602060048201526011602482015270043616e6e6f7420757064617465206d617607c1b6044820152606401610855565b60008181526101036020908152604080832033845290915290205415611c5b5760405162461bcd60e51b815260206004820152601b60248201527f494420616c7265616479206c6f636b65642062792063616c6c657200000000006044820152606401610855565b60008181526101016020526040812054611c7690600161374f565b600083815261010260209081526040808320848452825280832080546001600160a01b03191633908117909155868452610103835281842090845282528083208490558583526101019091528120805492935090611cd383613736565b9091555050604051339083907f9ecfd70e9ff36df72989324a49559383d39f9290d700b10cf5ac10dcb68d264390600090a35050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff166107575760008281526065602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611d673390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16156107575760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b336000908152610100602052604090205460ff16611e825760405162461bcd60e51b8152602060048201526011602482015270043616e6e6f7420757064617465206d617607c1b6044820152606401610855565b60008181526101036020908152604080832033845290915281205490819003611eed5760405162461bcd60e51b815260206004820152601760248201527f4944206e6f74206c6f636b65642062792063616c6c65720000000000000000006044820152606401610855565b60008281526101016020526040902054818114611f66576000838152610102602090815260408083208484528252808320805486855282852080546001600160a01b03199081166001600160a01b0390931692831790915582541690915586845261010383528184209084529091529020829055611f8f565b600083815261010260209081526040808320858452909152902080546001600160a01b03191690555b60008381526101036020908152604080832033845282528083208390558583526101019091528120805491611fc383613811565b9091555050604051339084907f0fe7d9801197f79ef3b1595d19379eb58f0fff5f98b0f6d6f34c03cae5306c3790600090a3505050565b6109078383836040518060200160405280600081525061124f565b60ce80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0381166000908152610100602052604090205460ff16156120c55760405162461bcd60e51b8152602060048201526011602482015270043616e6e6f7420757064617465206d617607c1b6044820152606401610855565b6000828152610103602090815260408083206001600160a01b0385168452909152812054908190036121395760405162461bcd60e51b815260206004820152600d60248201527f4944206e6f74206c6f636b6564000000000000000000000000000000000000006044820152606401610855565b600083815261010160205260409020548181146121b2576000848152610102602090815260408083208484528252808320805486855282852080546001600160a01b03199081166001600160a01b03909316928317909155825416909155878452610103835281842090845290915290208290556121db565b600084815261010260209081526040808320858452909152902080546001600160a01b03191690555b6000848152610103602090815260408083206001600160a01b03871684528252808320839055868352610101909152812080549161221883613811565b90915550506040516001600160a01b0384169085907f0fe7d9801197f79ef3b1595d19379eb58f0fff5f98b0f6d6f34c03cae5306c3790600090a350505050565b336001600160a01b038316036122b15760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610855565b33600081815260cd602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6001600160a01b0382166123735760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610855565b61237c81611970565b156123c95760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610855565b60cb805460018101825560009182527fa7ce836d032b2bf62b7e2097a8e0a6d8aeb35405ad15271e96d3b0188a1d06fb0180546001600160a01b0319166001600160a01b0385169081179091556040518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b61244f3383612757565b6124c15760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610855565b6109a184848484612a39565b600054610100900460ff166125385760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610855565b6107578282612ac2565b600054610100900460ff166125ad5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610855565b610ec5612b8b565b600054610100900460ff16610ec55760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610855565b6107578282611d09565b610ec5733cc6cdda760b79bafa08df41ecfa224f810dceb66001612bfe565b6060600061265683612c73565b600101905060008167ffffffffffffffff811115612676576126766132a9565b6040519080825280601f01601f1916602001820160405280156126a0576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846126aa57509392505050565b600081815260cc6020526040902080546001600160a01b0319166001600160a01b038416908117909155819061271e82610c9f565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061276282611970565b6127c35760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610855565b60006127ce83610c9f565b9050806001600160a01b0316846001600160a01b031614806128095750836001600160a01b03166127fe846107ed565b6001600160a01b0316145b8061283957506001600160a01b03808216600090815260cd602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661285482610c9f565b6001600160a01b0316146128d05760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610855565b6001600160a01b03821661294b5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610855565b6129566000826126e9565b8160cb828154811061296a5761296a613720565b6000918252602082200180546001600160a01b0319166001600160a01b03938416179055604051839285811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a4505050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610757576129f781612d55565b612a02836020612d67565b604051602001612a13929190613828565b60408051601f198184030181529082905262461bcd60e51b8252610855916004016131c9565b612a44848484612841565b612a5084848484612f17565b6109a15760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610855565b600054610100900460ff16612b2d5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610855565b60c9612b398382613660565b5060ca612b468282613660565b505060cb80546001810182556000919091527fa7ce836d032b2bf62b7e2097a8e0a6d8aeb35405ad15271e96d3b0188a1d06fb0180546001600160a01b031916905550565b600054610100900460ff16612bf65760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610855565b610ec561306e565b6001600160a01b0390911690637d3e3dbe81612c2b5782612c245750634420e486612c2b565b5063a0af29035b8060e01b60005230600452826024526004600060446000806daaeb6d7670e522a718067333cd4e5af1612c69578060005160e01c03612c6957600080fd5b5060006024525050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612cbc577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310612ce8576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612d0657662386f26fc10000830492506010015b6305f5e1008310612d1e576305f5e100830492506008015b6127108310612d3257612710830492506004015b60648310612d44576064830492506002015b600a831061073f5760010192915050565b606061073f6001600160a01b03831660145b60606000612d768360026135d9565b612d8190600261374f565b67ffffffffffffffff811115612d9957612d996132a9565b6040519080825280601f01601f191660200182016040528015612dc3576020820181803683370190505b509050600360fc1b81600081518110612dde57612dde613720565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612e0d57612e0d613720565b60200101906001600160f81b031916908160001a9053506000612e318460026135d9565b612e3c90600161374f565b90505b6001811115612ec1577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612e7d57612e7d613720565b1a60f81b828281518110612e9357612e93613720565b60200101906001600160f81b031916908160001a90535060049490941c93612eba81613811565b9050612e3f565b508315612f105760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610855565b9392505050565b60006001600160a01b0384163b1561306357604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612f5b9033908990889088906004016138a9565b6020604051808303816000875af1925050508015612f96575060408051601f3d908101601f19168201909252612f93918101906138e5565b60015b613049573d808015612fc4576040519150601f19603f3d011682016040523d82523d6000602084013e612fc9565b606091505b5080516000036130415760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610855565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612839565b506001949350505050565b600054610100900460ff166130d95760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610855565b610ec533612015565b6001600160e01b0319811681146116b657600080fd5b60006020828403121561310a57600080fd5b8135612f10816130e2565b80356001600160a01b038116811461312c57600080fd5b919050565b6000806040838503121561314457600080fd5b61314d83613115565b915060208301356bffffffffffffffffffffffff8116811461316e57600080fd5b809150509250929050565b60005b8381101561319457818101518382015260200161317c565b50506000910152565b600081518084526131b5816020860160208601613179565b601f01601f19169290920160200192915050565b602081526000612f10602083018461319d565b6000602082840312156131ee57600080fd5b5035919050565b6000806040838503121561320857600080fd5b8235915061321860208401613115565b90509250929050565b6000806040838503121561323457600080fd5b61323d83613115565b946020939093013593505050565b60008060006060848603121561326057600080fd5b61326984613115565b925061327760208501613115565b9150604084013590509250925092565b6000806040838503121561329a57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156132da576132da6132a9565b604051601f8501601f19908116603f01168101908282118183101715613302576133026132a9565b8160405280935085815286868601111561331b57600080fd5b858560208301376000602087830101525050509392505050565b60006020828403121561334757600080fd5b813567ffffffffffffffff81111561335e57600080fd5b8201601f8101841361336f57600080fd5b612839848235602084016132bf565b60006020828403121561339057600080fd5b612f1082613115565b6020808252825182820181905260009190848201906040850190845b818110156133d1578351835292840192918401916001016133b5565b50909695505050505050565b8035801515811461312c57600080fd5b6000806040838503121561340057600080fd5b61340983613115565b9150613218602084016133dd565b60008083601f84011261342957600080fd5b50813567ffffffffffffffff81111561344157600080fd5b6020830191508360208260051b8501011115610acf57600080fd5b6000806000806040858703121561347257600080fd5b843567ffffffffffffffff8082111561348a57600080fd5b61349688838901613417565b909650945060208701359150808211156134af57600080fd5b506134bc87828801613417565b95989497509550505050565b6000602082840312156134da57600080fd5b612f10826133dd565b600080600080608085870312156134f957600080fd5b61350285613115565b935061351060208601613115565b925060408501359150606085013567ffffffffffffffff81111561353357600080fd5b8501601f8101871361354457600080fd5b613553878235602084016132bf565b91505092959194509250565b6000806040838503121561357257600080fd5b61357b83613115565b915061321860208401613115565b600181811c9082168061359d57607f821691505b6020821081036135bd57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761073f5761073f6135c3565b60008261360d57634e487b7160e01b600052601260045260246000fd5b500490565b601f82111561090757600081815260208120601f850160051c810160208610156136395750805b601f850160051c820191505b8181101561365857828155600101613645565b505050505050565b815167ffffffffffffffff81111561367a5761367a6132a9565b61368e816136888454613589565b84613612565b602080601f8311600181146136c357600084156136ab5750858301515b600019600386901b1c1916600185901b178555613658565b600085815260208120601f198616915b828110156136f2578886015182559484019460019091019084016136d3565b50858210156137105787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b600060018201613748576137486135c3565b5060010190565b8082018082111561073f5761073f6135c3565b600080845461377081613589565b60018281168015613788576001811461379d576137cc565b60ff19841687528215158302870194506137cc565b8860005260208060002060005b858110156137c35781548a8201529084019082016137aa565b50505082870194505b5050505083516137e0818360208801613179565b7f2e6a736f6e0000000000000000000000000000000000000000000000000000009101908152600501949350505050565b600081613820576138206135c3565b506000190190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613860816017850160208801613179565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161389d816028840160208801613179565b01602801949350505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526138db608083018461319d565b9695505050505050565b6000602082840312156138f757600080fd5b8151612f10816130e256fe697066733a2f2f516d633851446270775132516a624845444a616853316b574e374b6d384168786a4752654e4c4a34676278524d482fa26469706673582212208c6d64cb822078bb9f0ad1decb16027af670c38701ed7b824f307640bd67e26164736f6c63430008110033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102e95760003560e01c806370a0823111610191578063ac52e644116100e3578063bf5bf5f811610097578063d547741f11610071578063d547741f146106b4578063e985e9c5146106c7578063f2fde38b1461070357600080fd5b8063bf5bf5f814610675578063c4d66de81461068e578063c87b56dd146106a157600080fd5b8063b1a6505f116100c8578063b1a6505f1461062b578063b7c0b8e81461064f578063b88d4fde1461066257600080fd5b8063ac52e64414610605578063b0e25d1f1461061857600080fd5b80638da5cb5b1161014557806395d89b411161011f57806395d89b41146105e2578063a217fddf146105ea578063a22cb465146105f257600080fd5b80638da5cb5b1461058557806391d148541461059657806394d216d6146105cf57600080fd5b806372abc8b71161017657806372abc8b71461053057806373aa9e94146105525780638462151c1461056557600080fd5b806370a0823114610515578063715018a61461052857600080fd5b80632a55205a1161024a57806340a9c8df116101fe5780636352211e116101d85780636352211e146104d9578063650b00f6146104ec5780636c0360eb1461050d57600080fd5b806340a9c8df146104a057806342842e0e146104b357806355f804b3146104c657600080fd5b80632f2ff15d1161022f5780632f2ff15d1461047157806332cb6b0c1461048457806336568abe1461048d57600080fd5b80632a55205a1461040a5780632cba81231461043c57600080fd5b8063095ea7b3116102a157806323b872dd1161028657806323b872dd146103c1578063248a9ca3146103d45780632799cde0146103f757600080fd5b8063095ea7b3146103a557806318160ddd146103b857600080fd5b806306fdde03116102d257806306fdde031461032b578063081812fc1461034057806309308e5d1461036b57600080fd5b806301ffc9a7146102ee57806304634d8d14610316575b600080fd5b6103016102fc3660046130f8565b610716565b60405190151581526020015b60405180910390f35b610329610324366004613131565b610745565b005b61033361075b565b60405161030d91906131c9565b61035361034e3660046131dc565b6107ed565b6040516001600160a01b03909116815260200161030d565b6103976103793660046131f5565b61010360209081526000928352604080842090915290825290205481565b60405190815260200161030d565b6103296103b3366004613221565b61087a565b61010554610397565b6103296103cf36600461324b565b61090c565b6103976103e23660046131dc565b60009081526065602052604090206001015490565b6103296104053660046131dc565b6109a7565b61041d610418366004613287565b610a19565b604080516001600160a01b03909316835260208301919091520161030d565b61035361044a366004613287565b6101026020908152600092835260408084209091529082529020546001600160a01b031681565b61032961047f3660046131f5565b610ad6565b61039761271181565b61032961049b3660046131f5565b610afb565b6103296104ae3660046131dc565b610b83565b6103296104c136600461324b565b610bf5565b6103296104d4366004613335565b610c8a565b6103536104e73660046131dc565b610c9f565b6103976104fa3660046131dc565b6101016020526000908152604090205481565b610333610d3f565b61039761052336600461337e565b610dce565b610329610eb3565b61030161053e3660046131dc565b600090815261010160205260409020541590565b61032961056036600461337e565b610ec7565b61057861057336600461337e565b610f05565b60405161030d9190613399565b60ce546001600160a01b0316610353565b6103016105a43660046131f5565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6103296105dd3660046131f5565b610fcc565b61033361103f565b610397600081565b6103296106003660046133ed565b61104e565b61032961061336600461345c565b611092565b61032961062636600461345c565b611188565b61030161063936600461337e565b6101006020526000908152604090205460ff1681565b61032961065d3660046134c8565b611233565b6103296106703660046134e3565b61124f565b610106546103539061010090046001600160a01b031681565b61032961069c36600461337e565b6112e5565b6103336106af3660046131dc565b611565565b6103296106c23660046131f5565b611604565b6103016106d536600461355f565b6001600160a01b03918216600090815260cd6020908152604080832093909416825291909152205460ff1690565b61032961071136600461337e565b611629565b6000610721826116b9565b8061073057506107308261175b565b8061073f575061073f82611795565b92915050565b61074d6117fc565b6107578282611856565b5050565b606060c9805461076a90613589565b80601f016020809104026020016040519081016040528092919081815260200182805461079690613589565b80156107e35780601f106107b8576101008083540402835291602001916107e3565b820191906000526020600020905b8154815290600101906020018083116107c657829003601f168201915b5050505050905090565b60006107f882611970565b61085e5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b50600090815260cc60205260409020546001600160a01b031690565b81731e0049783f008a0085193e00003d00cd54003c716001600160a01b038216146108b4576101065460ff16156108b4576108b4816119ba565b60008281526101016020526040902054156108fd5760405162461bcd60e51b8152602060048201526009602482015268085d5b9b1bd8dad95960ba1b6044820152606401610855565b61090783836119fe565b505050565b826001600160a01b038116331461094d57731e0049783f008a0085193e00003d00cd54003c71331461094d576101065460ff161561094d5761094d336119ba565b60008281526101016020526040902054156109965760405162461bcd60e51b8152602060048201526009602482015268085d5b9b1bd8dad95960ba1b6044820152606401610855565b6109a1848484611b0e565b50505050565b7f07454e0c519d1acf802b31f5a8b363de38a0e959080fe8d1d1d1f1b25eabc4376109d181611b95565b6109da82611970565b610a105760405162461bcd60e51b81526020600482015260076024820152662165786973747360c81b6044820152606401610855565b61075782611b9f565b60008281526098602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046bffffffffffffffffffffffff16928201929092528291610a985750604080518082019091526097546001600160a01b0381168252600160a01b90046bffffffffffffffffffffffff1660208201525b602081015160009061271090610abc906bffffffffffffffffffffffff16876135d9565b610ac691906135f0565b91519350909150505b9250929050565b600082815260656020526040902060010154610af181611b95565b6109078383611d09565b6001600160a01b0381163314610b795760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610855565b6107578282611dab565b7f07454e0c519d1acf802b31f5a8b363de38a0e959080fe8d1d1d1f1b25eabc437610bad81611b95565b610bb682611970565b610bec5760405162461bcd60e51b81526020600482015260076024820152662165786973747360c81b6044820152606401610855565b61075782611e2e565b826001600160a01b0381163314610c3657731e0049783f008a0085193e00003d00cd54003c713314610c36576101065460ff1615610c3657610c36336119ba565b6000828152610101602052604090205415610c7f5760405162461bcd60e51b8152602060048201526009602482015268085d5b9b1bd8dad95960ba1b6044820152606401610855565b6109a1848484611ffa565b610c926117fc565b6101046107578282613660565b60008060cb8381548110610cb557610cb5613720565b6000918252602090912001546001600160a01b031690508061073f5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610855565b6101048054610d4d90613589565b80601f0160208091040260200160405190810160405280929190818152602001828054610d7990613589565b8015610dc65780601f10610d9b57610100808354040283529160200191610dc6565b820191906000526020600020905b815481529060010190602001808311610da957829003601f168201915b505050505081565b60006001600160a01b038216610e4c5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610855565b60cb54600090815b81811015610eaa5760cb8181548110610e6f57610e6f613720565b6000918252602090912001546001600160a01b0390811690861603610e9a57610e9783613736565b92505b610ea381613736565b9050610e54565b50909392505050565b610ebb6117fc565b610ec56000612015565b565b610ecf6117fc565b61010680546001600160a01b039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b6060600080610f1384610dce565b905060008167ffffffffffffffff811115610f3057610f306132a9565b604051908082528060200260200182016040528015610f59578160200160208202803683370190505b50905060005b828414610fc357610f6f81611970565b15610fbb57856001600160a01b0316610f8782610c9f565b6001600160a01b031603610fbb5780828580600101965081518110610fae57610fae613720565b6020026020010181815250505b600101610f5f565b50949350505050565b7f07454e0c519d1acf802b31f5a8b363de38a0e959080fe8d1d1d1f1b25eabc437610ff681611b95565b610fff83611970565b6110355760405162461bcd60e51b81526020600482015260076024820152662165786973747360c81b6044820152606401610855565b6109078383612067565b606060ca805461076a90613589565b81731e0049783f008a0085193e00003d00cd54003c716001600160a01b03821614611088576101065460ff161561108857611088816119ba565b6109078383612259565b61109a6117fc565b8281146110e95760405162461bcd60e51b815260206004820152600760248201527f216c656e677468000000000000000000000000000000000000000000000000006044820152606401610855565b60005b838110156111815782828281811061110657611106613720565b905060200201602081019061111b91906134c8565b610100600087878581811061113257611132613720565b9050602002016020810190611147919061337e565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558061117981613736565b9150506110ec565b5050505050565b6111906117fc565b6101055483906000906111a490839061374f565b90508282146111b257600080fd5b6127118111156111c157600080fd5b60008060005b84811015611225578888828181106111e1576111e1613720565b9050602002013592508686828181106111fc576111fc613720565b9050602002016020810190611211919061337e565b915061121d828461231d565b6001016111c7565b505050610105555050505050565b61123b6117fc565b610106805460ff1916911515919091179055565b836001600160a01b038116331461129057731e0049783f008a0085193e00003d00cd54003c713314611290576101065460ff161561129057611290336119ba565b60008381526101016020526040902054156112d95760405162461bcd60e51b8152602060048201526009602482015268085d5b9b1bd8dad95960ba1b6044820152606401610855565b61118185858585612445565b600054610100900460ff16158080156113055750600054600160ff909116105b8061131f5750303b15801561131f575060005460ff166001145b6113915760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610855565b6000805460ff1916600117905580156113b4576000805461ff0019166101001790555b6114286040518060400160405280600f81526020017f4c616e64206f662056616c6572696100000000000000000000000000000000008152506040518060400160405280600381526020017f564f4c00000000000000000000000000000000000000000000000000000000008152506124cd565b611430612542565b6114386125b5565b6114406125b5565b61144b600033612620565b6114757fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e33612620565b61149f7f07454e0c519d1acf802b31f5a8b363de38a0e959080fe8d1d1d1f1b25eabc43733612620565b6114a761262a565b610106805460ff191660011790556114c76114bf3390565b61028a611856565b610106805474ffffffffffffffffffffffffffffffffffffffff0019166101006001600160a01b038516021790556040805160608101909152603680825261390360208301396101049061151b9082613660565b508015610757576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b606061157082611970565b6115a65760405162461bcd60e51b81526020600482015260076024820152662165786973747360c81b6044820152606401610855565b600061010480546115b690613589565b9050116115d2576040518060200160405280600081525061073f565b6101046115de83612649565b6040516020016115ef929190613762565b60405160208183030381529060405292915050565b60008281526065602052604090206001015461161f81611b95565b6109078383611dab565b6116316117fc565b6001600160a01b0381166116ad5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610855565b6116b681612015565b50565b60006001600160e01b031982167f80ac58cd00000000000000000000000000000000000000000000000000000000148061171c57506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061175057506001600160e01b031982167f780e9d6300000000000000000000000000000000000000000000000000000000145b8061073f575061073f825b60006001600160e01b031982167f2a55205a00000000000000000000000000000000000000000000000000000000148061073f575061073f825b60006001600160e01b031982167f7965db0b00000000000000000000000000000000000000000000000000000000148061073f57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b031983161461073f565b60ce546001600160a01b03163314610ec55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610855565b6127106bffffffffffffffffffffffff821611156118dc5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152608401610855565b6001600160a01b0382166119325760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610855565b604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff9091166020909201829052600160a01b90910217609755565b60cb546000908210801561073f575060006001600160a01b031660cb838154811061199d5761199d613720565b6000918252602090912001546001600160a01b0316141592915050565b69c617113400112233445560005230601a5280603a52600080604460166daaeb6d7670e522a718067333cd4e5afa6119f6573d6000803e3d6000fd5b6000603a5250565b6000611a0982610c9f565b9050806001600160a01b0316836001600160a01b031603611a765760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610855565b336001600160a01b0382161480611a925750611a9281336106d5565b611b045760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610855565b61090783836126e9565b611b183382612757565b611b8a5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610855565b610907838383612841565b6116b681336129c4565b336000908152610100602052604090205460ff16611bf35760405162461bcd60e51b8152602060048201526011602482015270043616e6e6f7420757064617465206d617607c1b6044820152606401610855565b60008181526101036020908152604080832033845290915290205415611c5b5760405162461bcd60e51b815260206004820152601b60248201527f494420616c7265616479206c6f636b65642062792063616c6c657200000000006044820152606401610855565b60008181526101016020526040812054611c7690600161374f565b600083815261010260209081526040808320848452825280832080546001600160a01b03191633908117909155868452610103835281842090845282528083208490558583526101019091528120805492935090611cd383613736565b9091555050604051339083907f9ecfd70e9ff36df72989324a49559383d39f9290d700b10cf5ac10dcb68d264390600090a35050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff166107575760008281526065602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611d673390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16156107575760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b336000908152610100602052604090205460ff16611e825760405162461bcd60e51b8152602060048201526011602482015270043616e6e6f7420757064617465206d617607c1b6044820152606401610855565b60008181526101036020908152604080832033845290915281205490819003611eed5760405162461bcd60e51b815260206004820152601760248201527f4944206e6f74206c6f636b65642062792063616c6c65720000000000000000006044820152606401610855565b60008281526101016020526040902054818114611f66576000838152610102602090815260408083208484528252808320805486855282852080546001600160a01b03199081166001600160a01b0390931692831790915582541690915586845261010383528184209084529091529020829055611f8f565b600083815261010260209081526040808320858452909152902080546001600160a01b03191690555b60008381526101036020908152604080832033845282528083208390558583526101019091528120805491611fc383613811565b9091555050604051339084907f0fe7d9801197f79ef3b1595d19379eb58f0fff5f98b0f6d6f34c03cae5306c3790600090a3505050565b6109078383836040518060200160405280600081525061124f565b60ce80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0381166000908152610100602052604090205460ff16156120c55760405162461bcd60e51b8152602060048201526011602482015270043616e6e6f7420757064617465206d617607c1b6044820152606401610855565b6000828152610103602090815260408083206001600160a01b0385168452909152812054908190036121395760405162461bcd60e51b815260206004820152600d60248201527f4944206e6f74206c6f636b6564000000000000000000000000000000000000006044820152606401610855565b600083815261010160205260409020548181146121b2576000848152610102602090815260408083208484528252808320805486855282852080546001600160a01b03199081166001600160a01b03909316928317909155825416909155878452610103835281842090845290915290208290556121db565b600084815261010260209081526040808320858452909152902080546001600160a01b03191690555b6000848152610103602090815260408083206001600160a01b03871684528252808320839055868352610101909152812080549161221883613811565b90915550506040516001600160a01b0384169085907f0fe7d9801197f79ef3b1595d19379eb58f0fff5f98b0f6d6f34c03cae5306c3790600090a350505050565b336001600160a01b038316036122b15760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610855565b33600081815260cd602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6001600160a01b0382166123735760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610855565b61237c81611970565b156123c95760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610855565b60cb805460018101825560009182527fa7ce836d032b2bf62b7e2097a8e0a6d8aeb35405ad15271e96d3b0188a1d06fb0180546001600160a01b0319166001600160a01b0385169081179091556040518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b61244f3383612757565b6124c15760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610855565b6109a184848484612a39565b600054610100900460ff166125385760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610855565b6107578282612ac2565b600054610100900460ff166125ad5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610855565b610ec5612b8b565b600054610100900460ff16610ec55760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610855565b6107578282611d09565b610ec5733cc6cdda760b79bafa08df41ecfa224f810dceb66001612bfe565b6060600061265683612c73565b600101905060008167ffffffffffffffff811115612676576126766132a9565b6040519080825280601f01601f1916602001820160405280156126a0576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846126aa57509392505050565b600081815260cc6020526040902080546001600160a01b0319166001600160a01b038416908117909155819061271e82610c9f565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061276282611970565b6127c35760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610855565b60006127ce83610c9f565b9050806001600160a01b0316846001600160a01b031614806128095750836001600160a01b03166127fe846107ed565b6001600160a01b0316145b8061283957506001600160a01b03808216600090815260cd602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661285482610c9f565b6001600160a01b0316146128d05760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610855565b6001600160a01b03821661294b5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610855565b6129566000826126e9565b8160cb828154811061296a5761296a613720565b6000918252602082200180546001600160a01b0319166001600160a01b03938416179055604051839285811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a4505050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610757576129f781612d55565b612a02836020612d67565b604051602001612a13929190613828565b60408051601f198184030181529082905262461bcd60e51b8252610855916004016131c9565b612a44848484612841565b612a5084848484612f17565b6109a15760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610855565b600054610100900460ff16612b2d5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610855565b60c9612b398382613660565b5060ca612b468282613660565b505060cb80546001810182556000919091527fa7ce836d032b2bf62b7e2097a8e0a6d8aeb35405ad15271e96d3b0188a1d06fb0180546001600160a01b031916905550565b600054610100900460ff16612bf65760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610855565b610ec561306e565b6001600160a01b0390911690637d3e3dbe81612c2b5782612c245750634420e486612c2b565b5063a0af29035b8060e01b60005230600452826024526004600060446000806daaeb6d7670e522a718067333cd4e5af1612c69578060005160e01c03612c6957600080fd5b5060006024525050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612cbc577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310612ce8576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612d0657662386f26fc10000830492506010015b6305f5e1008310612d1e576305f5e100830492506008015b6127108310612d3257612710830492506004015b60648310612d44576064830492506002015b600a831061073f5760010192915050565b606061073f6001600160a01b03831660145b60606000612d768360026135d9565b612d8190600261374f565b67ffffffffffffffff811115612d9957612d996132a9565b6040519080825280601f01601f191660200182016040528015612dc3576020820181803683370190505b509050600360fc1b81600081518110612dde57612dde613720565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612e0d57612e0d613720565b60200101906001600160f81b031916908160001a9053506000612e318460026135d9565b612e3c90600161374f565b90505b6001811115612ec1577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612e7d57612e7d613720565b1a60f81b828281518110612e9357612e93613720565b60200101906001600160f81b031916908160001a90535060049490941c93612eba81613811565b9050612e3f565b508315612f105760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610855565b9392505050565b60006001600160a01b0384163b1561306357604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612f5b9033908990889088906004016138a9565b6020604051808303816000875af1925050508015612f96575060408051601f3d908101601f19168201909252612f93918101906138e5565b60015b613049573d808015612fc4576040519150601f19603f3d011682016040523d82523d6000602084013e612fc9565b606091505b5080516000036130415760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610855565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612839565b506001949350505050565b600054610100900460ff166130d95760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610855565b610ec533612015565b6001600160e01b0319811681146116b657600080fd5b60006020828403121561310a57600080fd5b8135612f10816130e2565b80356001600160a01b038116811461312c57600080fd5b919050565b6000806040838503121561314457600080fd5b61314d83613115565b915060208301356bffffffffffffffffffffffff8116811461316e57600080fd5b809150509250929050565b60005b8381101561319457818101518382015260200161317c565b50506000910152565b600081518084526131b5816020860160208601613179565b601f01601f19169290920160200192915050565b602081526000612f10602083018461319d565b6000602082840312156131ee57600080fd5b5035919050565b6000806040838503121561320857600080fd5b8235915061321860208401613115565b90509250929050565b6000806040838503121561323457600080fd5b61323d83613115565b946020939093013593505050565b60008060006060848603121561326057600080fd5b61326984613115565b925061327760208501613115565b9150604084013590509250925092565b6000806040838503121561329a57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156132da576132da6132a9565b604051601f8501601f19908116603f01168101908282118183101715613302576133026132a9565b8160405280935085815286868601111561331b57600080fd5b858560208301376000602087830101525050509392505050565b60006020828403121561334757600080fd5b813567ffffffffffffffff81111561335e57600080fd5b8201601f8101841361336f57600080fd5b612839848235602084016132bf565b60006020828403121561339057600080fd5b612f1082613115565b6020808252825182820181905260009190848201906040850190845b818110156133d1578351835292840192918401916001016133b5565b50909695505050505050565b8035801515811461312c57600080fd5b6000806040838503121561340057600080fd5b61340983613115565b9150613218602084016133dd565b60008083601f84011261342957600080fd5b50813567ffffffffffffffff81111561344157600080fd5b6020830191508360208260051b8501011115610acf57600080fd5b6000806000806040858703121561347257600080fd5b843567ffffffffffffffff8082111561348a57600080fd5b61349688838901613417565b909650945060208701359150808211156134af57600080fd5b506134bc87828801613417565b95989497509550505050565b6000602082840312156134da57600080fd5b612f10826133dd565b600080600080608085870312156134f957600080fd5b61350285613115565b935061351060208601613115565b925060408501359150606085013567ffffffffffffffff81111561353357600080fd5b8501601f8101871361354457600080fd5b613553878235602084016132bf565b91505092959194509250565b6000806040838503121561357257600080fd5b61357b83613115565b915061321860208401613115565b600181811c9082168061359d57607f821691505b6020821081036135bd57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761073f5761073f6135c3565b60008261360d57634e487b7160e01b600052601260045260246000fd5b500490565b601f82111561090757600081815260208120601f850160051c810160208610156136395750805b601f850160051c820191505b8181101561365857828155600101613645565b505050505050565b815167ffffffffffffffff81111561367a5761367a6132a9565b61368e816136888454613589565b84613612565b602080601f8311600181146136c357600084156136ab5750858301515b600019600386901b1c1916600185901b178555613658565b600085815260208120601f198616915b828110156136f2578886015182559484019460019091019084016136d3565b50858210156137105787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b600060018201613748576137486135c3565b5060010190565b8082018082111561073f5761073f6135c3565b600080845461377081613589565b60018281168015613788576001811461379d576137cc565b60ff19841687528215158302870194506137cc565b8860005260208060002060005b858110156137c35781548a8201529084019082016137aa565b50505082870194505b5050505083516137e0818360208801613179565b7f2e6a736f6e0000000000000000000000000000000000000000000000000000009101908152600501949350505050565b600081613820576138206135c3565b506000190190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613860816017850160208801613179565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161389d816028840160208801613179565b01602801949350505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526138db608083018461319d565b9695505050505050565b6000602082840312156138f757600080fd5b8151612f10816130e256fe697066733a2f2f516d633851446270775132516a624845444a616853316b574e374b6d384168786a4752654e4c4a34676278524d482fa26469706673582212208c6d64cb822078bb9f0ad1decb16027af670c38701ed7b824f307640bd67e26164736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.