Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
NftProfile
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 0 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity >=0.8.16; import "../interface/INftProfile.sol"; import "../interface/IProfileAuction.sol"; import "../interface/INftProfileHelper.sol"; import "../erc721a/ERC721AProfileUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; contract NftProfile is Initializable, ERC721AProfileUpgradeable, ReentrancyGuardUpgradeable, UUPSUpgradeable, INftProfile { using SafeMathUpgradeable for uint256; mapping(uint256 => string) internal _tokenURIs; mapping(string => uint256) internal _tokenUsedURIs; mapping(string => uint256) internal _expiryTimeline; address public profileAuctionContract; uint96 public protocolFee; address public owner; event NewFee(uint256 _fee); function _onlyOwner() private view { require(msg.sender == owner); } modifier onlyOwner() { _onlyOwner(); _; } function initialize( string memory name, string memory symbol, string memory baseURI ) public initializer { __ReentrancyGuard_init(); __ERC721A_init(name, symbol, baseURI); __UUPSUpgradeable_init(); protocolFee = 200; // 2% fee owner = msg.sender; } function _authorizeUpgrade(address) internal override onlyOwner {} /** @notice helper function to finalize a URI in storage @param _tokenId the ID of the NFT.com profile @param _tokenURI the string name of a NFT.com profile */ function setTokenURI(uint256 _tokenId, string memory _tokenURI) private { require(_exists(_tokenId), "exists"); require(_tokenUsedURIs[_tokenURI] == 0, "unsuedURI"); _tokenURIs[_tokenId] = _tokenURI; // adds 1 to preserve 0 being the default not found case _tokenUsedURIs[_tokenURI] = _tokenId.add(1); } /** @dev transfers trademarked profile to recipient @param _profiles profile url being transferred */ function tradeMarkTransfer(TrademarkTransfer[] memory _profiles) external onlyOwner { for(uint256 i = 0; i < _profiles.length; i++) { require(_tokenUsedURIs[_profiles[i].url] != 0); uint256 tokenId = _tokenUsedURIs[_profiles[i].url].sub(1); _transferAdmin(ERC721AProfileUpgradeable.ownerOf(tokenId), _profiles[i].to, tokenId); } } function _validURI(string memory url) private view { address nftProfileHelperAddress = IProfileAuction(profileAuctionContract).nftProfileHelperAddress(); require(INftProfileHelper(nftProfileHelperAddress)._validURI(url), "!validNewUrl"); } /** @dev edits trademarked profiles to valid url @param _profiles array of profiles being burned */ function tradeMarkEdit(TrademarkEdit[] memory _profiles) external onlyOwner { for (uint256 i = 0; i < _profiles.length; i++) { // checks require(_tokenUsedURIs[_profiles[i].oldUrl] != 0); // make sure old url exists as tokenId uint256 tokenId = _tokenUsedURIs[_profiles[i].oldUrl].sub(1); // get tokenId of old url // effects _tokenUsedURIs[_profiles[i].oldUrl] = 0; // edit old url to be 0 (unusued) _tokenUsedURIs[_profiles[i].newUrl] = tokenId.add(1); // set new url to be tokenId // make sure new url confirms and is not taken _validURI(_profiles[i].newUrl); _tokenURIs[tokenId] = _profiles[i].newUrl; // set new tokenID <> tokenURL mapping } } function profileOwner(string memory _string) public view override returns (address) { return ownerOf(_tokenUsedURIs[_string].sub(1)); } /** @notice checks if a profile exists @param _string profile URI @return true is a profile exists and is minted for a given string */ function tokenUsed(string memory _string) public view override returns (bool) { return _tokenUsedURIs[_string] != 0; } /** @notice returns the tokenId of a particular profile @param _string profile URI @return the tokenId associated with a profile NFT */ function getTokenId(string memory _string) external view override returns (uint256) { return _tokenUsedURIs[_string].sub(1); } /** @notice returns the expiry timeline of a profile @param _string profile URI @return the unix timestamp of the expiry */ function getExpiryTimeline(string[] memory _string) external view returns (uint256[] memory) { uint256[] memory expiryTimeline = new uint256[](_string.length); uint256 stringLength = _string.length; for (uint256 i = 0; i < stringLength;) { expiryTimeline[i] = _expiryTimeline[_string[i]]; unchecked { ++i; } } return expiryTimeline; } /** @notice helper function that sets the profile auction (split deployment) @param _profileAuctionContract address of the profile auction contract */ function setProfileAuction(address _profileAuctionContract) external onlyOwner { profileAuctionContract = _profileAuctionContract; } function setOwner(address _new) external onlyOwner { owner = _new; } function setProtocolFee(uint96 _fee) external onlyOwner { require(_fee <= 2000); // 20% protocolFee = _fee; emit NewFee(_fee); } /** @notice helper function used to mint profile, set URI, bid details @param _receiver the user who bought the profile @param _profileURI profile username @param _duration seconds to add to expiry */ function createProfile( address _receiver, string memory _profileURI, uint256 _duration ) external override { require(msg.sender == profileAuctionContract); _validURI(_profileURI); require(!tokenUsed(_profileURI), "!unused"); uint256 preSupply = totalSupply(); _mint(_receiver, 1, "", false); setTokenURI(preSupply, _profileURI); _expiryTimeline[_profileURI] = block.timestamp + _duration; emit ExtendExpiry(_profileURI, _expiryTimeline[_profileURI]); } /** @notice helper function used to extend existing profile registration @param _profileURI profile username @param _duration seconds to add to expiry @param _licensee seconds to add to expiry */ function extendLicense( string memory _profileURI, uint256 _duration, address _licensee ) external override { // checks require(_exists(_tokenUsedURIs[_profileURI])); require(msg.sender == profileAuctionContract, "!auc"); require(ownerOf(_tokenUsedURIs[_profileURI].sub(1)) == _licensee, "!owner"); // effects // add addition if not expired if (_expiryTimeline[_profileURI] >= block.timestamp) { _expiryTimeline[_profileURI] += _duration; } else { // set current timestamp to expiry + _duration _expiryTimeline[_profileURI] = block.timestamp + _duration; } emit ExtendExpiry(_profileURI, _expiryTimeline[_profileURI]); } function purchaseExpiredProfile( string memory _profileURI, uint256 _duration, address _receiver ) external override { // checks require(_exists(_tokenUsedURIs[_profileURI])); require(msg.sender == profileAuctionContract, "!auc"); require(_expiryTimeline[_profileURI] < block.timestamp, "!expired"); uint256 tokenId = _tokenUsedURIs[_profileURI].sub(1); require(ownerOf(tokenId) != _receiver, "!receiver"); // effects _expiryTimeline[_profileURI] = block.timestamp + _duration; // interactions _transferAdmin(ERC721AProfileUpgradeable.ownerOf(tokenId), _receiver, tokenId); emit ExtendExpiry(_profileURI, _expiryTimeline[_profileURI]); } /** @notice returns URI for a profile token @param tokenId the ID of the NFT.com profile @return URI string, which contains JSON spec */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "!exists"); return string(abi.encodePacked(_baseURI(), _tokenURIs[tokenId])); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.0; /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822ProxiableUpgradeable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeaconUpgradeable { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeaconUpgradeable.sol"; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/StorageSlotUpgradeable.sol"; import "../utils/Initializable.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ * * @custom:oz-upgrades-unsafe-allow delegatecall */ abstract contract ERC1967UpgradeUpgradeable is Initializable { function __ERC1967Upgrade_init() internal onlyInitializing { } function __ERC1967Upgrade_init_unchained() internal onlyInitializing { } // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall( address newImplementation, bytes memory data, bool forceCall ) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { _functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallUUPS( address newImplementation, bytes memory data, bool forceCall ) internal { // Upgrades from old implementations will perform a rollback test. This test requires the new // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing // this special case will break upgrade paths from old UUPS implementation to new ones. if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else { try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) { require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID"); } catch { revert("ERC1967Upgrade: new implementation is not UUPS"); } _upgradeToAndCall(newImplementation, data, forceCall); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Emitted when the beacon is upgraded. */ event BeaconUpgraded(address indexed beacon); /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall( address newBeacon, bytes memory data, bool forceCall ) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data); } } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) { require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed"); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Internal function that returns the initialized version. Returns `_initialized` */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Internal function that returns the initialized version. Returns `_initializing` */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.0; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../ERC1967/ERC1967UpgradeUpgradeable.sol"; import "./Initializable.sol"; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. * * _Available since v4.1._ */ abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable { function __UUPSUpgradeable_init() internal onlyInitializing { } function __UUPSUpgradeable_init_unchained() internal onlyInitializing { } /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address private immutable __self = address(this); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { require(address(this) != __self, "Function must be called through delegatecall"); require(_getImplementation() == __self, "Function must be called through active proxy"); _; } /** * @dev Check that the execution is not being performed through a delegate call. This allows a function to be * callable on the implementing contract but not through proxies. */ modifier notDelegated() { require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall"); _; } /** * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the * implementation. It is used to validate the implementation's compatibility when performing an upgrade. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier. */ function proxiableUUID() external view virtual override notDelegated returns (bytes32) { return _IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeTo(address newImplementation) external virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, new bytes(0), false); } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, data, true); } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeTo} and {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal override onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardUpgradeable is Initializable { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev 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 (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.7.0) (utils/StorageSlot.sol) pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlotUpgradeable { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } }
// 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 // Creator: Chiru Labs pragma solidity ^0.8.4; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; error ApprovalCallerNotOwnerNorApproved(); error ApprovalQueryForNonexistentToken(); error ApproveToCaller(); error ApprovalToCurrentOwner(); error BalanceQueryForZeroAddress(); error MintToZeroAddress(); error MintZeroQuantity(); error OwnerQueryForNonexistentToken(); error TransferCallerNotOwnerNorApproved(); error TransferFromIncorrectOwner(); error TransferToNonERC721ReceiverImplementer(); error TransferToZeroAddress(); error URIQueryForNonexistentToken(); /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..). * * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721AProfileUpgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable for uint256; // Compiler will pack this into a single 256bit word. struct TokenOwnership { // The address of the owner. address addr; // Keeps track of the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; } // Compiler will pack this into a single 256bit word. struct AddressData { // Realistically, 2**64-1 is more than enough. uint64 balance; // Keeps track of mint count with minimal overhead for tokenomics. uint64 numberMinted; // Keeps track of burn count with minimal overhead for tokenomics. uint64 numberBurned; // For miscellaneous variable(s) pertaining to the address // (e.g. number of whitelist mint slots used). // If there are multiple variables, please pack them into a uint64. uint64 aux; } // The tokenId of the next token to be minted. uint256 internal _currentIndex; // The number of tokens burned. uint256 internal _burnCounter; // Token name string private _name; // Token symbol string private _symbol; string private defaultBaseURI; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. See _ownershipOf implementation for details. mapping(uint256 => TokenOwnership) internal _ownerships; // Mapping owner address to address data mapping(address => AddressData) private _addressData; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; function __ERC721A_init( string memory name_, string memory symbol_, string memory defaultBaseURI_ ) internal initializer { __Context_init_unchained(); __ERC165_init_unchained(); __ERC721A_init_unchained(name_, symbol_, defaultBaseURI_); } function __ERC721A_init_unchained( string memory name_, string memory symbol_, string memory defaultBaseURI_ ) internal initializer { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); defaultBaseURI = defaultBaseURI_; } /** * To change the starting tokenId, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens. */ function totalSupply() public view returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than _currentIndex - _startTokenId() times unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view returns (uint256) { // Counter underflow is impossible as _currentIndex does not decrement, // and it is initialized to _startTokenId() unchecked { return _currentIndex - _startTokenId(); } } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return uint256(_addressData[owner].balance); } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return uint256(_addressData[owner].numberMinted); } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return uint256(_addressData[owner].numberBurned); } /** * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return _addressData[owner].aux; } /** * Sets the auxillary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal { _addressData[owner].aux = aux; } // returns owners from [startIndex, endIndex] inclusive function multiOwnerOf(uint256 startIndex, uint256 endIndex) external view returns (address[] memory) { require(startIndex <= endIndex); address[] memory addrBalances = new address[](endIndex - startIndex + 1); for (uint256 i = 0; i <= endIndex - startIndex; i++) { addrBalances[i] = ownerOf(startIndex + i); } return addrBalances; } /** * Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around in the collection over time. */ function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr && curr < _currentIndex) { TokenOwnership memory ownership = _ownerships[curr]; if (!ownership.burned) { if (ownership.addr != address(0)) { return ownership; } // Invariant: // There will always be an ownership that has an address and is not burned // before an ownership that does not have an address and is not burned. // Hence, curr will not underflow. while (true) { curr--; ownership = _ownerships[curr]; if (ownership.addr != address(0)) { return ownership; } } } } } revert OwnerQueryForNonexistentToken(); } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { return _ownershipOf(tokenId).addr; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return defaultBaseURI; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public override { address owner = ERC721AProfileUpgradeable.ownerOf(tokenId); if (to == owner) revert ApprovalToCurrentOwner(); if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) { revert ApprovalCallerNotOwnerNorApproved(); } _approve(to, tokenId, owner); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { if (operator == _msgSender()) revert ApproveToCaller(); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { _transfer(from, to, tokenId); if (to.isContract() && !_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), */ function _exists(uint256 tokenId) internal view returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && !_ownerships[tokenId].burned; } function _safeMint(address to, uint256 quantity) internal { _safeMint(to, quantity, ""); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { _mint(to, quantity, _data, true); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _mint( address to, uint256 quantity, bytes memory _data, bool safe ) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1 // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1 unchecked { _addressData[to].balance += uint64(quantity); _addressData[to].numberMinted += uint64(quantity); _ownerships[startTokenId].addr = to; _ownerships[startTokenId].startTimestamp = uint64(block.timestamp); uint256 updatedIndex = startTokenId; uint256 end = updatedIndex + quantity; if (safe && to.isContract()) { do { emit Transfer(address(0), to, updatedIndex); if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (updatedIndex != end); // Reentrancy protection if (_currentIndex != startTokenId) revert(); } else { do { emit Transfer(address(0), to, updatedIndex++); } while (updatedIndex != end); } _currentIndex = updatedIndex; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal { TokenOwnership memory prevOwnership = _ownershipOf(tokenId); if (prevOwnership.addr != from) revert TransferFromIncorrectOwner(); bool isApprovedOrOwner = (_msgSender() == from || isApprovedForAll(from, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, from); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256. unchecked { _addressData[from].balance -= 1; _addressData[to].balance += 1; TokenOwnership storage currSlot = _ownerships[tokenId]; currSlot.addr = to; currSlot.startTimestamp = uint64(block.timestamp); // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; TokenOwnership storage nextSlot = _ownerships[nextTokenId]; if (nextSlot.addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId != _currentIndex) { nextSlot.addr = from; nextSlot.startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } function _transferAdmin( address from, address to, uint256 tokenId ) internal { TokenOwnership memory prevOwnership = _ownershipOf(tokenId); if (prevOwnership.addr != from) revert TransferFromIncorrectOwner(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, from); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256. unchecked { _addressData[from].balance -= 1; _addressData[to].balance += 1; TokenOwnership storage currSlot = _ownerships[tokenId]; currSlot.addr = to; currSlot.startTimestamp = uint64(block.timestamp); // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; TokenOwnership storage nextSlot = _ownerships[nextTokenId]; if (nextSlot.addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId != _currentIndex) { nextSlot.addr = from; nextSlot.startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev This is equivalent to _burn(tokenId, false) */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { TokenOwnership memory prevOwnership = _ownershipOf(tokenId); address from = prevOwnership.addr; if (approvalCheck) { bool isApprovedOrOwner = (_msgSender() == from || isApprovedForAll(from, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, from); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256. unchecked { AddressData storage addressData = _addressData[from]; addressData.balance -= 1; addressData.numberBurned += 1; // Keep track of who burned the token, and the timestamp of burning. TokenOwnership storage currSlot = _ownerships[tokenId]; currSlot.addr = from; currSlot.startTimestamp = uint64(block.timestamp); currSlot.burned = true; // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; TokenOwnership storage nextSlot = _ownerships[nextTokenId]; if (nextSlot.addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId != _currentIndex) { nextSlot.addr = from; nextSlot.startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve( address to, uint256 tokenId, address owner ) private { _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, _data) returns ( bytes4 retval ) { return retval == IERC721ReceiverUpgradeable(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } /** * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting. * And also called before burning one token. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes * minting. * And also called after one token has been burned. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @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[43] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.16; struct TrademarkTransfer { string url; address to; } struct TrademarkEdit { string oldUrl; string newUrl; } interface INftProfile { event ExtendExpiry(string _profileURI, uint256 _extendedExpiry); function createProfile(address receiver, string memory _profileURI, uint256 _expiry) external; function extendLicense(string memory _profileURI, uint256 _duration, address _licensee) external; function purchaseExpiredProfile(string memory _profileURI, uint256 _duration, address _receiver) external; function getTokenId(string memory _string) external view returns (uint256); function tokenUsed(string memory _string) external view returns (bool); function profileOwner(string memory _string) external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.16; interface INftProfileHelper { function _validURI(string memory _name) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.16; error AddressNotFound(); error MaxArray(); error DuplicateAddress(); error NotOwner(); error InvalidAddress(); error InvalidRegex(); error InvalidSelf(); error ProfileNotFound(); interface IProfileAuction { function nftProfileHelperAddress() external view returns (address); }
{ "metadata": { "bytecodeHash": "none" }, "optimizer": { "enabled": true, "runs": 0 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_profileURI","type":"string"},{"indexed":false,"internalType":"uint256","name":"_extendedExpiry","type":"uint256"}],"name":"ExtendExpiry","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"NewFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"string","name":"_profileURI","type":"string"},{"internalType":"uint256","name":"_duration","type":"uint256"}],"name":"createProfile","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_profileURI","type":"string"},{"internalType":"uint256","name":"_duration","type":"uint256"},{"internalType":"address","name":"_licensee","type":"address"}],"name":"extendLicense","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":"string[]","name":"_string","type":"string[]"}],"name":"getExpiryTimeline","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_string","type":"string"}],"name":"getTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"baseURI","type":"string"}],"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":"startIndex","type":"uint256"},{"internalType":"uint256","name":"endIndex","type":"uint256"}],"name":"multiOwnerOf","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"profileAuctionContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_string","type":"string"}],"name":"profileOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFee","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_profileURI","type":"string"},{"internalType":"uint256","name":"_duration","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"purchaseExpiredProfile","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_new","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_profileAuctionContract","type":"address"}],"name":"setProfileAuction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint96","name":"_fee","type":"uint96"}],"name":"setProtocolFee","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":"string","name":"_string","type":"string"}],"name":"tokenUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"oldUrl","type":"string"},{"internalType":"string","name":"newUrl","type":"string"}],"internalType":"struct TrademarkEdit[]","name":"_profiles","type":"tuple[]"}],"name":"tradeMarkEdit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"url","type":"string"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct TrademarkTransfer[]","name":"_profiles","type":"tuple[]"}],"name":"tradeMarkTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"}]
Contract Creation Code
60a06040523060805234801561001457600080fd5b506080516133b161004c600039600081816109370152818161098001528181610b3201528181610b720152610bea01526133b16000f3fe6080604052600436106101895760003560e01c806301ffc9a71461018e57806306fdde03146101c3578063081812fc146101e5578063095ea7b31461021d57806313af40351461023f57806318160ddd1461025f5780631e7663bc14610282578063205e40d1146102a257806323b872dd146102c25780633659cfe6146102e257806342842e0e146103025780634872fd14146103225780634f1ef2861461034257806352d1902d146103555780635ba223a91461036a5780636352211e1461038a5780636b6dccfe146103aa57806370a08231146103ca5780637201bd96146103ea5780638da5cb5b1461040a57806395d89b411461042b5780639ed6e65514610440578063a22cb4651461046d578063a50508691461048d578063a6487c53146104ae578063b0e21e8a146104ce578063b88d4fde14610503578063c87b56dd14610523578063caba0ad614610543578063cdce569914610563578063de00084214610590578063e985e9c5146105b0578063f428d3ec146105f9578063fad1a5db14610619575b600080fd5b34801561019a57600080fd5b506101ae6101a9366004612630565b610639565b60405190151581526020015b60405180910390f35b3480156101cf57600080fd5b506101d861068b565b6040516101ba919061269d565b3480156101f157600080fd5b506102056102003660046126b0565b61071d565b6040516001600160a01b0390911681526020016101ba565b34801561022957600080fd5b5061023d6102383660046126de565b610761565b005b34801561024b57600080fd5b5061023d61025a36600461270a565b6107ee565b34801561026b57600080fd5b50606654606554035b6040519081526020016101ba565b34801561028e57600080fd5b5061027461029d366004612804565b610819565b3480156102ae57600080fd5b5061023d6102bd36600461285b565b610847565b3480156102ce57600080fd5b5061023d6102dd36600461295a565b610922565b3480156102ee57600080fd5b5061023d6102fd36600461270a565b61092d565b34801561030e57600080fd5b5061023d61031d36600461295a565b6109fe565b34801561032e57600080fd5b5061023d61033d36600461299b565b610a19565b61023d6103503660046129f3565b610b28565b34801561036157600080fd5b50610274610bdd565b34801561037657600080fd5b5061023d610385366004612a42565b610c8b565b34801561039657600080fd5b506102056103a53660046126b0565b610e0a565b3480156103b657600080fd5b5061023d6103c5366004612b40565b610e1c565b3480156103d657600080fd5b506102746103e536600461270a565b610e98565b3480156103f657600080fd5b506101ae610405366004612804565b610ee6565b34801561041657600080fd5b5061013354610205906001600160a01b031681565b34801561043757600080fd5b506101d8610f11565b34801561044c57600080fd5b5061046061045b366004612b69565b610f20565b6040516101ba9190612c0c565b34801561047957600080fd5b5061023d610488366004612c5e565b610fde565b34801561049957600080fd5b5061013254610205906001600160a01b031681565b3480156104ba57600080fd5b5061023d6104c9366004612c97565b611073565b3480156104da57600080fd5b50610132546104f690600160a01b90046001600160601b031681565b6040516101ba9190612d1e565b34801561050f57600080fd5b5061023d61051e366004612d32565b61116f565b34801561052f57600080fd5b506101d861053e3660046126b0565b6111bf565b34801561054f57600080fd5b5061023d61055e366004612d9d565b61123f565b34801561056f57600080fd5b5061058361057e366004612df7565b6113c2565b6040516101ba9190612e19565b34801561059c57600080fd5b506102056105ab366004612804565b61148f565b3480156105bc57600080fd5b506101ae6105cb366004612e5a565b6001600160a01b039182166000908152606d6020908152604080832093909416825291909152205460ff1690565b34801561060557600080fd5b5061023d61061436600461270a565b6114aa565b34801561062557600080fd5b5061023d610634366004612d9d565b6114d5565b60006001600160e01b031982166380ac58cd60e01b148061066a57506001600160e01b03198216635b5e139f60e01b145b8061068557506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606067805461069a90612e88565b80601f01602080910402602001604051908101604052809291908181526020018280546106c690612e88565b80156107135780601f106106e857610100808354040283529160200191610713565b820191906000526020600020905b8154815290600101906020018083116106f657829003601f168201915b5050505050905090565b600061072882611653565b610745576040516333d1c03960e21b815260040160405180910390fd5b506000908152606c60205260409020546001600160a01b031690565b600061076c82610e0a565b9050806001600160a01b0316836001600160a01b0316036107a05760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b038216148015906107c057506107be81336105cb565b155b156107de576040516367d9dca160e11b815260040160405180910390fd5b6107e983838361167f565b505050565b6107f66116db565b61013380546001600160a01b0319166001600160a01b0392909216919091179055565b60006106856001610130846040516108319190612ec2565b90815260405190819003602001902054906116f5565b61084f6116db565b60005b815181101561091e5761013082828151811061087057610870612ede565b6020026020010151600001516040516108899190612ec2565b9081526020016040518091039020546000036108a457600080fd5b60006108d960016101308585815181106108c0576108c0612ede565b6020026020010151600001516040516108319190612ec2565b905061090b6108e782610e0a565b8484815181106108f9576108f9612ede565b60200260200101516020015183611708565b508061091681612f0a565b915050610852565b5050565b6107e9838383611887565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361097e5760405162461bcd60e51b815260040161097590612f23565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166109b0611a62565b6001600160a01b0316146109d65760405162461bcd60e51b815260040161097590612f5d565b6109df81611a7e565b604080516000808252602082019092526109fb91839190611a86565b50565b6107e98383836040518060200160405280600081525061116f565b610132546001600160a01b03163314610a3157600080fd5b610a3a82611bf1565b610a4382610ee6565b15610a7a5760405162461bcd60e51b8152602060048201526007602482015266085d5b9d5cd95960ca1b6044820152606401610975565b6000610a896066546065540390565b9050610aa8846001604051806020016040528060008152506000611d0b565b610ab28184611ead565b610abc8242612f97565b61013184604051610acd9190612ec2565b9081526020016040518091039020819055506000805160206132de8339815191528361013185604051610b009190612ec2565b90815260405190819003602001812054610b1a9291612faa565b60405180910390a150505050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610b705760405162461bcd60e51b815260040161097590612f23565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610ba2611a62565b6001600160a01b031614610bc85760405162461bcd60e51b815260040161097590612f5d565b610bd182611a7e565b61091e82826001611a86565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610c785760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c6044820152771b1959081d1a1c9bdd59da0819195b1959d85d1958d85b1b60421b6064820152608401610975565b5060008051602061331e83398151915290565b610c936116db565b60005b815181101561091e57610130828281518110610cb457610cb4612ede565b602002602001015160000151604051610ccd9190612ec2565b908152602001604051809103902054600003610ce857600080fd5b6000610d0460016101308585815181106108c0576108c0612ede565b90506000610130848481518110610d1d57610d1d612ede565b602002602001015160000151604051610d369190612ec2565b90815260405190819003602001902055610d51816001611f90565b610130848481518110610d6657610d66612ede565b602002602001015160200151604051610d7f9190612ec2565b908152602001604051809103902081905550610db7838381518110610da657610da6612ede565b602002602001015160200151611bf1565b828281518110610dc957610dc9612ede565b60200260200101516020015161012f60008381526020019081526020016000209081610df5919061301a565b50508080610e0290612f0a565b915050610c96565b6000610e1582611f9c565b5192915050565b610e246116db565b6107d0816001600160601b03161115610e3c57600080fd5b61013280546001600160a01b0316600160a01b6001600160601b038416021790556040517f63fe946ed58429ac3c5e64d4356ff92c26d7fa1e73586515df8ba9f059ab54a590610e8d908390612d1e565b60405180910390a150565b60006001600160a01b038216610ec1576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152606b60205260409020546001600160401b031690565b600061013082604051610ef99190612ec2565b90815260405190819003602001902054151592915050565b60606068805461069a90612e88565b6060600082516001600160401b03811115610f3d57610f3d612727565b604051908082528060200260200182016040528015610f66578160200160208202803683370190505b50835190915060005b81811015610fd557610131858281518110610f8c57610f8c612ede565b6020026020010151604051610fa19190612ec2565b908152602001604051809103902054838281518110610fc257610fc2612ede565b6020908102919091010152600101610f6f565b50909392505050565b336001600160a01b038316036110075760405163b06307db60e01b815260040160405180910390fd5b336000818152606d602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600054610100900460ff16158080156110935750600054600160ff909116105b806110b457506110a2306120b6565b1580156110b4575060005460ff166001145b6110d05760405162461bcd60e51b8152600401610975906130d9565b6000805460ff1916600117905580156110f3576000805461ff0019166101001790555b6110fb6120c5565b6111068484846120f4565b61110e6121bf565b6101328054601960a31b6001600160a01b0390911617905561013380546001600160a01b031916331790558015611169576000805461ff00191690556040516001815260008051602061333e83398151915290602001610b1a565b50505050565b61117a848484611887565b61118c836001600160a01b03166120b6565b80156111a1575061119f848484846121e6565b155b15611169576040516368d2bf6b60e11b815260040160405180910390fd5b60606111ca82611653565b6112005760405162461bcd60e51b81526020600482015260076024820152662165786973747360c81b6044820152606401610975565b6112086122d2565b600083815261012f6020908152604091829020915161122993929101613127565b6040516020818303038152906040529050919050565b611267610130846040516112539190612ec2565b908152602001604051809103902054611653565b61127057600080fd5b610132546001600160a01b0316331461129b5760405162461bcd60e51b8152600401610975906131b4565b42610131846040516112ad9190612ec2565b908152602001604051809103902054106112f45760405162461bcd60e51b815260206004820152600860248201526708595e1c1a5c995960c21b6044820152606401610975565b600061130c6001610130866040516108319190612ec2565b9050816001600160a01b031661132182610e0a565b6001600160a01b0316036113635760405162461bcd60e51b815260206004820152600960248201526810b932b1b2b4bb32b960b91b6044820152606401610975565b61136d8342612f97565b6101318560405161137e9190612ec2565b908152604051908190036020019020556113a161139a82610e0a565b8383611708565b6000805160206132de8339815191528461013186604051610b009190612ec2565b6060818311156113d157600080fd5b60006113dd84846131d2565b6113e8906001612f97565b6001600160401b038111156113ff576113ff612727565b604051908082528060200260200182016040528015611428578160200160208202803683370190505b50905060005b61143885856131d2565b81116114875761144b6103a58287612f97565b82828151811061145d5761145d612ede565b6001600160a01b03909216602092830291909101909101528061147f81612f0a565b91505061142e565b509392505050565b60006106856103a56001610130856040516108319190612ec2565b6114b26116db565b61013280546001600160a01b0319166001600160a01b0392909216919091179055565b6114e9610130846040516112539190612ec2565b6114f257600080fd5b610132546001600160a01b0316331461151d5760405162461bcd60e51b8152600401610975906131b4565b806001600160a01b03166115406103a56001610130876040516108319190612ec2565b6001600160a01b03161461157f5760405162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b6044820152606401610975565b42610131846040516115919190612ec2565b908152602001604051809103902054106115df5781610131846040516115b79190612ec2565b908152602001604051809103902060008282546115d49190612f97565b9091555061160b9050565b6115e98242612f97565b610131846040516115fa9190612ec2565b908152604051908190036020019020555b6000805160206132de833981519152836101318560405161162c9190612ec2565b908152604051908190036020018120546116469291612faa565b60405180910390a1505050565b6000606554821080156106855750506000908152606a6020526040902054600160e01b900460ff161590565b6000828152606c602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b610133546001600160a01b031633146116f357600080fd5b565b600061170182846131d2565b9392505050565b600061171382611f9c565b9050836001600160a01b031681600001516001600160a01b03161461174a5760405162a1148160e81b815260040160405180910390fd5b6001600160a01b03831661177157604051633a954ecd60e21b815260040160405180910390fd5b61177d6000838661167f565b6001600160a01b038481166000908152606b6020908152604080832080546001600160401b03198082166001600160401b0392831660001901831617909255888616808652838620805493841693831660019081018416949094179055888652606a90945282852080546001600160e01b031916909417600160a01b4290921691909102178355860180845292208054919390911661185057606554821461185057805460208501516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038916171781555b50505081836001600160a01b0316856001600160a01b031660008051602061338583398151915260405160405180910390a4611169565b600061189282611f9c565b9050836001600160a01b031681600001516001600160a01b0316146118c95760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b03861614806118e757506118e785336105cb565b806119025750336118f78461071d565b6001600160a01b0316145b90508061192257604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03841661194957604051633a954ecd60e21b815260040160405180910390fd5b6119556000848761167f565b6001600160a01b038581166000908152606b6020908152604080832080546001600160401b03198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652606a90945282852080546001600160e01b031916909417600160a01b42909216919091021783558701808452922080549193909116611a28576065548214611a2857805460208601516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b031660008051602061338583398151915260405160405180910390a45b5050505050565b60008051602061331e833981519152546001600160a01b031690565b6109fb6116db565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611ab9576107e9836122e1565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611b13575060408051601f3d908101601f19168201909252611b10918101906131e5565b60015b611b765760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610975565b60008051602061331e8339815191528114611be55760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610975565b506107e983838361237b565b61013254604080516317e7f89d60e21b815290516000926001600160a01b031691635f9fe2749160048083019260209291908290030181865afa158015611c3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c6091906131fe565b604051634a9df57f60e01b81529091506001600160a01b03821690634a9df57f90611c8f90859060040161269d565b602060405180830381865afa158015611cac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cd0919061321b565b61091e5760405162461bcd60e51b815260206004820152600c60248201526b085d985b1a5913995dd55c9b60a21b6044820152606401610975565b6065546001600160a01b038516611d3457604051622e076360e81b815260040160405180910390fd5b83600003611d555760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b0385166000818152606b6020908152604080832080546001600160801b031981166001600160401b038083168c018116918217600160401b6001600160401b031990941690921783900481168c01811690920217909155858452606a90925290912080546001600160e01b031916909217600160a01b429092169190910217905580808501838015611dfb5750611dfb876001600160a01b03166120b6565b15611e71575b60405182906001600160a01b03891690600090600080516020613385833981519152908290a4611e3a60008884806001019550886121e6565b611e57576040516368d2bf6b60e11b815260040160405180910390fd5b808203611e01578260655414611e6c57600080fd5b611ea4565b5b6040516001830192906001600160a01b03891690600090600080516020613385833981519152908290a4808203611e72575b50606555611a5b565b611eb682611653565b611eeb5760405162461bcd60e51b815260206004820152600660248201526565786973747360d01b6044820152606401610975565b61013081604051611efc9190612ec2565b908152602001604051809103902054600014611f465760405162461bcd60e51b8152602060048201526009602482015268756e7375656455524960b81b6044820152606401610975565b600082815261012f60205260409020611f5f828261301a565b50611f6b826001611f90565b61013082604051611f7c9190612ec2565b908152604051908190036020019020555050565b60006117018284612f97565b60408051606081018252600080825260208201819052918101919091528160655481101561209d576000818152606a6020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff1615159181018290529061209b5780516001600160a01b031615612032579392505050565b50600019016000818152606a6020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff1615159281019290925215612096579392505050565b612032565b505b604051636f96cda160e11b815260040160405180910390fd5b6001600160a01b03163b151590565b600054610100900460ff166120ec5760405162461bcd60e51b815260040161097590613238565b6116f36123a0565b600054610100900460ff16158080156121145750600054600160ff909116105b806121355750612123306120b6565b158015612135575060005460ff166001145b6121515760405162461bcd60e51b8152600401610975906130d9565b6000805460ff191660011790558015612174576000805461ff0019166101001790555b61217c6121bf565b6121846121bf565b61218f8484846123ce565b8015611169576000805461ff00191690556040516001815260008051602061333e83398151915290602001610b1a565b600054610100900460ff166116f35760405162461bcd60e51b815260040161097590613238565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061221b903390899088908890600401613283565b6020604051808303816000875af1925050508015612256575060408051601f3d908101601f19168201909252612253918101906132c0565b60015b6122b4573d808015612284576040519150601f19603f3d011682016040523d82523d6000602084013e612289565b606091505b5080516000036122ac576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b60606069805461069a90612e88565b6122ea816120b6565b61234c5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610975565b60008051602061331e83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b612384836124aa565b6000825111806123915750805b156107e95761116983836124ea565b600054610100900460ff166123c75760405162461bcd60e51b815260040161097590613238565b6001609955565b600054610100900460ff16158080156123ee5750600054600160ff909116105b8061240f57506123fd306120b6565b15801561240f575060005460ff166001145b61242b5760405162461bcd60e51b8152600401610975906130d9565b6000805460ff19166001179055801561244e576000805461ff0019166101001790555b606761245a858261301a565b506068612467848261301a565b5060006065556069612479838261301a565b508015611169576000805461ff00191690556040516001815260008051602061333e83398151915290602001610b1a565b6124b3816122e1565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606124f5836120b6565b6125505760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610975565b600080846001600160a01b03168460405161256b9190612ec2565b600060405180830381855af49150503d80600081146125a6576040519150601f19603f3d011682016040523d82523d6000602084013e6125ab565b606091505b50915091506125d3828260405180606001604052806027815260200161335e602791396125dc565b95945050505050565b606083156125eb575081611701565b61170183838151156126005781518083602001fd5b8060405162461bcd60e51b8152600401610975919061269d565b6001600160e01b0319811681146109fb57600080fd5b60006020828403121561264257600080fd5b81356117018161261a565b60005b83811015612668578181015183820152602001612650565b50506000910152565b6000815180845261268981602086016020860161264d565b601f01601f19169290920160200192915050565b6020815260006117016020830184612671565b6000602082840312156126c257600080fd5b5035919050565b6001600160a01b03811681146109fb57600080fd5b600080604083850312156126f157600080fd5b82356126fc816126c9565b946020939093013593505050565b60006020828403121561271c57600080fd5b8135611701816126c9565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561275f5761275f612727565b60405290565b604051601f8201601f191681016001600160401b038111828210171561278d5761278d612727565b604052919050565b600082601f8301126127a657600080fd5b81356001600160401b038111156127bf576127bf612727565b6127d2601f8201601f1916602001612765565b8181528460208386010111156127e757600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561281657600080fd5b81356001600160401b0381111561282c57600080fd5b6122ca84828501612795565b60006001600160401b0382111561285157612851612727565b5060051b60200190565b6000602080838503121561286e57600080fd5b82356001600160401b038082111561288557600080fd5b818501915085601f83011261289957600080fd5b81356128ac6128a782612838565b612765565b81815260059190911b830184019084810190888311156128cb57600080fd5b8585015b8381101561294d578035858111156128e75760008081fd5b86016040818c03601f19018113156128ff5760008081fd5b61290761273d565b89830135888111156129195760008081fd5b6129278e8c83870101612795565b8252509181013591612938836126c9565b808a01929092525083529186019186016128cf565b5098975050505050505050565b60008060006060848603121561296f57600080fd5b833561297a816126c9565b9250602084013561298a816126c9565b929592945050506040919091013590565b6000806000606084860312156129b057600080fd5b83356129bb816126c9565b925060208401356001600160401b038111156129d657600080fd5b6129e286828701612795565b925050604084013590509250925092565b60008060408385031215612a0657600080fd5b8235612a11816126c9565b915060208301356001600160401b03811115612a2c57600080fd5b612a3885828601612795565b9150509250929050565b60006020808385031215612a5557600080fd5b82356001600160401b0380821115612a6c57600080fd5b818501915085601f830112612a8057600080fd5b8135612a8e6128a782612838565b81815260059190911b83018401908481019088831115612aad57600080fd5b8585015b8381101561294d57803585811115612ac95760008081fd5b86016040818c03601f1901811315612ae15760008081fd5b612ae961273d565b8983013588811115612afb5760008081fd5b612b098e8c83870101612795565b825250908201359087821115612b1f5760008081fd5b612b2d8d8b84860101612795565b818b015285525050918601918601612ab1565b600060208284031215612b5257600080fd5b81356001600160601b038116811461170157600080fd5b60006020808385031215612b7c57600080fd5b82356001600160401b0380821115612b9357600080fd5b818501915085601f830112612ba757600080fd5b8135612bb56128a782612838565b81815260059190911b83018401908481019088831115612bd457600080fd5b8585015b8381101561294d57803585811115612bf05760008081fd5b612bfe8b89838a0101612795565b845250918601918601612bd8565b6020808252825182820181905260009190848201906040850190845b81811015612c4457835183529284019291840191600101612c28565b50909695505050505050565b80151581146109fb57600080fd5b60008060408385031215612c7157600080fd5b8235612c7c816126c9565b91506020830135612c8c81612c50565b809150509250929050565b600080600060608486031215612cac57600080fd5b83356001600160401b0380821115612cc357600080fd5b612ccf87838801612795565b94506020860135915080821115612ce557600080fd5b612cf187838801612795565b93506040860135915080821115612d0757600080fd5b50612d1486828701612795565b9150509250925092565b6001600160601b0391909116815260200190565b60008060008060808587031215612d4857600080fd5b8435612d53816126c9565b93506020850135612d63816126c9565b92506040850135915060608501356001600160401b03811115612d8557600080fd5b612d9187828801612795565b91505092959194509250565b600080600060608486031215612db257600080fd5b83356001600160401b03811115612dc857600080fd5b612dd486828701612795565b935050602084013591506040840135612dec816126c9565b809150509250925092565b60008060408385031215612e0a57600080fd5b50508035926020909101359150565b6020808252825182820181905260009190848201906040850190845b81811015612c445783516001600160a01b031683529284019291840191600101612e35565b60008060408385031215612e6d57600080fd5b8235612e78816126c9565b91506020830135612c8c816126c9565b600181811c90821680612e9c57607f821691505b602082108103612ebc57634e487b7160e01b600052602260045260246000fd5b50919050565b60008251612ed481846020870161264d565b9190910192915050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612f1c57612f1c612ef4565b5060010190565b6020808252602c908201526000805160206132fe83398151915260408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201526000805160206132fe83398151915260408201526b6163746976652070726f787960a01b606082015260800190565b8082018082111561068557610685612ef4565b604081526000612fbd6040830185612671565b90508260208301529392505050565b601f8211156107e957600081815260208120601f850160051c81016020861015612ff35750805b601f850160051c820191505b8181101561301257828155600101612fff565b505050505050565b81516001600160401b0381111561303357613033612727565b613047816130418454612e88565b84612fcc565b602080601f83116001811461307c57600084156130645750858301515b600019600386901b1c1916600185901b178555613012565b600085815260208120601f198616915b828110156130ab5788860151825594840194600190910190840161308c565b50858210156130c95787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b60008351602061313a828583890161264d565b81840191506000855461314c81612e88565b600182811680156131645760018114613179576131a5565b60ff19841687528215158302870194506131a5565b896000528560002060005b8481101561319d57815489820152908301908701613184565b505082870194505b50929998505050505050505050565b6020808252600490820152632161756360e01b604082015260600190565b8181038181111561068557610685612ef4565b6000602082840312156131f757600080fd5b5051919050565b60006020828403121561321057600080fd5b8151611701816126c9565b60006020828403121561322d57600080fd5b815161170181612c50565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906132b690830184612671565b9695505050505050565b6000602082840312156132d257600080fd5b81516117018161261a56fe8015ee45fcbc71198adc34ee0dbb88aac9a2ff9beb62e95f623d6a3bc353c93e46756e6374696f6e206d7573742062652063616c6c6564207468726f75676820360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa164736f6c6343000811000a
Deployed Bytecode
0x6080604052600436106101895760003560e01c806301ffc9a71461018e57806306fdde03146101c3578063081812fc146101e5578063095ea7b31461021d57806313af40351461023f57806318160ddd1461025f5780631e7663bc14610282578063205e40d1146102a257806323b872dd146102c25780633659cfe6146102e257806342842e0e146103025780634872fd14146103225780634f1ef2861461034257806352d1902d146103555780635ba223a91461036a5780636352211e1461038a5780636b6dccfe146103aa57806370a08231146103ca5780637201bd96146103ea5780638da5cb5b1461040a57806395d89b411461042b5780639ed6e65514610440578063a22cb4651461046d578063a50508691461048d578063a6487c53146104ae578063b0e21e8a146104ce578063b88d4fde14610503578063c87b56dd14610523578063caba0ad614610543578063cdce569914610563578063de00084214610590578063e985e9c5146105b0578063f428d3ec146105f9578063fad1a5db14610619575b600080fd5b34801561019a57600080fd5b506101ae6101a9366004612630565b610639565b60405190151581526020015b60405180910390f35b3480156101cf57600080fd5b506101d861068b565b6040516101ba919061269d565b3480156101f157600080fd5b506102056102003660046126b0565b61071d565b6040516001600160a01b0390911681526020016101ba565b34801561022957600080fd5b5061023d6102383660046126de565b610761565b005b34801561024b57600080fd5b5061023d61025a36600461270a565b6107ee565b34801561026b57600080fd5b50606654606554035b6040519081526020016101ba565b34801561028e57600080fd5b5061027461029d366004612804565b610819565b3480156102ae57600080fd5b5061023d6102bd36600461285b565b610847565b3480156102ce57600080fd5b5061023d6102dd36600461295a565b610922565b3480156102ee57600080fd5b5061023d6102fd36600461270a565b61092d565b34801561030e57600080fd5b5061023d61031d36600461295a565b6109fe565b34801561032e57600080fd5b5061023d61033d36600461299b565b610a19565b61023d6103503660046129f3565b610b28565b34801561036157600080fd5b50610274610bdd565b34801561037657600080fd5b5061023d610385366004612a42565b610c8b565b34801561039657600080fd5b506102056103a53660046126b0565b610e0a565b3480156103b657600080fd5b5061023d6103c5366004612b40565b610e1c565b3480156103d657600080fd5b506102746103e536600461270a565b610e98565b3480156103f657600080fd5b506101ae610405366004612804565b610ee6565b34801561041657600080fd5b5061013354610205906001600160a01b031681565b34801561043757600080fd5b506101d8610f11565b34801561044c57600080fd5b5061046061045b366004612b69565b610f20565b6040516101ba9190612c0c565b34801561047957600080fd5b5061023d610488366004612c5e565b610fde565b34801561049957600080fd5b5061013254610205906001600160a01b031681565b3480156104ba57600080fd5b5061023d6104c9366004612c97565b611073565b3480156104da57600080fd5b50610132546104f690600160a01b90046001600160601b031681565b6040516101ba9190612d1e565b34801561050f57600080fd5b5061023d61051e366004612d32565b61116f565b34801561052f57600080fd5b506101d861053e3660046126b0565b6111bf565b34801561054f57600080fd5b5061023d61055e366004612d9d565b61123f565b34801561056f57600080fd5b5061058361057e366004612df7565b6113c2565b6040516101ba9190612e19565b34801561059c57600080fd5b506102056105ab366004612804565b61148f565b3480156105bc57600080fd5b506101ae6105cb366004612e5a565b6001600160a01b039182166000908152606d6020908152604080832093909416825291909152205460ff1690565b34801561060557600080fd5b5061023d61061436600461270a565b6114aa565b34801561062557600080fd5b5061023d610634366004612d9d565b6114d5565b60006001600160e01b031982166380ac58cd60e01b148061066a57506001600160e01b03198216635b5e139f60e01b145b8061068557506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606067805461069a90612e88565b80601f01602080910402602001604051908101604052809291908181526020018280546106c690612e88565b80156107135780601f106106e857610100808354040283529160200191610713565b820191906000526020600020905b8154815290600101906020018083116106f657829003601f168201915b5050505050905090565b600061072882611653565b610745576040516333d1c03960e21b815260040160405180910390fd5b506000908152606c60205260409020546001600160a01b031690565b600061076c82610e0a565b9050806001600160a01b0316836001600160a01b0316036107a05760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b038216148015906107c057506107be81336105cb565b155b156107de576040516367d9dca160e11b815260040160405180910390fd5b6107e983838361167f565b505050565b6107f66116db565b61013380546001600160a01b0319166001600160a01b0392909216919091179055565b60006106856001610130846040516108319190612ec2565b90815260405190819003602001902054906116f5565b61084f6116db565b60005b815181101561091e5761013082828151811061087057610870612ede565b6020026020010151600001516040516108899190612ec2565b9081526020016040518091039020546000036108a457600080fd5b60006108d960016101308585815181106108c0576108c0612ede565b6020026020010151600001516040516108319190612ec2565b905061090b6108e782610e0a565b8484815181106108f9576108f9612ede565b60200260200101516020015183611708565b508061091681612f0a565b915050610852565b5050565b6107e9838383611887565b6001600160a01b037f000000000000000000000000c0b4990ac7a7a2f28f3370807a34b3725145740616300361097e5760405162461bcd60e51b815260040161097590612f23565b60405180910390fd5b7f000000000000000000000000c0b4990ac7a7a2f28f3370807a34b372514574066001600160a01b03166109b0611a62565b6001600160a01b0316146109d65760405162461bcd60e51b815260040161097590612f5d565b6109df81611a7e565b604080516000808252602082019092526109fb91839190611a86565b50565b6107e98383836040518060200160405280600081525061116f565b610132546001600160a01b03163314610a3157600080fd5b610a3a82611bf1565b610a4382610ee6565b15610a7a5760405162461bcd60e51b8152602060048201526007602482015266085d5b9d5cd95960ca1b6044820152606401610975565b6000610a896066546065540390565b9050610aa8846001604051806020016040528060008152506000611d0b565b610ab28184611ead565b610abc8242612f97565b61013184604051610acd9190612ec2565b9081526020016040518091039020819055506000805160206132de8339815191528361013185604051610b009190612ec2565b90815260405190819003602001812054610b1a9291612faa565b60405180910390a150505050565b6001600160a01b037f000000000000000000000000c0b4990ac7a7a2f28f3370807a34b37251457406163003610b705760405162461bcd60e51b815260040161097590612f23565b7f000000000000000000000000c0b4990ac7a7a2f28f3370807a34b372514574066001600160a01b0316610ba2611a62565b6001600160a01b031614610bc85760405162461bcd60e51b815260040161097590612f5d565b610bd182611a7e565b61091e82826001611a86565b6000306001600160a01b037f000000000000000000000000c0b4990ac7a7a2f28f3370807a34b372514574061614610c785760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c6044820152771b1959081d1a1c9bdd59da0819195b1959d85d1958d85b1b60421b6064820152608401610975565b5060008051602061331e83398151915290565b610c936116db565b60005b815181101561091e57610130828281518110610cb457610cb4612ede565b602002602001015160000151604051610ccd9190612ec2565b908152602001604051809103902054600003610ce857600080fd5b6000610d0460016101308585815181106108c0576108c0612ede565b90506000610130848481518110610d1d57610d1d612ede565b602002602001015160000151604051610d369190612ec2565b90815260405190819003602001902055610d51816001611f90565b610130848481518110610d6657610d66612ede565b602002602001015160200151604051610d7f9190612ec2565b908152602001604051809103902081905550610db7838381518110610da657610da6612ede565b602002602001015160200151611bf1565b828281518110610dc957610dc9612ede565b60200260200101516020015161012f60008381526020019081526020016000209081610df5919061301a565b50508080610e0290612f0a565b915050610c96565b6000610e1582611f9c565b5192915050565b610e246116db565b6107d0816001600160601b03161115610e3c57600080fd5b61013280546001600160a01b0316600160a01b6001600160601b038416021790556040517f63fe946ed58429ac3c5e64d4356ff92c26d7fa1e73586515df8ba9f059ab54a590610e8d908390612d1e565b60405180910390a150565b60006001600160a01b038216610ec1576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152606b60205260409020546001600160401b031690565b600061013082604051610ef99190612ec2565b90815260405190819003602001902054151592915050565b60606068805461069a90612e88565b6060600082516001600160401b03811115610f3d57610f3d612727565b604051908082528060200260200182016040528015610f66578160200160208202803683370190505b50835190915060005b81811015610fd557610131858281518110610f8c57610f8c612ede565b6020026020010151604051610fa19190612ec2565b908152602001604051809103902054838281518110610fc257610fc2612ede565b6020908102919091010152600101610f6f565b50909392505050565b336001600160a01b038316036110075760405163b06307db60e01b815260040160405180910390fd5b336000818152606d602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600054610100900460ff16158080156110935750600054600160ff909116105b806110b457506110a2306120b6565b1580156110b4575060005460ff166001145b6110d05760405162461bcd60e51b8152600401610975906130d9565b6000805460ff1916600117905580156110f3576000805461ff0019166101001790555b6110fb6120c5565b6111068484846120f4565b61110e6121bf565b6101328054601960a31b6001600160a01b0390911617905561013380546001600160a01b031916331790558015611169576000805461ff00191690556040516001815260008051602061333e83398151915290602001610b1a565b50505050565b61117a848484611887565b61118c836001600160a01b03166120b6565b80156111a1575061119f848484846121e6565b155b15611169576040516368d2bf6b60e11b815260040160405180910390fd5b60606111ca82611653565b6112005760405162461bcd60e51b81526020600482015260076024820152662165786973747360c81b6044820152606401610975565b6112086122d2565b600083815261012f6020908152604091829020915161122993929101613127565b6040516020818303038152906040529050919050565b611267610130846040516112539190612ec2565b908152602001604051809103902054611653565b61127057600080fd5b610132546001600160a01b0316331461129b5760405162461bcd60e51b8152600401610975906131b4565b42610131846040516112ad9190612ec2565b908152602001604051809103902054106112f45760405162461bcd60e51b815260206004820152600860248201526708595e1c1a5c995960c21b6044820152606401610975565b600061130c6001610130866040516108319190612ec2565b9050816001600160a01b031661132182610e0a565b6001600160a01b0316036113635760405162461bcd60e51b815260206004820152600960248201526810b932b1b2b4bb32b960b91b6044820152606401610975565b61136d8342612f97565b6101318560405161137e9190612ec2565b908152604051908190036020019020556113a161139a82610e0a565b8383611708565b6000805160206132de8339815191528461013186604051610b009190612ec2565b6060818311156113d157600080fd5b60006113dd84846131d2565b6113e8906001612f97565b6001600160401b038111156113ff576113ff612727565b604051908082528060200260200182016040528015611428578160200160208202803683370190505b50905060005b61143885856131d2565b81116114875761144b6103a58287612f97565b82828151811061145d5761145d612ede565b6001600160a01b03909216602092830291909101909101528061147f81612f0a565b91505061142e565b509392505050565b60006106856103a56001610130856040516108319190612ec2565b6114b26116db565b61013280546001600160a01b0319166001600160a01b0392909216919091179055565b6114e9610130846040516112539190612ec2565b6114f257600080fd5b610132546001600160a01b0316331461151d5760405162461bcd60e51b8152600401610975906131b4565b806001600160a01b03166115406103a56001610130876040516108319190612ec2565b6001600160a01b03161461157f5760405162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b6044820152606401610975565b42610131846040516115919190612ec2565b908152602001604051809103902054106115df5781610131846040516115b79190612ec2565b908152602001604051809103902060008282546115d49190612f97565b9091555061160b9050565b6115e98242612f97565b610131846040516115fa9190612ec2565b908152604051908190036020019020555b6000805160206132de833981519152836101318560405161162c9190612ec2565b908152604051908190036020018120546116469291612faa565b60405180910390a1505050565b6000606554821080156106855750506000908152606a6020526040902054600160e01b900460ff161590565b6000828152606c602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b610133546001600160a01b031633146116f357600080fd5b565b600061170182846131d2565b9392505050565b600061171382611f9c565b9050836001600160a01b031681600001516001600160a01b03161461174a5760405162a1148160e81b815260040160405180910390fd5b6001600160a01b03831661177157604051633a954ecd60e21b815260040160405180910390fd5b61177d6000838661167f565b6001600160a01b038481166000908152606b6020908152604080832080546001600160401b03198082166001600160401b0392831660001901831617909255888616808652838620805493841693831660019081018416949094179055888652606a90945282852080546001600160e01b031916909417600160a01b4290921691909102178355860180845292208054919390911661185057606554821461185057805460208501516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038916171781555b50505081836001600160a01b0316856001600160a01b031660008051602061338583398151915260405160405180910390a4611169565b600061189282611f9c565b9050836001600160a01b031681600001516001600160a01b0316146118c95760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b03861614806118e757506118e785336105cb565b806119025750336118f78461071d565b6001600160a01b0316145b90508061192257604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03841661194957604051633a954ecd60e21b815260040160405180910390fd5b6119556000848761167f565b6001600160a01b038581166000908152606b6020908152604080832080546001600160401b03198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652606a90945282852080546001600160e01b031916909417600160a01b42909216919091021783558701808452922080549193909116611a28576065548214611a2857805460208601516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b031660008051602061338583398151915260405160405180910390a45b5050505050565b60008051602061331e833981519152546001600160a01b031690565b6109fb6116db565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611ab9576107e9836122e1565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611b13575060408051601f3d908101601f19168201909252611b10918101906131e5565b60015b611b765760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610975565b60008051602061331e8339815191528114611be55760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610975565b506107e983838361237b565b61013254604080516317e7f89d60e21b815290516000926001600160a01b031691635f9fe2749160048083019260209291908290030181865afa158015611c3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c6091906131fe565b604051634a9df57f60e01b81529091506001600160a01b03821690634a9df57f90611c8f90859060040161269d565b602060405180830381865afa158015611cac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cd0919061321b565b61091e5760405162461bcd60e51b815260206004820152600c60248201526b085d985b1a5913995dd55c9b60a21b6044820152606401610975565b6065546001600160a01b038516611d3457604051622e076360e81b815260040160405180910390fd5b83600003611d555760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b0385166000818152606b6020908152604080832080546001600160801b031981166001600160401b038083168c018116918217600160401b6001600160401b031990941690921783900481168c01811690920217909155858452606a90925290912080546001600160e01b031916909217600160a01b429092169190910217905580808501838015611dfb5750611dfb876001600160a01b03166120b6565b15611e71575b60405182906001600160a01b03891690600090600080516020613385833981519152908290a4611e3a60008884806001019550886121e6565b611e57576040516368d2bf6b60e11b815260040160405180910390fd5b808203611e01578260655414611e6c57600080fd5b611ea4565b5b6040516001830192906001600160a01b03891690600090600080516020613385833981519152908290a4808203611e72575b50606555611a5b565b611eb682611653565b611eeb5760405162461bcd60e51b815260206004820152600660248201526565786973747360d01b6044820152606401610975565b61013081604051611efc9190612ec2565b908152602001604051809103902054600014611f465760405162461bcd60e51b8152602060048201526009602482015268756e7375656455524960b81b6044820152606401610975565b600082815261012f60205260409020611f5f828261301a565b50611f6b826001611f90565b61013082604051611f7c9190612ec2565b908152604051908190036020019020555050565b60006117018284612f97565b60408051606081018252600080825260208201819052918101919091528160655481101561209d576000818152606a6020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff1615159181018290529061209b5780516001600160a01b031615612032579392505050565b50600019016000818152606a6020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff1615159281019290925215612096579392505050565b612032565b505b604051636f96cda160e11b815260040160405180910390fd5b6001600160a01b03163b151590565b600054610100900460ff166120ec5760405162461bcd60e51b815260040161097590613238565b6116f36123a0565b600054610100900460ff16158080156121145750600054600160ff909116105b806121355750612123306120b6565b158015612135575060005460ff166001145b6121515760405162461bcd60e51b8152600401610975906130d9565b6000805460ff191660011790558015612174576000805461ff0019166101001790555b61217c6121bf565b6121846121bf565b61218f8484846123ce565b8015611169576000805461ff00191690556040516001815260008051602061333e83398151915290602001610b1a565b600054610100900460ff166116f35760405162461bcd60e51b815260040161097590613238565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061221b903390899088908890600401613283565b6020604051808303816000875af1925050508015612256575060408051601f3d908101601f19168201909252612253918101906132c0565b60015b6122b4573d808015612284576040519150601f19603f3d011682016040523d82523d6000602084013e612289565b606091505b5080516000036122ac576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b60606069805461069a90612e88565b6122ea816120b6565b61234c5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610975565b60008051602061331e83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b612384836124aa565b6000825111806123915750805b156107e95761116983836124ea565b600054610100900460ff166123c75760405162461bcd60e51b815260040161097590613238565b6001609955565b600054610100900460ff16158080156123ee5750600054600160ff909116105b8061240f57506123fd306120b6565b15801561240f575060005460ff166001145b61242b5760405162461bcd60e51b8152600401610975906130d9565b6000805460ff19166001179055801561244e576000805461ff0019166101001790555b606761245a858261301a565b506068612467848261301a565b5060006065556069612479838261301a565b508015611169576000805461ff00191690556040516001815260008051602061333e83398151915290602001610b1a565b6124b3816122e1565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606124f5836120b6565b6125505760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610975565b600080846001600160a01b03168460405161256b9190612ec2565b600060405180830381855af49150503d80600081146125a6576040519150601f19603f3d011682016040523d82523d6000602084013e6125ab565b606091505b50915091506125d3828260405180606001604052806027815260200161335e602791396125dc565b95945050505050565b606083156125eb575081611701565b61170183838151156126005781518083602001fd5b8060405162461bcd60e51b8152600401610975919061269d565b6001600160e01b0319811681146109fb57600080fd5b60006020828403121561264257600080fd5b81356117018161261a565b60005b83811015612668578181015183820152602001612650565b50506000910152565b6000815180845261268981602086016020860161264d565b601f01601f19169290920160200192915050565b6020815260006117016020830184612671565b6000602082840312156126c257600080fd5b5035919050565b6001600160a01b03811681146109fb57600080fd5b600080604083850312156126f157600080fd5b82356126fc816126c9565b946020939093013593505050565b60006020828403121561271c57600080fd5b8135611701816126c9565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561275f5761275f612727565b60405290565b604051601f8201601f191681016001600160401b038111828210171561278d5761278d612727565b604052919050565b600082601f8301126127a657600080fd5b81356001600160401b038111156127bf576127bf612727565b6127d2601f8201601f1916602001612765565b8181528460208386010111156127e757600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561281657600080fd5b81356001600160401b0381111561282c57600080fd5b6122ca84828501612795565b60006001600160401b0382111561285157612851612727565b5060051b60200190565b6000602080838503121561286e57600080fd5b82356001600160401b038082111561288557600080fd5b818501915085601f83011261289957600080fd5b81356128ac6128a782612838565b612765565b81815260059190911b830184019084810190888311156128cb57600080fd5b8585015b8381101561294d578035858111156128e75760008081fd5b86016040818c03601f19018113156128ff5760008081fd5b61290761273d565b89830135888111156129195760008081fd5b6129278e8c83870101612795565b8252509181013591612938836126c9565b808a01929092525083529186019186016128cf565b5098975050505050505050565b60008060006060848603121561296f57600080fd5b833561297a816126c9565b9250602084013561298a816126c9565b929592945050506040919091013590565b6000806000606084860312156129b057600080fd5b83356129bb816126c9565b925060208401356001600160401b038111156129d657600080fd5b6129e286828701612795565b925050604084013590509250925092565b60008060408385031215612a0657600080fd5b8235612a11816126c9565b915060208301356001600160401b03811115612a2c57600080fd5b612a3885828601612795565b9150509250929050565b60006020808385031215612a5557600080fd5b82356001600160401b0380821115612a6c57600080fd5b818501915085601f830112612a8057600080fd5b8135612a8e6128a782612838565b81815260059190911b83018401908481019088831115612aad57600080fd5b8585015b8381101561294d57803585811115612ac95760008081fd5b86016040818c03601f1901811315612ae15760008081fd5b612ae961273d565b8983013588811115612afb5760008081fd5b612b098e8c83870101612795565b825250908201359087821115612b1f5760008081fd5b612b2d8d8b84860101612795565b818b015285525050918601918601612ab1565b600060208284031215612b5257600080fd5b81356001600160601b038116811461170157600080fd5b60006020808385031215612b7c57600080fd5b82356001600160401b0380821115612b9357600080fd5b818501915085601f830112612ba757600080fd5b8135612bb56128a782612838565b81815260059190911b83018401908481019088831115612bd457600080fd5b8585015b8381101561294d57803585811115612bf05760008081fd5b612bfe8b89838a0101612795565b845250918601918601612bd8565b6020808252825182820181905260009190848201906040850190845b81811015612c4457835183529284019291840191600101612c28565b50909695505050505050565b80151581146109fb57600080fd5b60008060408385031215612c7157600080fd5b8235612c7c816126c9565b91506020830135612c8c81612c50565b809150509250929050565b600080600060608486031215612cac57600080fd5b83356001600160401b0380821115612cc357600080fd5b612ccf87838801612795565b94506020860135915080821115612ce557600080fd5b612cf187838801612795565b93506040860135915080821115612d0757600080fd5b50612d1486828701612795565b9150509250925092565b6001600160601b0391909116815260200190565b60008060008060808587031215612d4857600080fd5b8435612d53816126c9565b93506020850135612d63816126c9565b92506040850135915060608501356001600160401b03811115612d8557600080fd5b612d9187828801612795565b91505092959194509250565b600080600060608486031215612db257600080fd5b83356001600160401b03811115612dc857600080fd5b612dd486828701612795565b935050602084013591506040840135612dec816126c9565b809150509250925092565b60008060408385031215612e0a57600080fd5b50508035926020909101359150565b6020808252825182820181905260009190848201906040850190845b81811015612c445783516001600160a01b031683529284019291840191600101612e35565b60008060408385031215612e6d57600080fd5b8235612e78816126c9565b91506020830135612c8c816126c9565b600181811c90821680612e9c57607f821691505b602082108103612ebc57634e487b7160e01b600052602260045260246000fd5b50919050565b60008251612ed481846020870161264d565b9190910192915050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612f1c57612f1c612ef4565b5060010190565b6020808252602c908201526000805160206132fe83398151915260408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201526000805160206132fe83398151915260408201526b6163746976652070726f787960a01b606082015260800190565b8082018082111561068557610685612ef4565b604081526000612fbd6040830185612671565b90508260208301529392505050565b601f8211156107e957600081815260208120601f850160051c81016020861015612ff35750805b601f850160051c820191505b8181101561301257828155600101612fff565b505050505050565b81516001600160401b0381111561303357613033612727565b613047816130418454612e88565b84612fcc565b602080601f83116001811461307c57600084156130645750858301515b600019600386901b1c1916600185901b178555613012565b600085815260208120601f198616915b828110156130ab5788860151825594840194600190910190840161308c565b50858210156130c95787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b60008351602061313a828583890161264d565b81840191506000855461314c81612e88565b600182811680156131645760018114613179576131a5565b60ff19841687528215158302870194506131a5565b896000528560002060005b8481101561319d57815489820152908301908701613184565b505082870194505b50929998505050505050505050565b6020808252600490820152632161756360e01b604082015260600190565b8181038181111561068557610685612ef4565b6000602082840312156131f757600080fd5b5051919050565b60006020828403121561321057600080fd5b8151611701816126c9565b60006020828403121561322d57600080fd5b815161170181612c50565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906132b690830184612671565b9695505050505050565b6000602082840312156132d257600080fd5b81516117018161261a56fe8015ee45fcbc71198adc34ee0dbb88aac9a2ff9beb62e95f623d6a3bc353c93e46756e6374696f6e206d7573742062652063616c6c6564207468726f75676820360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa164736f6c6343000811000a
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.