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:
Friendsies
Compiler Version
v0.8.11+commit.d7f03943
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; // https://friendsies.io, built by @devloper_xyz import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; contract Friendsies is Initializable, ERC721Upgradeable, ERC721EnumerableUpgradeable, ERC721URIStorageUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable, OwnableUpgradeable, UUPSUpgradeable { using CountersUpgradeable for CountersUpgradeable.Counter; CountersUpgradeable.Counter private _tokenIdCounter; bool public dutchAuctionsActive; bool public ghostCloudActive; bool public superGoldenCloudActive; uint256 public maxSupply; uint256 public dutchAuctionsSupply; uint256 public dutchAuctionsStartPrice; // in wei uint256 public dutchAuctionsReservePrice; // in wei uint256 public dutchAuctionsDecreaseAmount; // in wei uint256 public dutchAuctionsDecreaseInterval; // in blocks uint256 public dutchAuctionsStartBlockNumber; bytes32 internal ghostCloudMerkleRoot; bytes32 internal superGoldenCloudMerkleRoot; string public defaultURI; string private contractMetadataURI; mapping(bytes32 => bool) internal claimedGhostCloud; mapping(bytes32 => bool) internal claimedSuperGoldenCloud; /// @dev stores true for tokenIds which were minted for Super Golden Cloud Key holders mapping(uint256 => bool) public superGoldenCloudToken; uint256 public dutchAuctionsExtensionPeriod; // in blocks - extend auction if current < period uint256 public dutchAuctionsExtensionBlocks; // in blocks - extend by blocks if above is true event LogMintGhostCloud(address wallet); event LogMintSuperGoldenCloud(address wallet); /// @custom:oz-upgrades-unsafe-allow constructor constructor() initializer {} // solhint-disable no-empty-blocks function initialize( string calldata _defaultURI, string calldata _contractMetadataURI ) public initializer { __ERC721_init("fRiENDSiES", "fRiENDSiES"); __ERC721Enumerable_init(); __ERC721URIStorage_init(); __Pausable_init(); __ReentrancyGuard_init(); __Ownable_init(); __UUPSUpgradeable_init(); defaultURI = _defaultURI; contractMetadataURI = _contractMetadataURI; maxSupply = 10000; _tokenIdCounter.increment(); // start tokenIds at 1 } /// @notice safeMint mints via the Public Dutch Auctions function safeMint(uint256 _amount) external payable nonReentrant whenNotPaused { require(dutchAuctionsActive, "Inactive Auctions"); require(_amount >= 1, "Min amount is 1"); require(_amount <= 5, "Max amount is 5"); if (dutchAuctionsNextDecrease() < dutchAuctionsExtensionPeriod) { // extend auction dutchAuctionsStartBlockNumber += dutchAuctionsExtensionBlocks; } uint256 price = dutchAuctionsCurrentPrice(); // >= will help transactions succeed even when the price just dropped // and the website might have still shown the old price. require(msg.value >= _amount * price, "Not enough ETH"); for (uint256 i = 0; i < _amount; i++) { require(dutchAuctionsSupply > 0, "out of tokens"); dutchAuctionsSupply--; uint256 tokenId = _tokenIdCounter.current(); _tokenIdCounter.increment(); _safeMint(msg.sender, tokenId); } } /// @notice safeMintTo airdrops tokens to addresses function safeMintTo(address[] calldata _to) external nonReentrant onlyOwner { for (uint256 i = 0; i < _to.length; i++) { uint256 tokenId = _tokenIdCounter.current(); _tokenIdCounter.increment(); _safeMint(_to[i], tokenId); } } /// @notice safeMintGhostCloud allows snapshotted Ghost Cloud holders to claim their tokens function safeMintGhostCloud( uint256 _amount, uint256 _price, bytes32[] calldata _proof ) external payable nonReentrant whenNotPaused { require(ghostCloudActive, "not active"); bytes32 leaf = _genLeaf(msg.sender, _amount, _price); require( _verify(leaf, _proof, ghostCloudMerkleRoot), "Invalid merkle proof" ); require(!claimedGhostCloud[leaf], "already claimed"); claimedGhostCloud[leaf] = true; emit LogMintGhostCloud(msg.sender); _safeMintMerkle(_amount, _price, false); } function hasClaimedGhostCloud( address _sender, uint256 _amount, uint256 _price ) external view returns (bool) { bytes32 leaf = _genLeaf(_sender, _amount, _price); return claimedGhostCloud[leaf]; } /// @notice safeMintSuperGoldenCloud allows snapshotted Super Golden Cloud holders to claim their tokens function safeMintSuperGoldenCloud( uint256 _amount, uint256 _price, bytes32[] calldata _proof ) external payable nonReentrant whenNotPaused { require(superGoldenCloudActive, "not active"); bytes32 leaf = _genLeaf(msg.sender, _amount, _price); require( _verify(leaf, _proof, superGoldenCloudMerkleRoot), "Invalid merkle proof" ); require(!claimedSuperGoldenCloud[leaf], "already claimed"); claimedSuperGoldenCloud[leaf] = true; emit LogMintSuperGoldenCloud(msg.sender); _safeMintMerkle(_amount, _price, true); } function hasClaimedSuperGoldenCloud( address _sender, uint256 _amount, uint256 _price ) external view returns (bool) { bytes32 leaf = _genLeaf(_sender, _amount, _price); return claimedSuperGoldenCloud[leaf]; } function _safeMintMerkle( uint256 _amount, uint256 _price, bool _superGoldenCloudToken ) internal { _price = _price * (1 ether / 1000); // finney require(msg.value >= _amount * _price, "Not enough ETH"); for (uint256 i = 0; i < _amount; i++) { uint256 tokenId = _tokenIdCounter.current(); _tokenIdCounter.increment(); if (_superGoldenCloudToken) { superGoldenCloudToken[tokenId] = true; } _safeMint(msg.sender, tokenId); } } function _safeMint(address _to, uint256 _tokenId) internal override { require(totalSupply() < maxSupply, "maxSupply reached"); super._safeMint(_to, _tokenId); } function startDutchAuctions() external onlyOwner { dutchAuctionsStartBlockNumber = block.number; dutchAuctionsActive = true; } function stopDutchAuctions() external onlyOwner { dutchAuctionsActive = false; } function resetDutchAuctionsStartBlockNumber(uint256 _blockNumber) external onlyOwner { dutchAuctionsStartBlockNumber = _blockNumber; } function setDutchAuction( uint256 _startPrice, // wei uint256 _reservePrice, // wei uint256 _decreaseAmount, // wei uint256 _decreaseInterval, // blocks uint256 _extensionPeriod, // blocks uint256 _extensionBlocks, // blocks uint256 _supply ) external onlyOwner { dutchAuctionsStartPrice = _startPrice; dutchAuctionsReservePrice = _reservePrice; dutchAuctionsDecreaseAmount = _decreaseAmount; dutchAuctionsDecreaseInterval = _decreaseInterval; dutchAuctionsExtensionPeriod = _extensionPeriod; dutchAuctionsExtensionBlocks = _extensionBlocks; dutchAuctionsSupply = _supply; } function setDutchAuctionsExtension( uint256 _extensionPeriod, uint256 _extensionBlocks ) external onlyOwner { dutchAuctionsExtensionPeriod = _extensionPeriod; dutchAuctionsExtensionBlocks = _extensionBlocks; } function setDutchAuctionsSupply(uint256 _supply) external onlyOwner { dutchAuctionsSupply = _supply; } function startGhostCloudDrop(bool _active) external onlyOwner { ghostCloudActive = _active; } function startSuperGoldenCloudDrop(bool _active) external onlyOwner { superGoldenCloudActive = _active; } function setGhostCloudRoot(bytes32 _root) external onlyOwner { ghostCloudMerkleRoot = _root; } function setSuperGoldenCloudRoot(bytes32 _root) external onlyOwner { superGoldenCloudMerkleRoot = _root; } function setDefaultURI(string calldata _uri) external onlyOwner { defaultURI = _uri; } function setMaxSupply(uint256 _supply) external onlyOwner { maxSupply = _supply; } function setTokenURI(uint256[] calldata _tokenId, string[] calldata _uri) external onlyOwner { require(_tokenId.length == _uri.length, "len(array) mismatch"); for (uint256 i = 0; i < _tokenId.length; i++) { _setTokenURI(_tokenId[i], _uri[i]); } } function pause() public onlyOwner { _pause(); } function unpause() public onlyOwner { _unpause(); } function setContractMetadataURI(string calldata _uri) external onlyOwner { contractMetadataURI = _uri; } function contractURI() public view returns (string memory) { return contractMetadataURI; } /// @notice returns the number of blocks until the next price decrease function dutchAuctionsNextDecrease() public view returns (uint256) { uint256 price = dutchAuctionsCurrentPrice(); if (price <= dutchAuctionsReservePrice) { return 0; } return dutchAuctionsDecreaseInterval - ((block.number - dutchAuctionsStartBlockNumber) % dutchAuctionsDecreaseInterval); } function dutchAuctionsCurrentPrice() public view returns (uint256) { require(dutchAuctionsActive, "Inactive Auctions"); uint256 decrease = ((block.number - dutchAuctionsStartBlockNumber) / dutchAuctionsDecreaseInterval) * dutchAuctionsDecreaseAmount; if (decrease > dutchAuctionsStartPrice) { // protect from uint256 underflow return dutchAuctionsReservePrice; } uint256 price = dutchAuctionsStartPrice - decrease; if (price < dutchAuctionsReservePrice) { return dutchAuctionsReservePrice; } return price; } function _genLeaf( address _account, uint256 _amount, uint256 _price ) internal pure returns (bytes32) { return keccak256(abi.encodePacked(_account, _amount, _price)); } function _verify( bytes32 _leaf, bytes32[] memory _proof, bytes32 _root ) internal pure returns (bool) { require(_leaf.length > 0, "merkle: empty leaf"); require(_proof.length > 0, "merkle: empty proof"); require(_root.length > 0, "merkle: empty root"); return MerkleProofUpgradeable.verify(_proof, _root, _leaf); } function _authorizeUpgrade(address newImplementation) internal override onlyOwner {} function _beforeTokenTransfer( address _from, address _to, uint256 _tokenId ) internal override(ERC721Upgradeable, ERC721EnumerableUpgradeable) whenNotPaused { super._beforeTokenTransfer(_from, _to, _tokenId); } function _burn(uint256 _tokenId) internal override(ERC721Upgradeable, ERC721URIStorageUpgradeable) { super._burn(_tokenId); } function tokenURI(uint256 _tokenId) public view override(ERC721Upgradeable, ERC721URIStorageUpgradeable) returns (string memory) { string memory uri = super.tokenURI(_tokenId); if (bytes(uri).length > 0) { return uri; } else { return string( abi.encodePacked( defaultURI, StringsUpgradeable.toString(_tokenId), ".json" ) ); } } function supportsInterface(bytes4 _interfaceId) public view override(ERC721Upgradeable, ERC721EnumerableUpgradeable) returns (bool) { return super.supportsInterface(_interfaceId); } /// @notice allows owner to withdraw funds function withdraw(address _to, uint256 _value) external nonReentrant onlyOwner { require(_to != address(0), "zero _to address"); _transferETH(_to, _value); } /// @dev Transfer ETH and revert if unsuccessful. Only forward 30,000 gas to the callee. function _transferETH(address _to, uint256 _value) private { (bool success, ) = _to.call{value: _value, gas: 30_000}(new bytes(0)); // solhint-disable-line avoid-low-level-calls require(success, "Transfer failed"); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.0; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../ERC1967/ERC1967UpgradeUpgradeable.sol"; import "./Initializable.sol"; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. * * _Available since v4.1._ */ abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable { function __UUPSUpgradeable_init() internal onlyInitializing { } function __UUPSUpgradeable_init_unchained() internal onlyInitializing { } /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address private immutable __self = address(this); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { require(address(this) != __self, "Function must be called through delegatecall"); require(_getImplementation() == __self, "Function must be called through active proxy"); _; } /** * @dev Check that the execution is not being performed through a delegate call. This allows a function to be * callable on the implementing contract but not through proxies. */ modifier notDelegated() { require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall"); _; } /** * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the * implementation. It is used to validate that the this implementation remains valid after an upgrade. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier. */ function proxiableUUID() external view virtual override notDelegated returns (bytes32) { return _IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeTo(address newImplementation) external virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, new bytes(0), false); } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, data, true); } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeTo} and {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal override onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // 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 (last updated v4.5.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721Upgradeable.sol"; import "./IERC721ReceiverUpgradeable.sol"; import "./extensions/IERC721MetadataUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/StringsUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC721_init_unchained(name_, symbol_); } function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {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) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721Upgradeable.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721Upgradeable.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721Upgradeable.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[44] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721Upgradeable.sol"; import "./IERC721EnumerableUpgradeable.sol"; import "../../../proxy/utils/Initializable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721EnumerableUpgradeable is Initializable, ERC721Upgradeable, IERC721EnumerableUpgradeable { function __ERC721Enumerable_init() internal onlyInitializing { } function __ERC721Enumerable_init_unchained() internal onlyInitializing { } // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC721Upgradeable) returns (bool) { return interfaceId == type(IERC721EnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721Upgradeable.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721EnumerableUpgradeable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721Upgradeable.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721Upgradeable.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } /** * @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[46] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721URIStorage.sol) pragma solidity ^0.8.0; import "../ERC721Upgradeable.sol"; import "../../../proxy/utils/Initializable.sol"; /** * @dev ERC721 token with storage based token URI management. */ abstract contract ERC721URIStorageUpgradeable is Initializable, ERC721Upgradeable { function __ERC721URIStorage_init() internal onlyInitializing { } function __ERC721URIStorage_init_unchained() internal onlyInitializing { } using StringsUpgradeable for uint256; // Optional mapping for token URIs mapping(uint256 => string) private _tokenURIs; /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721URIStorage: URI query for nonexistent token"); string memory _tokenURI = _tokenURIs[tokenId]; string memory base = _baseURI(); // If there is no base URI, return the token URI. if (bytes(base).length == 0) { return _tokenURI; } // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked). if (bytes(_tokenURI).length > 0) { return string(abi.encodePacked(base, _tokenURI)); } return super.tokenURI(tokenId); } /** * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { require(_exists(tokenId), "ERC721URIStorage: URI set of nonexistent token"); _tokenURIs[tokenId] = _tokenURI; } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual override { super._burn(tokenId); if (bytes(_tokenURIs[tokenId]).length != 0) { delete _tokenURIs[tokenId]; } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library CountersUpgradeable { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Trees proofs. * * The proofs can be generated using the JavaScript library * https://github.com/miguelmota/merkletreejs[merkletreejs]. * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled. * * See `test/utils/cryptography/MerkleProof.test.js` for some examples. */ library MerkleProofUpgradeable { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merklee tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = _efficientHash(computedHash, proofElement); } else { // Hash(current element of the proof + current computed hash) computedHash = _efficientHash(proofElement, computedHash); } } return computedHash; } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.0; /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822ProxiableUpgradeable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeaconUpgradeable.sol"; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/StorageSlotUpgradeable.sol"; import "../utils/Initializable.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ * * @custom:oz-upgrades-unsafe-allow delegatecall */ abstract contract ERC1967UpgradeUpgradeable is Initializable { function __ERC1967Upgrade_init() internal onlyInitializing { } function __ERC1967Upgrade_init_unchained() internal onlyInitializing { } // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall( address newImplementation, bytes memory data, bool forceCall ) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { _functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallUUPS( address newImplementation, bytes memory data, bool forceCall ) internal { // Upgrades from old implementations will perform a rollback test. This test requires the new // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing // this special case will break upgrade paths from old UUPS implementation to new ones. if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else { try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) { require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID"); } catch { revert("ERC1967Upgrade: new implementation is not UUPS"); } _upgradeToAndCall(newImplementation, data, forceCall); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Emitted when the beacon is upgraded. */ event BeaconUpgraded(address indexed beacon); /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall( address newBeacon, bytes memory data, bool forceCall ) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data); } } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) { require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed"); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeaconUpgradeable { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol) pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlotUpgradeable { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { assembly { r.slot := slot } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721ReceiverUpgradeable { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts 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.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721EnumerableUpgradeable is IERC721Upgradeable { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"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":"address","name":"wallet","type":"address"}],"name":"LogMintGhostCloud","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"wallet","type":"address"}],"name":"LogMintSuperGoldenCloud","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"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":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dutchAuctionsActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dutchAuctionsCurrentPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dutchAuctionsDecreaseAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dutchAuctionsDecreaseInterval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dutchAuctionsExtensionBlocks","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dutchAuctionsExtensionPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dutchAuctionsNextDecrease","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dutchAuctionsReservePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dutchAuctionsStartBlockNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dutchAuctionsStartPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dutchAuctionsSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ghostCloudActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"hasClaimedGhostCloud","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"hasClaimedSuperGoldenCloud","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_defaultURI","type":"string"},{"internalType":"string","name":"_contractMetadataURI","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":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_blockNumber","type":"uint256"}],"name":"resetDutchAuctionsStartBlockNumber","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"safeMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"}],"name":"safeMintGhostCloud","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"}],"name":"safeMintSuperGoldenCloud","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_to","type":"address[]"}],"name":"safeMintTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setContractMetadataURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setDefaultURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startPrice","type":"uint256"},{"internalType":"uint256","name":"_reservePrice","type":"uint256"},{"internalType":"uint256","name":"_decreaseAmount","type":"uint256"},{"internalType":"uint256","name":"_decreaseInterval","type":"uint256"},{"internalType":"uint256","name":"_extensionPeriod","type":"uint256"},{"internalType":"uint256","name":"_extensionBlocks","type":"uint256"},{"internalType":"uint256","name":"_supply","type":"uint256"}],"name":"setDutchAuction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_extensionPeriod","type":"uint256"},{"internalType":"uint256","name":"_extensionBlocks","type":"uint256"}],"name":"setDutchAuctionsExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_supply","type":"uint256"}],"name":"setDutchAuctionsSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_root","type":"bytes32"}],"name":"setGhostCloudRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_supply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_root","type":"bytes32"}],"name":"setSuperGoldenCloudRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenId","type":"uint256[]"},{"internalType":"string[]","name":"_uri","type":"string[]"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startDutchAuctions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_active","type":"bool"}],"name":"startGhostCloudDrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_active","type":"bool"}],"name":"startSuperGoldenCloudDrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stopDutchAuctions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"superGoldenCloudActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"superGoldenCloudToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a0604052306080523480156200001557600080fd5b50600054610100900460ff16620000335760005460ff16156200003d565b6200003d620000e2565b620000a55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b600054610100900460ff16158015620000c8576000805461ffff19166101011790555b8015620000db576000805461ff00191690555b506200010f565b6000620000fa306200010060201b620022f51760201c565b15905090565b6001600160a01b03163b151590565b6080516146a7620001476000396000818161132a0152818161136a01528181611687015281816116c701526117ed01526146a76000f3fe6080604052600436106103c35760003560e01c80637fd31b89116101f2578063c87b56dd1161010d578063e1188458116100a0578063f2fde38b1161006f578063f2fde38b14610ab4578063f3fef3a314610ad4578063f5115a6714610af4578063fe039bbf14610b1457600080fd5b8063e118845814610a2c578063e8a3d48514610a43578063e985e9c514610a58578063eb6ee56a14610aa157600080fd5b8063d7c1ee5a116100dc578063d7c1ee5a146109b7578063d8e5dbf9146109cc578063da0dce72146109ec578063da1b9e0814610a0c57600080fd5b8063c87b56dd14610938578063cbac01ff14610958578063d5abeb011461096f578063d678a2051461098657600080fd5b8063a201fc5011610185578063aafb2d4411610154578063aafb2d44146108c1578063b88d4fde146108e1578063b9210fac14610901578063bd2a51311461092157600080fd5b8063a201fc501461084c578063a22cb4651461086c578063a634d6271461088c578063a9fafa2d146108a157600080fd5b80638da5cb5b116101c15780638da5cb5b146107e157806393f07e4b1461080057806395d89b4114610820578063969ab2f51461083557600080fd5b80637fd31b891461077a5780638456cb591461079a5780638626fc0a146107af5780638a5f6324146107c657600080fd5b806342842e0e116102e257806353a6bd18116102755780636f8b44b0116102445780636f8b44b01461070557806370a0823114610725578063715018a6146107455780637e7d23b71461075a57600080fd5b806353a6bd18146106965780635c975abb146106ad57806361048775146106c55780636352211e146106e557600080fd5b80634f6ccce7116102b15780634f6ccce7146106295780634f75253f1461064957806352d1902d14610660578063537e8b5c1461067557600080fd5b806342842e0e146105b65780634cd88b76146105d65780634dd23a6c146105f65780634f1ef2861461061657600080fd5b806324c7b1f31161035a5780633659cfe6116103295780633659cfe61461054c5780633a367a671461056c5780633f17fe4f146105815780633f4ba83a146105a157600080fd5b806324c7b1f3146104e657806326879d16146105065780632f745c591461051957806331c864e81461053957600080fd5b8063095ea7b311610396578063095ea7b31461046e5780630bc09c791461048e57806318160ddd146104b157806323b872dd146104c657600080fd5b806301ffc9a7146103c857806306fdde03146103fd578063081812fc1461041f578063081c2b9814610457575b600080fd5b3480156103d457600080fd5b506103e86103e3366004613b2d565b610b2b565b60405190151581526020015b60405180910390f35b34801561040957600080fd5b50610412610b3c565b6040516103f49190613ba2565b34801561042b57600080fd5b5061043f61043a366004613bb5565b610bce565b6040516001600160a01b0390911681526020016103f4565b34801561046357600080fd5b5061046c610c5b565b005b34801561047a57600080fd5b5061046c610489366004613bea565b610c9b565b34801561049a57600080fd5b506104a3610db1565b6040519081526020016103f4565b3480156104bd57600080fd5b506099546104a3565b3480156104d257600080fd5b5061046c6104e1366004613c14565b610e00565b3480156104f257600080fd5b5061046c610501366004613bb5565b610e31565b61046c610514366004613c9c565b610e62565b34801561052557600080fd5b506104a3610534366004613bea565b611042565b61046c610547366004613bb5565b6110d8565b34801561055857600080fd5b5061046c610567366004613cef565b61131f565b34801561057857600080fd5b506104126113ff565b34801561058d57600080fd5b5061046c61059c366004613bb5565b61148e565b3480156105ad57600080fd5b5061046c6114bf565b3480156105c257600080fd5b5061046c6105d1366004613c14565b6114f4565b3480156105e257600080fd5b5061046c6105f1366004613d4c565b61150f565b34801561060257600080fd5b506101f6546103e890610100900460ff1681565b61046c610624366004613e4f565b61167c565b34801561063557600080fd5b506104a3610644366004613bb5565b61174d565b34801561065557600080fd5b506104a36102065481565b34801561066c57600080fd5b506104a36117e0565b34801561068157600080fd5b506101f6546103e89062010000900460ff1681565b3480156106a257600080fd5b506104a36101fa5481565b3480156106b957600080fd5b5060fb5460ff166103e8565b3480156106d157600080fd5b5061046c6106e0366004613ead565b611893565b3480156106f157600080fd5b5061043f610700366004613bb5565b6118db565b34801561071157600080fd5b5061046c610720366004613bb5565b611952565b34801561073157600080fd5b506104a3610740366004613cef565b611983565b34801561075157600080fd5b5061046c611a0a565b34801561076657600080fd5b506103e8610775366004613ec8565b611a3f565b34801561078657600080fd5b5061046c610795366004613efb565b611a6b565b3480156107a657600080fd5b5061046c611b2b565b3480156107bb57600080fd5b506104a36101f85481565b3480156107d257600080fd5b506101f6546103e89060ff1681565b3480156107ed57600080fd5b5061015f546001600160a01b031661043f565b34801561080c57600080fd5b506103e861081b366004613ec8565b611b5e565b34801561082c57600080fd5b50610412611b88565b34801561084157600080fd5b506104a36101fb5481565b34801561085857600080fd5b5061046c610867366004613f3d565b611b97565b34801561087857600080fd5b5061046c610887366004613f73565b611bcf565b34801561089857600080fd5b506104a3611bda565b3480156108ad57600080fd5b5061046c6108bc366004613bb5565b611c90565b3480156108cd57600080fd5b5061046c6108dc366004613fa6565b611cc1565b3480156108ed57600080fd5b5061046c6108fc366004614006565b611dc8565b34801561090d57600080fd5b5061046c61091c366004613ead565b611e00565b34801561092d57600080fd5b506104a36102055481565b34801561094457600080fd5b50610412610953366004613bb5565b611e46565b34801561096457600080fd5b506104a36101f95481565b34801561097b57600080fd5b506104a36101f75481565b34801561099257600080fd5b506103e86109a1366004613bb5565b6102046020526000908152604090205460ff1681565b3480156109c357600080fd5b5061046c611e9d565b3480156109d857600080fd5b5061046c6109e7366004613bb5565b611ed5565b3480156109f857600080fd5b5061046c610a0736600461406e565b611f06565b348015610a1857600080fd5b5061046c610a27366004613f3d565b611f58565b348015610a3857600080fd5b506104a36101fd5481565b348015610a4f57600080fd5b50610412611f90565b348015610a6457600080fd5b506103e8610a733660046140ba565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b61046c610aaf366004613c9c565b611fa0565b348015610ac057600080fd5b5061046c610acf366004613cef565b612172565b348015610ae057600080fd5b5061046c610aef366004613bea565b61220b565b348015610b0057600080fd5b5061046c610b0f3660046140e4565b6122bd565b348015610b2057600080fd5b506104a36101fc5481565b6000610b3682612304565b92915050565b606060658054610b4b90614106565b80601f0160208091040260200160405190810160405280929190818152602001828054610b7790614106565b8015610bc45780601f10610b9957610100808354040283529160200191610bc4565b820191906000526020600020905b815481529060010190602001808311610ba757829003601f168201915b5050505050905090565b6000610bd982612329565b610c3f5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152606960205260409020546001600160a01b031690565b61015f546001600160a01b03163314610c865760405162461bcd60e51b8152600401610c369061413b565b436101fd556101f6805460ff19166001179055565b6000610ca6826118db565b9050806001600160a01b0316836001600160a01b03161415610d145760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610c36565b336001600160a01b0382161480610d305750610d308133610a73565b610da25760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610c36565b610dac8383612346565b505050565b600080610dbc611bda565b90506101fa548111610dd057600091505090565b6101fc546101fd54610de29043614186565b610dec91906141b3565b6101fc54610dfa9190614186565b91505090565b610e0a33826123b4565b610e265760405162461bcd60e51b8152600401610c36906141c7565b610dac83838361249e565b61015f546001600160a01b03163314610e5c5760405162461bcd60e51b8152600401610c369061413b565b6101fd55565b600261012d541415610e865760405162461bcd60e51b8152600401610c3690614218565b600261012d5560fb5460ff1615610eaf5760405162461bcd60e51b8152600401610c369061424f565b6101f65462010000900460ff16610ef55760405162461bcd60e51b815260206004820152600a6024820152696e6f742061637469766560b01b6044820152606401610c36565b6000610f02338686612645565b9050610f4681848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506101ff5491506126949050565b610f895760405162461bcd60e51b815260206004820152601460248201527324b73b30b634b21036b2b935b63290383937b7b360611b6044820152606401610c36565b6000818152610203602052604090205460ff1615610fdb5760405162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e4818db185a5b5959608a1b6044820152606401610c36565b60008181526102036020908152604091829020805460ff1916600117905590513381527fcabd2b059543ad6d87814b758eb7a2d8d7b979791de93646feddce14a904f303910160405180910390a1611035858560016126e7565b5050600161012d55505050565b600061104d83611983565b82106110af5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610c36565b506001600160a01b03919091166000908152609760209081526040808320938352929052205490565b600261012d5414156110fc5760405162461bcd60e51b8152600401610c3690614218565b600261012d5560fb5460ff16156111255760405162461bcd60e51b8152600401610c369061424f565b6101f65460ff1661116c5760405162461bcd60e51b8152602060048201526011602482015270496e6163746976652041756374696f6e7360781b6044820152606401610c36565b60018110156111af5760405162461bcd60e51b815260206004820152600f60248201526e4d696e20616d6f756e74206973203160881b6044820152606401610c36565b60058111156111f25760405162461bcd60e51b815260206004820152600f60248201526e4d617820616d6f756e74206973203560881b6044820152606401610c36565b610205546111fe610db1565b101561122057610206546101fd600082825461121a9190614279565b90915550505b600061122a611bda565b90506112368183614291565b3410156112765760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401610c36565b60005b828110156113145760006101f854116112c45760405162461bcd60e51b815260206004820152600d60248201526c6f7574206f6620746f6b656e7360981b6044820152606401610c36565b6101f880549060006112d5836142b0565b919050555060006112e66101f55490565b90506112f76101f580546001019055565b61130133826127aa565b508061130c816142c7565b915050611279565b5050600161012d5550565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156113685760405162461bcd60e51b8152600401610c36906142e2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166113b160008051602061462b833981519152546001600160a01b031690565b6001600160a01b0316146113d75760405162461bcd60e51b8152600401610c369061432e565b6113e0816127fc565b604080516000808252602082019092526113fc91839190612827565b50565b610200805461140d90614106565b80601f016020809104026020016040519081016040528092919081815260200182805461143990614106565b80156114865780601f1061145b57610100808354040283529160200191611486565b820191906000526020600020905b81548152906001019060200180831161146957829003601f168201915b505050505081565b61015f546001600160a01b031633146114b95760405162461bcd60e51b8152600401610c369061413b565b6101fe55565b61015f546001600160a01b031633146114ea5760405162461bcd60e51b8152600401610c369061413b565b6114f2612992565b565b610dac83838360405180602001604052806000815250611dc8565b600054610100900460ff1661152a5760005460ff161561152e565b303b155b6115915760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610c36565b600054610100900460ff161580156115b3576000805461ffff19166101011790555b6116016040518060400160405280600a815260200169665269454e445369455360b01b8152506040518060400160405280600a815260200169665269454e445369455360b01b815250612a25565b611609612a56565b611611612a56565b611619612a7d565b611621612aac565b611629612adb565b611631612a56565b61163e6102008686613a0a565b5061164c6102018484613a0a565b506127106101f7556116636101f580546001019055565b8015611675576000805461ff00191690555b5050505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156116c55760405162461bcd60e51b8152600401610c36906142e2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661170e60008051602061462b833981519152546001600160a01b031690565b6001600160a01b0316146117345760405162461bcd60e51b8152600401610c369061432e565b61173d826127fc565b61174982826001612827565b5050565b600061175860995490565b82106117bb5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610c36565b609982815481106117ce576117ce61437a565b90600052602060002001549050919050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118805760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610c36565b5060008051602061462b83398151915290565b61015f546001600160a01b031633146118be5760405162461bcd60e51b8152600401610c369061413b565b6101f68054911515620100000262ff000019909216919091179055565b6000818152606760205260408120546001600160a01b031680610b365760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610c36565b61015f546001600160a01b0316331461197d5760405162461bcd60e51b8152600401610c369061413b565b6101f755565b60006001600160a01b0382166119ee5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610c36565b506001600160a01b031660009081526068602052604090205490565b61015f546001600160a01b03163314611a355760405162461bcd60e51b8152600401610c369061413b565b6114f26000612b0a565b600080611a4d858585612645565b6000908152610202602052604090205460ff169150505b9392505050565b600261012d541415611a8f5760405162461bcd60e51b8152600401610c3690614218565b600261012d5561015f546001600160a01b03163314611ac05760405162461bcd60e51b8152600401610c369061413b565b60005b81811015611314576000611ad76101f55490565b9050611ae86101f580546001019055565b611b18848484818110611afd57611afd61437a565b9050602002016020810190611b129190613cef565b826127aa565b5080611b23816142c7565b915050611ac3565b61015f546001600160a01b03163314611b565760405162461bcd60e51b8152600401610c369061413b565b6114f2612b5d565b600080611b6c858585612645565b6000908152610203602052604090205460ff1695945050505050565b606060668054610b4b90614106565b61015f546001600160a01b03163314611bc25760405162461bcd60e51b8152600401610c369061413b565b610dac6102018383613a0a565b611749338383612bb5565b6101f65460009060ff16611c245760405162461bcd60e51b8152602060048201526011602482015270496e6163746976652041756374696f6e7360781b6044820152606401610c36565b60006101fb546101fc546101fd5443611c3d9190614186565b611c479190614390565b611c519190614291565b90506101f954811115611c675750506101fa5490565b6000816101f954611c789190614186565b90506101fa54811015610b36576101fa549250505090565b61015f546001600160a01b03163314611cbb5760405162461bcd60e51b8152600401610c369061413b565b6101ff55565b61015f546001600160a01b03163314611cec5760405162461bcd60e51b8152600401610c369061413b565b828114611d315760405162461bcd60e51b81526020600482015260136024820152720d8cadc50c2e4e4c2f25240dad2e6dac2e8c6d606b1b6044820152606401610c36565b60005b8381101561167557611db6858583818110611d5157611d5161437a565b90506020020135848484818110611d6a57611d6a61437a565b9050602002810190611d7c91906143a4565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612c8492505050565b80611dc0816142c7565b915050611d34565b611dd233836123b4565b611dee5760405162461bcd60e51b8152600401610c36906141c7565b611dfa84848484612d0f565b50505050565b61015f546001600160a01b03163314611e2b5760405162461bcd60e51b8152600401610c369061413b565b6101f680549115156101000261ff0019909216919091179055565b60606000611e5383612d42565b805190915015611e635792915050565b610200611e6f84612eb1565b604051602001611e80929190614407565b604051602081830303815290604052915050919050565b50919050565b61015f546001600160a01b03163314611ec85760405162461bcd60e51b8152600401610c369061413b565b6101f6805460ff19169055565b61015f546001600160a01b03163314611f005760405162461bcd60e51b8152600401610c369061413b565b6101f855565b61015f546001600160a01b03163314611f315760405162461bcd60e51b8152600401610c369061413b565b6101f9969096556101fa949094556101fb929092556101fc5561020555610206556101f855565b61015f546001600160a01b03163314611f835760405162461bcd60e51b8152600401610c369061413b565b610dac6102008383613a0a565b60606102018054610b4b90614106565b600261012d541415611fc45760405162461bcd60e51b8152600401610c3690614218565b600261012d5560fb5460ff1615611fed5760405162461bcd60e51b8152600401610c369061424f565b6101f654610100900460ff166120325760405162461bcd60e51b815260206004820152600a6024820152696e6f742061637469766560b01b6044820152606401610c36565b600061203f338686612645565b905061208381848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506101fe5491506126949050565b6120c65760405162461bcd60e51b815260206004820152601460248201527324b73b30b634b21036b2b935b63290383937b7b360611b6044820152606401610c36565b6000818152610202602052604090205460ff16156121185760405162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e4818db185a5b5959608a1b6044820152606401610c36565b60008181526102026020908152604091829020805460ff1916600117905590513381527fa77bda73b4933afd4b63289b27c5dcd90a116f9511d8655ee6a241104ceeed26910160405180910390a1611035858560006126e7565b61015f546001600160a01b0316331461219d5760405162461bcd60e51b8152600401610c369061413b565b6001600160a01b0381166122025760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c36565b6113fc81612b0a565b600261012d54141561222f5760405162461bcd60e51b8152600401610c3690614218565b600261012d5561015f546001600160a01b031633146122605760405162461bcd60e51b8152600401610c369061413b565b6001600160a01b0382166122a95760405162461bcd60e51b815260206004820152601060248201526f7a65726f205f746f206164647265737360801b6044820152606401610c36565b6122b38282612faf565b5050600161012d55565b61015f546001600160a01b031633146122e85760405162461bcd60e51b8152600401610c369061413b565b6102059190915561020655565b6001600160a01b03163b151590565b60006001600160e01b0319821663780e9d6360e01b1480610b365750610b3682613061565b6000908152606760205260409020546001600160a01b0316151590565b600081815260696020526040902080546001600160a01b0319166001600160a01b038416908117909155819061237b826118db565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006123bf82612329565b6124205760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610c36565b600061242b836118db565b9050806001600160a01b0316846001600160a01b031614806124665750836001600160a01b031661245b84610bce565b6001600160a01b0316145b8061249657506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b03166124b1826118db565b6001600160a01b0316146125155760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610c36565b6001600160a01b0382166125775760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610c36565b6125828383836130b1565b61258d600082612346565b6001600160a01b03831660009081526068602052604081208054600192906125b6908490614186565b90915550506001600160a01b03821660009081526068602052604081208054600192906125e4908490614279565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6040516bffffffffffffffffffffffff19606085901b16602082015260348101839052605481018290526000906074016040516020818303038152906040528051906020012090509392505050565b6000808351116126dc5760405162461bcd60e51b815260206004820152601360248201527236b2b935b6329d1032b6b83a3c90383937b7b360691b6044820152606401610c36565b6124968383866130df565b6126f88266038d7ea4c68000614291565b91506127048284614291565b3410156127445760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401610c36565b60005b83811015611dfa57600061275b6101f55490565b905061276c6101f580546001019055565b821561278d57600081815261020460205260409020805460ff191660011790555b61279733826127aa565b50806127a2816142c7565b915050612747565b6101f754609954106127f25760405162461bcd60e51b81526020600482015260116024820152701b585e14dd5c1c1b1e481c995858da1959607a1b6044820152606401610c36565b61174982826130f5565b61015f546001600160a01b031633146113fc5760405162461bcd60e51b8152600401610c369061413b565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561285a57610dac8361310f565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156128b4575060408051601f3d908101601f191682019092526128b1918101906144b9565b60015b6129175760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610c36565b60008051602061462b83398151915281146129865760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610c36565b50610dac8383836131ab565b60fb5460ff166129db5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c36565b60fb805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600054610100900460ff16612a4c5760405162461bcd60e51b8152600401610c36906144d2565b61174982826131d0565b600054610100900460ff166114f25760405162461bcd60e51b8152600401610c36906144d2565b600054610100900460ff16612aa45760405162461bcd60e51b8152600401610c36906144d2565b6114f261321e565b600054610100900460ff16612ad35760405162461bcd60e51b8152600401610c36906144d2565b6114f2613251565b600054610100900460ff16612b025760405162461bcd60e51b8152600401610c36906144d2565b6114f2613280565b61015f80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60fb5460ff1615612b805760405162461bcd60e51b8152600401610c369061424f565b60fb805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612a083390565b816001600160a01b0316836001600160a01b03161415612c175760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610c36565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612c8d82612329565b612cf05760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b6064820152608401610c36565b600082815260c9602090815260409091208251610dac92840190613a8e565b612d1a84848461249e565b612d26848484846132b0565b611dfa5760405162461bcd60e51b8152600401610c369061451d565b6060612d4d82612329565b612db35760405162461bcd60e51b815260206004820152603160248201527f45524337323155524953746f726167653a2055524920717565727920666f72206044820152703737b732bc34b9ba32b73a103a37b5b2b760791b6064820152608401610c36565b600082815260c9602052604081208054612dcc90614106565b80601f0160208091040260200160405190810160405280929190818152602001828054612df890614106565b8015612e455780601f10612e1a57610100808354040283529160200191612e45565b820191906000526020600020905b815481529060010190602001808311612e2857829003601f168201915b505050505090506000612e6360408051602081019091526000815290565b9050805160001415612e76575092915050565b815115612ea8578082604051602001612e9092919061456f565b60405160208183030381529060405292505050919050565b612496846133ae565b606081612ed55750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612eff5780612ee9816142c7565b9150612ef89050600a83614390565b9150612ed9565b60008167ffffffffffffffff811115612f1a57612f1a613dac565b6040519080825280601f01601f191660200182016040528015612f44576020820181803683370190505b5090505b841561249657612f59600183614186565b9150612f66600a866141b3565b612f71906030614279565b60f81b818381518110612f8657612f8661437a565b60200101906001600160f81b031916908160001a905350612fa8600a86614390565b9450612f48565b6040805160008082526020820192839052916001600160a01b03851691617530918591612fdb9161459e565b600060405180830381858888f193505050503d8060008114613019576040519150601f19603f3d011682016040523d82523d6000602084013e61301e565b606091505b5050905080610dac5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606401610c36565b60006001600160e01b031982166380ac58cd60e01b148061309257506001600160e01b03198216635b5e139f60e01b145b80610b3657506301ffc9a760e01b6001600160e01b0319831614610b36565b60fb5460ff16156130d45760405162461bcd60e51b8152600401610c369061424f565b610dac83838361346f565b6000826130ec8584613527565b14949350505050565b61174982826040518060200160405280600081525061359b565b6001600160a01b0381163b61317c5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610c36565b60008051602061462b83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6131b4836135ce565b6000825111806131c15750805b15610dac57611dfa838361360e565b600054610100900460ff166131f75760405162461bcd60e51b8152600401610c36906144d2565b815161320a906065906020850190613a8e565b508051610dac906066906020840190613a8e565b600054610100900460ff166132455760405162461bcd60e51b8152600401610c36906144d2565b60fb805460ff19169055565b600054610100900460ff166132785760405162461bcd60e51b8152600401610c36906144d2565b600161012d55565b600054610100900460ff166132a75760405162461bcd60e51b8152600401610c36906144d2565b6114f233612b0a565b60006001600160a01b0384163b156133a357604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906132f49033908990889088906004016145ba565b6020604051808303816000875af192505050801561332f575060408051601f3d908101601f1916820190925261332c918101906145f7565b60015b613389573d80801561335d576040519150601f19603f3d011682016040523d82523d6000602084013e613362565b606091505b5080516133815760405162461bcd60e51b8152600401610c369061451d565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612496565b506001949350505050565b60606133b982612329565b61341d5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610c36565b600061343460408051602081019091526000815290565b905060008151116134545760405180602001604052806000815250611a64565b8061345e84612eb1565b604051602001611e8092919061456f565b6001600160a01b0383166134ca576134c581609980546000838152609a60205260408120829055600182018355919091527f72a152ddfb8e864297c917af52ea6c1c68aead0fee1a62673fcc7e0c94979d000155565b6134ed565b816001600160a01b0316836001600160a01b0316146134ed576134ed8382613702565b6001600160a01b03821661350457610dac8161379f565b826001600160a01b0316826001600160a01b031614610dac57610dac828261384e565b600081815b84518110156135935760008582815181106135495761354961437a565b6020026020010151905080831161356f5760008381526020829052604090209250613580565b600081815260208490526040902092505b508061358b816142c7565b91505061352c565b509392505050565b6135a58383613892565b6135b260008484846132b0565b610dac5760405162461bcd60e51b8152600401610c369061451d565b6135d78161310f565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6136765760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610c36565b600080846001600160a01b031684604051613691919061459e565b600060405180830381855af49150503d80600081146136cc576040519150601f19603f3d011682016040523d82523d6000602084013e6136d1565b606091505b50915091506136f9828260405180606001604052806027815260200161464b602791396139d1565b95945050505050565b6000600161370f84611983565b6137199190614186565b60008381526098602052604090205490915080821461376c576001600160a01b03841660009081526097602090815260408083208584528252808320548484528184208190558352609890915290208190555b5060009182526098602090815260408084208490556001600160a01b039094168352609781528383209183525290812055565b6099546000906137b190600190614186565b6000838152609a6020526040812054609980549394509092849081106137d9576137d961437a565b9060005260206000200154905080609983815481106137fa576137fa61437a565b6000918252602080832090910192909255828152609a9091526040808220849055858252812055609980548061383257613832614614565b6001900381819060005260206000200160009055905550505050565b600061385983611983565b6001600160a01b039093166000908152609760209081526040808320868452825280832085905593825260989052919091209190915550565b6001600160a01b0382166138e85760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c36565b6138f181612329565b1561393e5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c36565b61394a600083836130b1565b6001600160a01b0382166000908152606860205260408120805460019290613973908490614279565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b606083156139e0575081611a64565b8251156139f05782518084602001fd5b8160405162461bcd60e51b8152600401610c369190613ba2565b828054613a1690614106565b90600052602060002090601f016020900481019282613a385760008555613a7e565b82601f10613a515782800160ff19823516178555613a7e565b82800160010185558215613a7e579182015b82811115613a7e578235825591602001919060010190613a63565b50613a8a929150613b02565b5090565b828054613a9a90614106565b90600052602060002090601f016020900481019282613abc5760008555613a7e565b82601f10613ad557805160ff1916838001178555613a7e565b82800160010185558215613a7e579182015b82811115613a7e578251825591602001919060010190613ae7565b5b80821115613a8a5760008155600101613b03565b6001600160e01b0319811681146113fc57600080fd5b600060208284031215613b3f57600080fd5b8135611a6481613b17565b60005b83811015613b65578181015183820152602001613b4d565b83811115611dfa5750506000910152565b60008151808452613b8e816020860160208601613b4a565b601f01601f19169290920160200192915050565b602081526000611a646020830184613b76565b600060208284031215613bc757600080fd5b5035919050565b80356001600160a01b0381168114613be557600080fd5b919050565b60008060408385031215613bfd57600080fd5b613c0683613bce565b946020939093013593505050565b600080600060608486031215613c2957600080fd5b613c3284613bce565b9250613c4060208501613bce565b9150604084013590509250925092565b60008083601f840112613c6257600080fd5b50813567ffffffffffffffff811115613c7a57600080fd5b6020830191508360208260051b8501011115613c9557600080fd5b9250929050565b60008060008060608587031215613cb257600080fd5b8435935060208501359250604085013567ffffffffffffffff811115613cd757600080fd5b613ce387828801613c50565b95989497509550505050565b600060208284031215613d0157600080fd5b611a6482613bce565b60008083601f840112613d1c57600080fd5b50813567ffffffffffffffff811115613d3457600080fd5b602083019150836020828501011115613c9557600080fd5b60008060008060408587031215613d6257600080fd5b843567ffffffffffffffff80821115613d7a57600080fd5b613d8688838901613d0a565b90965094506020870135915080821115613d9f57600080fd5b50613ce387828801613d0a565b634e487b7160e01b600052604160045260246000fd5b600082601f830112613dd357600080fd5b813567ffffffffffffffff80821115613dee57613dee613dac565b604051601f8301601f19908116603f01168101908282118183101715613e1657613e16613dac565b81604052838152866020858801011115613e2f57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060408385031215613e6257600080fd5b613e6b83613bce565b9150602083013567ffffffffffffffff811115613e8757600080fd5b613e9385828601613dc2565b9150509250929050565b80358015158114613be557600080fd5b600060208284031215613ebf57600080fd5b611a6482613e9d565b600080600060608486031215613edd57600080fd5b613ee684613bce565b95602085013595506040909401359392505050565b60008060208385031215613f0e57600080fd5b823567ffffffffffffffff811115613f2557600080fd5b613f3185828601613c50565b90969095509350505050565b60008060208385031215613f5057600080fd5b823567ffffffffffffffff811115613f6757600080fd5b613f3185828601613d0a565b60008060408385031215613f8657600080fd5b613f8f83613bce565b9150613f9d60208401613e9d565b90509250929050565b60008060008060408587031215613fbc57600080fd5b843567ffffffffffffffff80821115613fd457600080fd5b613fe088838901613c50565b90965094506020870135915080821115613ff957600080fd5b50613ce387828801613c50565b6000806000806080858703121561401c57600080fd5b61402585613bce565b935061403360208601613bce565b925060408501359150606085013567ffffffffffffffff81111561405657600080fd5b61406287828801613dc2565b91505092959194509250565b600080600080600080600060e0888a03121561408957600080fd5b505085359760208701359750604087013596606081013596506080810135955060a0810135945060c0013592509050565b600080604083850312156140cd57600080fd5b6140d683613bce565b9150613f9d60208401613bce565b600080604083850312156140f757600080fd5b50508035926020909101359150565b600181811c9082168061411a57607f821691505b60208210811415611e9757634e487b7160e01b600052602260045260246000fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008282101561419857614198614170565b500390565b634e487b7160e01b600052601260045260246000fd5b6000826141c2576141c261419d565b500690565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6000821982111561428c5761428c614170565b500190565b60008160001904831182151516156142ab576142ab614170565b500290565b6000816142bf576142bf614170565b506000190190565b60006000198214156142db576142db614170565b5060010190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b60008261439f5761439f61419d565b500490565b6000808335601e198436030181126143bb57600080fd5b83018035915067ffffffffffffffff8211156143d657600080fd5b602001915036819003821315613c9557600080fd5b600081516143fd818560208601613b4a565b9290920192915050565b600080845481600182811c91508083168061442357607f831692505b602080841082141561444357634e487b7160e01b86526022600452602486fd5b818015614457576001811461446857614495565b60ff19861689528489019650614495565b60008b81526020902060005b8681101561448d5781548b820152908501908301614474565b505084890196505b5050505050506136f96144a882866143eb565b64173539b7b760d91b815260050190565b6000602082840312156144cb57600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60008351614581818460208801613b4a565b835190830190614595818360208801613b4a565b01949350505050565b600082516145b0818460208701613b4a565b9190910192915050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906145ed90830184613b76565b9695505050505050565b60006020828403121561460957600080fd5b8151611a6481613b17565b634e487b7160e01b600052603160045260246000fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220193c6182f90ee00fe7b00399f3be6326b208edb66425c7c60ebd344e8c153f1d64736f6c634300080b0033
Deployed Bytecode
0x6080604052600436106103c35760003560e01c80637fd31b89116101f2578063c87b56dd1161010d578063e1188458116100a0578063f2fde38b1161006f578063f2fde38b14610ab4578063f3fef3a314610ad4578063f5115a6714610af4578063fe039bbf14610b1457600080fd5b8063e118845814610a2c578063e8a3d48514610a43578063e985e9c514610a58578063eb6ee56a14610aa157600080fd5b8063d7c1ee5a116100dc578063d7c1ee5a146109b7578063d8e5dbf9146109cc578063da0dce72146109ec578063da1b9e0814610a0c57600080fd5b8063c87b56dd14610938578063cbac01ff14610958578063d5abeb011461096f578063d678a2051461098657600080fd5b8063a201fc5011610185578063aafb2d4411610154578063aafb2d44146108c1578063b88d4fde146108e1578063b9210fac14610901578063bd2a51311461092157600080fd5b8063a201fc501461084c578063a22cb4651461086c578063a634d6271461088c578063a9fafa2d146108a157600080fd5b80638da5cb5b116101c15780638da5cb5b146107e157806393f07e4b1461080057806395d89b4114610820578063969ab2f51461083557600080fd5b80637fd31b891461077a5780638456cb591461079a5780638626fc0a146107af5780638a5f6324146107c657600080fd5b806342842e0e116102e257806353a6bd18116102755780636f8b44b0116102445780636f8b44b01461070557806370a0823114610725578063715018a6146107455780637e7d23b71461075a57600080fd5b806353a6bd18146106965780635c975abb146106ad57806361048775146106c55780636352211e146106e557600080fd5b80634f6ccce7116102b15780634f6ccce7146106295780634f75253f1461064957806352d1902d14610660578063537e8b5c1461067557600080fd5b806342842e0e146105b65780634cd88b76146105d65780634dd23a6c146105f65780634f1ef2861461061657600080fd5b806324c7b1f31161035a5780633659cfe6116103295780633659cfe61461054c5780633a367a671461056c5780633f17fe4f146105815780633f4ba83a146105a157600080fd5b806324c7b1f3146104e657806326879d16146105065780632f745c591461051957806331c864e81461053957600080fd5b8063095ea7b311610396578063095ea7b31461046e5780630bc09c791461048e57806318160ddd146104b157806323b872dd146104c657600080fd5b806301ffc9a7146103c857806306fdde03146103fd578063081812fc1461041f578063081c2b9814610457575b600080fd5b3480156103d457600080fd5b506103e86103e3366004613b2d565b610b2b565b60405190151581526020015b60405180910390f35b34801561040957600080fd5b50610412610b3c565b6040516103f49190613ba2565b34801561042b57600080fd5b5061043f61043a366004613bb5565b610bce565b6040516001600160a01b0390911681526020016103f4565b34801561046357600080fd5b5061046c610c5b565b005b34801561047a57600080fd5b5061046c610489366004613bea565b610c9b565b34801561049a57600080fd5b506104a3610db1565b6040519081526020016103f4565b3480156104bd57600080fd5b506099546104a3565b3480156104d257600080fd5b5061046c6104e1366004613c14565b610e00565b3480156104f257600080fd5b5061046c610501366004613bb5565b610e31565b61046c610514366004613c9c565b610e62565b34801561052557600080fd5b506104a3610534366004613bea565b611042565b61046c610547366004613bb5565b6110d8565b34801561055857600080fd5b5061046c610567366004613cef565b61131f565b34801561057857600080fd5b506104126113ff565b34801561058d57600080fd5b5061046c61059c366004613bb5565b61148e565b3480156105ad57600080fd5b5061046c6114bf565b3480156105c257600080fd5b5061046c6105d1366004613c14565b6114f4565b3480156105e257600080fd5b5061046c6105f1366004613d4c565b61150f565b34801561060257600080fd5b506101f6546103e890610100900460ff1681565b61046c610624366004613e4f565b61167c565b34801561063557600080fd5b506104a3610644366004613bb5565b61174d565b34801561065557600080fd5b506104a36102065481565b34801561066c57600080fd5b506104a36117e0565b34801561068157600080fd5b506101f6546103e89062010000900460ff1681565b3480156106a257600080fd5b506104a36101fa5481565b3480156106b957600080fd5b5060fb5460ff166103e8565b3480156106d157600080fd5b5061046c6106e0366004613ead565b611893565b3480156106f157600080fd5b5061043f610700366004613bb5565b6118db565b34801561071157600080fd5b5061046c610720366004613bb5565b611952565b34801561073157600080fd5b506104a3610740366004613cef565b611983565b34801561075157600080fd5b5061046c611a0a565b34801561076657600080fd5b506103e8610775366004613ec8565b611a3f565b34801561078657600080fd5b5061046c610795366004613efb565b611a6b565b3480156107a657600080fd5b5061046c611b2b565b3480156107bb57600080fd5b506104a36101f85481565b3480156107d257600080fd5b506101f6546103e89060ff1681565b3480156107ed57600080fd5b5061015f546001600160a01b031661043f565b34801561080c57600080fd5b506103e861081b366004613ec8565b611b5e565b34801561082c57600080fd5b50610412611b88565b34801561084157600080fd5b506104a36101fb5481565b34801561085857600080fd5b5061046c610867366004613f3d565b611b97565b34801561087857600080fd5b5061046c610887366004613f73565b611bcf565b34801561089857600080fd5b506104a3611bda565b3480156108ad57600080fd5b5061046c6108bc366004613bb5565b611c90565b3480156108cd57600080fd5b5061046c6108dc366004613fa6565b611cc1565b3480156108ed57600080fd5b5061046c6108fc366004614006565b611dc8565b34801561090d57600080fd5b5061046c61091c366004613ead565b611e00565b34801561092d57600080fd5b506104a36102055481565b34801561094457600080fd5b50610412610953366004613bb5565b611e46565b34801561096457600080fd5b506104a36101f95481565b34801561097b57600080fd5b506104a36101f75481565b34801561099257600080fd5b506103e86109a1366004613bb5565b6102046020526000908152604090205460ff1681565b3480156109c357600080fd5b5061046c611e9d565b3480156109d857600080fd5b5061046c6109e7366004613bb5565b611ed5565b3480156109f857600080fd5b5061046c610a0736600461406e565b611f06565b348015610a1857600080fd5b5061046c610a27366004613f3d565b611f58565b348015610a3857600080fd5b506104a36101fd5481565b348015610a4f57600080fd5b50610412611f90565b348015610a6457600080fd5b506103e8610a733660046140ba565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b61046c610aaf366004613c9c565b611fa0565b348015610ac057600080fd5b5061046c610acf366004613cef565b612172565b348015610ae057600080fd5b5061046c610aef366004613bea565b61220b565b348015610b0057600080fd5b5061046c610b0f3660046140e4565b6122bd565b348015610b2057600080fd5b506104a36101fc5481565b6000610b3682612304565b92915050565b606060658054610b4b90614106565b80601f0160208091040260200160405190810160405280929190818152602001828054610b7790614106565b8015610bc45780601f10610b9957610100808354040283529160200191610bc4565b820191906000526020600020905b815481529060010190602001808311610ba757829003601f168201915b5050505050905090565b6000610bd982612329565b610c3f5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152606960205260409020546001600160a01b031690565b61015f546001600160a01b03163314610c865760405162461bcd60e51b8152600401610c369061413b565b436101fd556101f6805460ff19166001179055565b6000610ca6826118db565b9050806001600160a01b0316836001600160a01b03161415610d145760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610c36565b336001600160a01b0382161480610d305750610d308133610a73565b610da25760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610c36565b610dac8383612346565b505050565b600080610dbc611bda565b90506101fa548111610dd057600091505090565b6101fc546101fd54610de29043614186565b610dec91906141b3565b6101fc54610dfa9190614186565b91505090565b610e0a33826123b4565b610e265760405162461bcd60e51b8152600401610c36906141c7565b610dac83838361249e565b61015f546001600160a01b03163314610e5c5760405162461bcd60e51b8152600401610c369061413b565b6101fd55565b600261012d541415610e865760405162461bcd60e51b8152600401610c3690614218565b600261012d5560fb5460ff1615610eaf5760405162461bcd60e51b8152600401610c369061424f565b6101f65462010000900460ff16610ef55760405162461bcd60e51b815260206004820152600a6024820152696e6f742061637469766560b01b6044820152606401610c36565b6000610f02338686612645565b9050610f4681848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506101ff5491506126949050565b610f895760405162461bcd60e51b815260206004820152601460248201527324b73b30b634b21036b2b935b63290383937b7b360611b6044820152606401610c36565b6000818152610203602052604090205460ff1615610fdb5760405162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e4818db185a5b5959608a1b6044820152606401610c36565b60008181526102036020908152604091829020805460ff1916600117905590513381527fcabd2b059543ad6d87814b758eb7a2d8d7b979791de93646feddce14a904f303910160405180910390a1611035858560016126e7565b5050600161012d55505050565b600061104d83611983565b82106110af5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610c36565b506001600160a01b03919091166000908152609760209081526040808320938352929052205490565b600261012d5414156110fc5760405162461bcd60e51b8152600401610c3690614218565b600261012d5560fb5460ff16156111255760405162461bcd60e51b8152600401610c369061424f565b6101f65460ff1661116c5760405162461bcd60e51b8152602060048201526011602482015270496e6163746976652041756374696f6e7360781b6044820152606401610c36565b60018110156111af5760405162461bcd60e51b815260206004820152600f60248201526e4d696e20616d6f756e74206973203160881b6044820152606401610c36565b60058111156111f25760405162461bcd60e51b815260206004820152600f60248201526e4d617820616d6f756e74206973203560881b6044820152606401610c36565b610205546111fe610db1565b101561122057610206546101fd600082825461121a9190614279565b90915550505b600061122a611bda565b90506112368183614291565b3410156112765760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401610c36565b60005b828110156113145760006101f854116112c45760405162461bcd60e51b815260206004820152600d60248201526c6f7574206f6620746f6b656e7360981b6044820152606401610c36565b6101f880549060006112d5836142b0565b919050555060006112e66101f55490565b90506112f76101f580546001019055565b61130133826127aa565b508061130c816142c7565b915050611279565b5050600161012d5550565b306001600160a01b037f0000000000000000000000006367b961d1ed31b3b6c50a7a5769388f826331991614156113685760405162461bcd60e51b8152600401610c36906142e2565b7f0000000000000000000000006367b961d1ed31b3b6c50a7a5769388f826331996001600160a01b03166113b160008051602061462b833981519152546001600160a01b031690565b6001600160a01b0316146113d75760405162461bcd60e51b8152600401610c369061432e565b6113e0816127fc565b604080516000808252602082019092526113fc91839190612827565b50565b610200805461140d90614106565b80601f016020809104026020016040519081016040528092919081815260200182805461143990614106565b80156114865780601f1061145b57610100808354040283529160200191611486565b820191906000526020600020905b81548152906001019060200180831161146957829003601f168201915b505050505081565b61015f546001600160a01b031633146114b95760405162461bcd60e51b8152600401610c369061413b565b6101fe55565b61015f546001600160a01b031633146114ea5760405162461bcd60e51b8152600401610c369061413b565b6114f2612992565b565b610dac83838360405180602001604052806000815250611dc8565b600054610100900460ff1661152a5760005460ff161561152e565b303b155b6115915760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610c36565b600054610100900460ff161580156115b3576000805461ffff19166101011790555b6116016040518060400160405280600a815260200169665269454e445369455360b01b8152506040518060400160405280600a815260200169665269454e445369455360b01b815250612a25565b611609612a56565b611611612a56565b611619612a7d565b611621612aac565b611629612adb565b611631612a56565b61163e6102008686613a0a565b5061164c6102018484613a0a565b506127106101f7556116636101f580546001019055565b8015611675576000805461ff00191690555b5050505050565b306001600160a01b037f0000000000000000000000006367b961d1ed31b3b6c50a7a5769388f826331991614156116c55760405162461bcd60e51b8152600401610c36906142e2565b7f0000000000000000000000006367b961d1ed31b3b6c50a7a5769388f826331996001600160a01b031661170e60008051602061462b833981519152546001600160a01b031690565b6001600160a01b0316146117345760405162461bcd60e51b8152600401610c369061432e565b61173d826127fc565b61174982826001612827565b5050565b600061175860995490565b82106117bb5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610c36565b609982815481106117ce576117ce61437a565b90600052602060002001549050919050565b6000306001600160a01b037f0000000000000000000000006367b961d1ed31b3b6c50a7a5769388f8263319916146118805760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610c36565b5060008051602061462b83398151915290565b61015f546001600160a01b031633146118be5760405162461bcd60e51b8152600401610c369061413b565b6101f68054911515620100000262ff000019909216919091179055565b6000818152606760205260408120546001600160a01b031680610b365760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610c36565b61015f546001600160a01b0316331461197d5760405162461bcd60e51b8152600401610c369061413b565b6101f755565b60006001600160a01b0382166119ee5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610c36565b506001600160a01b031660009081526068602052604090205490565b61015f546001600160a01b03163314611a355760405162461bcd60e51b8152600401610c369061413b565b6114f26000612b0a565b600080611a4d858585612645565b6000908152610202602052604090205460ff169150505b9392505050565b600261012d541415611a8f5760405162461bcd60e51b8152600401610c3690614218565b600261012d5561015f546001600160a01b03163314611ac05760405162461bcd60e51b8152600401610c369061413b565b60005b81811015611314576000611ad76101f55490565b9050611ae86101f580546001019055565b611b18848484818110611afd57611afd61437a565b9050602002016020810190611b129190613cef565b826127aa565b5080611b23816142c7565b915050611ac3565b61015f546001600160a01b03163314611b565760405162461bcd60e51b8152600401610c369061413b565b6114f2612b5d565b600080611b6c858585612645565b6000908152610203602052604090205460ff1695945050505050565b606060668054610b4b90614106565b61015f546001600160a01b03163314611bc25760405162461bcd60e51b8152600401610c369061413b565b610dac6102018383613a0a565b611749338383612bb5565b6101f65460009060ff16611c245760405162461bcd60e51b8152602060048201526011602482015270496e6163746976652041756374696f6e7360781b6044820152606401610c36565b60006101fb546101fc546101fd5443611c3d9190614186565b611c479190614390565b611c519190614291565b90506101f954811115611c675750506101fa5490565b6000816101f954611c789190614186565b90506101fa54811015610b36576101fa549250505090565b61015f546001600160a01b03163314611cbb5760405162461bcd60e51b8152600401610c369061413b565b6101ff55565b61015f546001600160a01b03163314611cec5760405162461bcd60e51b8152600401610c369061413b565b828114611d315760405162461bcd60e51b81526020600482015260136024820152720d8cadc50c2e4e4c2f25240dad2e6dac2e8c6d606b1b6044820152606401610c36565b60005b8381101561167557611db6858583818110611d5157611d5161437a565b90506020020135848484818110611d6a57611d6a61437a565b9050602002810190611d7c91906143a4565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612c8492505050565b80611dc0816142c7565b915050611d34565b611dd233836123b4565b611dee5760405162461bcd60e51b8152600401610c36906141c7565b611dfa84848484612d0f565b50505050565b61015f546001600160a01b03163314611e2b5760405162461bcd60e51b8152600401610c369061413b565b6101f680549115156101000261ff0019909216919091179055565b60606000611e5383612d42565b805190915015611e635792915050565b610200611e6f84612eb1565b604051602001611e80929190614407565b604051602081830303815290604052915050919050565b50919050565b61015f546001600160a01b03163314611ec85760405162461bcd60e51b8152600401610c369061413b565b6101f6805460ff19169055565b61015f546001600160a01b03163314611f005760405162461bcd60e51b8152600401610c369061413b565b6101f855565b61015f546001600160a01b03163314611f315760405162461bcd60e51b8152600401610c369061413b565b6101f9969096556101fa949094556101fb929092556101fc5561020555610206556101f855565b61015f546001600160a01b03163314611f835760405162461bcd60e51b8152600401610c369061413b565b610dac6102008383613a0a565b60606102018054610b4b90614106565b600261012d541415611fc45760405162461bcd60e51b8152600401610c3690614218565b600261012d5560fb5460ff1615611fed5760405162461bcd60e51b8152600401610c369061424f565b6101f654610100900460ff166120325760405162461bcd60e51b815260206004820152600a6024820152696e6f742061637469766560b01b6044820152606401610c36565b600061203f338686612645565b905061208381848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506101fe5491506126949050565b6120c65760405162461bcd60e51b815260206004820152601460248201527324b73b30b634b21036b2b935b63290383937b7b360611b6044820152606401610c36565b6000818152610202602052604090205460ff16156121185760405162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e4818db185a5b5959608a1b6044820152606401610c36565b60008181526102026020908152604091829020805460ff1916600117905590513381527fa77bda73b4933afd4b63289b27c5dcd90a116f9511d8655ee6a241104ceeed26910160405180910390a1611035858560006126e7565b61015f546001600160a01b0316331461219d5760405162461bcd60e51b8152600401610c369061413b565b6001600160a01b0381166122025760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c36565b6113fc81612b0a565b600261012d54141561222f5760405162461bcd60e51b8152600401610c3690614218565b600261012d5561015f546001600160a01b031633146122605760405162461bcd60e51b8152600401610c369061413b565b6001600160a01b0382166122a95760405162461bcd60e51b815260206004820152601060248201526f7a65726f205f746f206164647265737360801b6044820152606401610c36565b6122b38282612faf565b5050600161012d55565b61015f546001600160a01b031633146122e85760405162461bcd60e51b8152600401610c369061413b565b6102059190915561020655565b6001600160a01b03163b151590565b60006001600160e01b0319821663780e9d6360e01b1480610b365750610b3682613061565b6000908152606760205260409020546001600160a01b0316151590565b600081815260696020526040902080546001600160a01b0319166001600160a01b038416908117909155819061237b826118db565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006123bf82612329565b6124205760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610c36565b600061242b836118db565b9050806001600160a01b0316846001600160a01b031614806124665750836001600160a01b031661245b84610bce565b6001600160a01b0316145b8061249657506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b03166124b1826118db565b6001600160a01b0316146125155760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610c36565b6001600160a01b0382166125775760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610c36565b6125828383836130b1565b61258d600082612346565b6001600160a01b03831660009081526068602052604081208054600192906125b6908490614186565b90915550506001600160a01b03821660009081526068602052604081208054600192906125e4908490614279565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6040516bffffffffffffffffffffffff19606085901b16602082015260348101839052605481018290526000906074016040516020818303038152906040528051906020012090509392505050565b6000808351116126dc5760405162461bcd60e51b815260206004820152601360248201527236b2b935b6329d1032b6b83a3c90383937b7b360691b6044820152606401610c36565b6124968383866130df565b6126f88266038d7ea4c68000614291565b91506127048284614291565b3410156127445760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401610c36565b60005b83811015611dfa57600061275b6101f55490565b905061276c6101f580546001019055565b821561278d57600081815261020460205260409020805460ff191660011790555b61279733826127aa565b50806127a2816142c7565b915050612747565b6101f754609954106127f25760405162461bcd60e51b81526020600482015260116024820152701b585e14dd5c1c1b1e481c995858da1959607a1b6044820152606401610c36565b61174982826130f5565b61015f546001600160a01b031633146113fc5760405162461bcd60e51b8152600401610c369061413b565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561285a57610dac8361310f565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156128b4575060408051601f3d908101601f191682019092526128b1918101906144b9565b60015b6129175760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610c36565b60008051602061462b83398151915281146129865760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610c36565b50610dac8383836131ab565b60fb5460ff166129db5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c36565b60fb805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600054610100900460ff16612a4c5760405162461bcd60e51b8152600401610c36906144d2565b61174982826131d0565b600054610100900460ff166114f25760405162461bcd60e51b8152600401610c36906144d2565b600054610100900460ff16612aa45760405162461bcd60e51b8152600401610c36906144d2565b6114f261321e565b600054610100900460ff16612ad35760405162461bcd60e51b8152600401610c36906144d2565b6114f2613251565b600054610100900460ff16612b025760405162461bcd60e51b8152600401610c36906144d2565b6114f2613280565b61015f80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60fb5460ff1615612b805760405162461bcd60e51b8152600401610c369061424f565b60fb805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612a083390565b816001600160a01b0316836001600160a01b03161415612c175760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610c36565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612c8d82612329565b612cf05760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b6064820152608401610c36565b600082815260c9602090815260409091208251610dac92840190613a8e565b612d1a84848461249e565b612d26848484846132b0565b611dfa5760405162461bcd60e51b8152600401610c369061451d565b6060612d4d82612329565b612db35760405162461bcd60e51b815260206004820152603160248201527f45524337323155524953746f726167653a2055524920717565727920666f72206044820152703737b732bc34b9ba32b73a103a37b5b2b760791b6064820152608401610c36565b600082815260c9602052604081208054612dcc90614106565b80601f0160208091040260200160405190810160405280929190818152602001828054612df890614106565b8015612e455780601f10612e1a57610100808354040283529160200191612e45565b820191906000526020600020905b815481529060010190602001808311612e2857829003601f168201915b505050505090506000612e6360408051602081019091526000815290565b9050805160001415612e76575092915050565b815115612ea8578082604051602001612e9092919061456f565b60405160208183030381529060405292505050919050565b612496846133ae565b606081612ed55750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612eff5780612ee9816142c7565b9150612ef89050600a83614390565b9150612ed9565b60008167ffffffffffffffff811115612f1a57612f1a613dac565b6040519080825280601f01601f191660200182016040528015612f44576020820181803683370190505b5090505b841561249657612f59600183614186565b9150612f66600a866141b3565b612f71906030614279565b60f81b818381518110612f8657612f8661437a565b60200101906001600160f81b031916908160001a905350612fa8600a86614390565b9450612f48565b6040805160008082526020820192839052916001600160a01b03851691617530918591612fdb9161459e565b600060405180830381858888f193505050503d8060008114613019576040519150601f19603f3d011682016040523d82523d6000602084013e61301e565b606091505b5050905080610dac5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606401610c36565b60006001600160e01b031982166380ac58cd60e01b148061309257506001600160e01b03198216635b5e139f60e01b145b80610b3657506301ffc9a760e01b6001600160e01b0319831614610b36565b60fb5460ff16156130d45760405162461bcd60e51b8152600401610c369061424f565b610dac83838361346f565b6000826130ec8584613527565b14949350505050565b61174982826040518060200160405280600081525061359b565b6001600160a01b0381163b61317c5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610c36565b60008051602061462b83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6131b4836135ce565b6000825111806131c15750805b15610dac57611dfa838361360e565b600054610100900460ff166131f75760405162461bcd60e51b8152600401610c36906144d2565b815161320a906065906020850190613a8e565b508051610dac906066906020840190613a8e565b600054610100900460ff166132455760405162461bcd60e51b8152600401610c36906144d2565b60fb805460ff19169055565b600054610100900460ff166132785760405162461bcd60e51b8152600401610c36906144d2565b600161012d55565b600054610100900460ff166132a75760405162461bcd60e51b8152600401610c36906144d2565b6114f233612b0a565b60006001600160a01b0384163b156133a357604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906132f49033908990889088906004016145ba565b6020604051808303816000875af192505050801561332f575060408051601f3d908101601f1916820190925261332c918101906145f7565b60015b613389573d80801561335d576040519150601f19603f3d011682016040523d82523d6000602084013e613362565b606091505b5080516133815760405162461bcd60e51b8152600401610c369061451d565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612496565b506001949350505050565b60606133b982612329565b61341d5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610c36565b600061343460408051602081019091526000815290565b905060008151116134545760405180602001604052806000815250611a64565b8061345e84612eb1565b604051602001611e8092919061456f565b6001600160a01b0383166134ca576134c581609980546000838152609a60205260408120829055600182018355919091527f72a152ddfb8e864297c917af52ea6c1c68aead0fee1a62673fcc7e0c94979d000155565b6134ed565b816001600160a01b0316836001600160a01b0316146134ed576134ed8382613702565b6001600160a01b03821661350457610dac8161379f565b826001600160a01b0316826001600160a01b031614610dac57610dac828261384e565b600081815b84518110156135935760008582815181106135495761354961437a565b6020026020010151905080831161356f5760008381526020829052604090209250613580565b600081815260208490526040902092505b508061358b816142c7565b91505061352c565b509392505050565b6135a58383613892565b6135b260008484846132b0565b610dac5760405162461bcd60e51b8152600401610c369061451d565b6135d78161310f565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6136765760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610c36565b600080846001600160a01b031684604051613691919061459e565b600060405180830381855af49150503d80600081146136cc576040519150601f19603f3d011682016040523d82523d6000602084013e6136d1565b606091505b50915091506136f9828260405180606001604052806027815260200161464b602791396139d1565b95945050505050565b6000600161370f84611983565b6137199190614186565b60008381526098602052604090205490915080821461376c576001600160a01b03841660009081526097602090815260408083208584528252808320548484528184208190558352609890915290208190555b5060009182526098602090815260408084208490556001600160a01b039094168352609781528383209183525290812055565b6099546000906137b190600190614186565b6000838152609a6020526040812054609980549394509092849081106137d9576137d961437a565b9060005260206000200154905080609983815481106137fa576137fa61437a565b6000918252602080832090910192909255828152609a9091526040808220849055858252812055609980548061383257613832614614565b6001900381819060005260206000200160009055905550505050565b600061385983611983565b6001600160a01b039093166000908152609760209081526040808320868452825280832085905593825260989052919091209190915550565b6001600160a01b0382166138e85760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c36565b6138f181612329565b1561393e5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c36565b61394a600083836130b1565b6001600160a01b0382166000908152606860205260408120805460019290613973908490614279565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b606083156139e0575081611a64565b8251156139f05782518084602001fd5b8160405162461bcd60e51b8152600401610c369190613ba2565b828054613a1690614106565b90600052602060002090601f016020900481019282613a385760008555613a7e565b82601f10613a515782800160ff19823516178555613a7e565b82800160010185558215613a7e579182015b82811115613a7e578235825591602001919060010190613a63565b50613a8a929150613b02565b5090565b828054613a9a90614106565b90600052602060002090601f016020900481019282613abc5760008555613a7e565b82601f10613ad557805160ff1916838001178555613a7e565b82800160010185558215613a7e579182015b82811115613a7e578251825591602001919060010190613ae7565b5b80821115613a8a5760008155600101613b03565b6001600160e01b0319811681146113fc57600080fd5b600060208284031215613b3f57600080fd5b8135611a6481613b17565b60005b83811015613b65578181015183820152602001613b4d565b83811115611dfa5750506000910152565b60008151808452613b8e816020860160208601613b4a565b601f01601f19169290920160200192915050565b602081526000611a646020830184613b76565b600060208284031215613bc757600080fd5b5035919050565b80356001600160a01b0381168114613be557600080fd5b919050565b60008060408385031215613bfd57600080fd5b613c0683613bce565b946020939093013593505050565b600080600060608486031215613c2957600080fd5b613c3284613bce565b9250613c4060208501613bce565b9150604084013590509250925092565b60008083601f840112613c6257600080fd5b50813567ffffffffffffffff811115613c7a57600080fd5b6020830191508360208260051b8501011115613c9557600080fd5b9250929050565b60008060008060608587031215613cb257600080fd5b8435935060208501359250604085013567ffffffffffffffff811115613cd757600080fd5b613ce387828801613c50565b95989497509550505050565b600060208284031215613d0157600080fd5b611a6482613bce565b60008083601f840112613d1c57600080fd5b50813567ffffffffffffffff811115613d3457600080fd5b602083019150836020828501011115613c9557600080fd5b60008060008060408587031215613d6257600080fd5b843567ffffffffffffffff80821115613d7a57600080fd5b613d8688838901613d0a565b90965094506020870135915080821115613d9f57600080fd5b50613ce387828801613d0a565b634e487b7160e01b600052604160045260246000fd5b600082601f830112613dd357600080fd5b813567ffffffffffffffff80821115613dee57613dee613dac565b604051601f8301601f19908116603f01168101908282118183101715613e1657613e16613dac565b81604052838152866020858801011115613e2f57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060408385031215613e6257600080fd5b613e6b83613bce565b9150602083013567ffffffffffffffff811115613e8757600080fd5b613e9385828601613dc2565b9150509250929050565b80358015158114613be557600080fd5b600060208284031215613ebf57600080fd5b611a6482613e9d565b600080600060608486031215613edd57600080fd5b613ee684613bce565b95602085013595506040909401359392505050565b60008060208385031215613f0e57600080fd5b823567ffffffffffffffff811115613f2557600080fd5b613f3185828601613c50565b90969095509350505050565b60008060208385031215613f5057600080fd5b823567ffffffffffffffff811115613f6757600080fd5b613f3185828601613d0a565b60008060408385031215613f8657600080fd5b613f8f83613bce565b9150613f9d60208401613e9d565b90509250929050565b60008060008060408587031215613fbc57600080fd5b843567ffffffffffffffff80821115613fd457600080fd5b613fe088838901613c50565b90965094506020870135915080821115613ff957600080fd5b50613ce387828801613c50565b6000806000806080858703121561401c57600080fd5b61402585613bce565b935061403360208601613bce565b925060408501359150606085013567ffffffffffffffff81111561405657600080fd5b61406287828801613dc2565b91505092959194509250565b600080600080600080600060e0888a03121561408957600080fd5b505085359760208701359750604087013596606081013596506080810135955060a0810135945060c0013592509050565b600080604083850312156140cd57600080fd5b6140d683613bce565b9150613f9d60208401613bce565b600080604083850312156140f757600080fd5b50508035926020909101359150565b600181811c9082168061411a57607f821691505b60208210811415611e9757634e487b7160e01b600052602260045260246000fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008282101561419857614198614170565b500390565b634e487b7160e01b600052601260045260246000fd5b6000826141c2576141c261419d565b500690565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6000821982111561428c5761428c614170565b500190565b60008160001904831182151516156142ab576142ab614170565b500290565b6000816142bf576142bf614170565b506000190190565b60006000198214156142db576142db614170565b5060010190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b60008261439f5761439f61419d565b500490565b6000808335601e198436030181126143bb57600080fd5b83018035915067ffffffffffffffff8211156143d657600080fd5b602001915036819003821315613c9557600080fd5b600081516143fd818560208601613b4a565b9290920192915050565b600080845481600182811c91508083168061442357607f831692505b602080841082141561444357634e487b7160e01b86526022600452602486fd5b818015614457576001811461446857614495565b60ff19861689528489019650614495565b60008b81526020902060005b8681101561448d5781548b820152908501908301614474565b505084890196505b5050505050506136f96144a882866143eb565b64173539b7b760d91b815260050190565b6000602082840312156144cb57600080fd5b5051919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60008351614581818460208801613b4a565b835190830190614595818360208801613b4a565b01949350505050565b600082516145b0818460208701613b4a565b9190910192915050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906145ed90830184613b76565b9695505050505050565b60006020828403121561460957600080fd5b8151611a6481613b17565b634e487b7160e01b600052603160045260246000fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220193c6182f90ee00fe7b00399f3be6326b208edb66425c7c60ebd344e8c153f1d64736f6c634300080b0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.