Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
0x61010060 | 16900266 | 468 days ago | IN | Create: FixedPriceToken | 0 ETH | 0.13655207 |
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:
FixedPriceToken
Compiler Version
v0.8.16+commit.07a7930e
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.13; import {TokenBase} from "../TokenBase.sol"; import {IHTMLRenderer} from "../renderer/interfaces/IHTMLRenderer.sol"; import {IObservability} from "../observability/Observability.sol"; import {IFixedPriceToken} from "./interfaces/IFixedPriceToken.sol"; import {IHTMLRenderer} from "../renderer/interfaces/IHTMLRenderer.sol"; import {StringsUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import {FixedPriceTokenStorageV1} from "./storage/FixedPriceTokenStorageV1.sol"; import {FixedPriceTokenStorageV2} from "./storage/FixedPriceTokenStorageV2.sol"; import {ITokenFactory} from "../interfaces/ITokenFactory.sol"; import {HTMLRendererProxy} from "../renderer/HTMLRendererProxy.sol"; import {IHTMLRenderer} from "../renderer/interfaces/IHTMLRenderer.sol"; import {IFileStore} from "ethfs/IFileStore.sol"; import {SSTORE2} from "@0xsequence/sstore2/contracts/SSTORE2.sol"; import {Base64} from "base64-sol/base64.sol"; import {IInteractable} from "../interactors/interfaces/IInteractable.sol"; import {IInteractor} from "../interactors/interfaces/IInteractor.sol"; contract FixedPriceToken is IFixedPriceToken, TokenBase, FixedPriceTokenStorageV1, FixedPriceTokenStorageV2, IInteractable { using StringsUpgradeable for uint256; //[[[[SETUP FUNCTIONS]]]] constructor(address _factory, address _o11y) TokenBase(_factory, _o11y) {} /// @notice Initializes the token function initialize( address owner, bytes calldata data ) external initializer { if (msg.sender != factory) revert FactoryMustInitilize(); ( string memory _script, string memory _previewBaseURI, address _rendererImpl, TokenInfo memory _tokenInfo, SaleInfo memory _saleInfo, IHTMLRenderer.FileType[] memory _imports ) = abi.decode( data, ( string, string, address, TokenInfo, SaleInfo, IHTMLRenderer.FileType[] ) ); if (!(ITokenFactory(factory).isValidDeployment(_rendererImpl))) revert ITokenFactory.NotDeployed(_rendererImpl); htmlRenderer = address(new HTMLRendererProxy(_rendererImpl, "")); allowedMinters[owner] = true; tokenInfo = _tokenInfo; saleInfo = _saleInfo; IHTMLRenderer(htmlRenderer).initilize(owner); __ERC721_init(_tokenInfo.name, _tokenInfo.symbol); _transferOwnership(owner); _addManyImports(_imports); _setScript(_script); _setPreviewBaseURI(_previewBaseURI); _mintArtistProofs(_saleInfo.artistProofCount); } //[[[[VIEW FUNCTIONS]]]] /// @notice a helper function for generating inital contract props function constructInitalProps( string memory _script, string memory _previewBaseURI, address _rendererImpl, TokenInfo memory _tokenInfo, SaleInfo memory _saleInfo, IHTMLRenderer.FileType[] memory _imports ) public pure returns (bytes memory) { return abi.encode( _script, _previewBaseURI, _rendererImpl, _tokenInfo, _saleInfo, _imports ); } /// @notice returns token metadata for a given token id function tokenURI( uint256 tokenId ) public view override returns (string memory) { string memory tokenIdString = tokenId.toString(); string memory fullName = string( abi.encodePacked(name(), " ", tokenIdString) ); string memory animationURL = tokenHTML(tokenId); string memory image = generatePreviewURI(tokenIdString); return genericDataURI( fullName, tokenInfo.description, animationURL, image ); } /// @notice contruct a generic data URI from token data function genericDataURI( string memory _name, string memory _description, string memory _animationURL, string memory _image ) public pure returns (string memory) { return string.concat( "data:application/json;base64,", Base64.encode( bytes( string.concat( '{"name":"', _name, '", "description":"', _description, '", "animation_url": "', _animationURL, '", "image": "', _image, '"}' ) ) ) ); } /// @notice generate a preview URI for the token function generatePreviewURI( string memory tokenId ) public view returns (string memory) { return string.concat( previewBaseURI, uint256(uint160(address(this))).toHexString(20), "/", tokenId ); } /// @notice generate the html for the token function tokenHTML(uint256 tokenId) public view returns (string memory) { return IHTMLRenderer(htmlRenderer).generateURI( imports, generateFullScript(tokenId) ); } /// @notice generate the full script for the token function generateFullScript( uint256 tokenId ) public view returns (string memory) { return string.concat( "<script>", (interactor != address(0)) ? string(getInteractionData(tokenId)) : "", 'var blockHash="', uint256(tokenIdToPreviousBlockHash[tokenId]).toString(), '";var tokenId="', tokenId.toString(), '";var timestamp="', block.timestamp.toString(), '";', getScript(), "</script>" ); } /// @notice get the script for the contract function getScript() public view returns (string memory) { return string(SSTORE2.read(scriptPointer)); } //[[[[SCRIPT FUNCTIONS]]]] /// @notice set the script for the contract function setScript(string memory script) public onlyOwner { _setScript(script); } //[[[[PREVIEW FUNCTIONS]]]] /// @notice get the preview base URI for the token function setPreviewBaseURL(string memory uri) public onlyOwner { _setPreviewBaseURI(uri); } //[[[[RENDERER FUNCTIONS]]]] /// @notice set the html renderer for the token function setHTMLRenderer(address _htmlRenderer) external onlyOwner { htmlRenderer = _htmlRenderer; } /// @notice add an import to the token function addImport( IHTMLRenderer.FileType calldata _import ) external onlyOwner { _addImport(_import); } /// @notice add multiple imports to the token function addManyImports( IHTMLRenderer.FileType[] calldata _imports ) external onlyOwner { _addManyImports(_imports); } /// @notice set a single import to the token for a given index function setImport( uint256 index, IHTMLRenderer.FileType calldata _import ) external onlyOwner { _setImport(index, _import); } //[[[[PURCHASE FUNCTIONS]]]] /// @notice purchase a number of tokens function purchase(uint256 amount) external payable nonReentrant { if ( block.timestamp < saleInfo.startTime || block.timestamp >= saleInfo.endTime ) revert SaleNotActive(); if (msg.value < (amount * saleInfo.price)) revert InvalidPrice(); if (totalSupply() + amount > tokenInfo.maxSupply) revert SoldOut(); IObservability(o11y).emitSale(msg.sender, saleInfo.price, amount); for (uint256 i = 0; i < amount; i++) { _seedAndMint(msg.sender); } } //[[[Sale Info Functions]]] ///@notice allow owner to update sale info function setSaleInfo( uint64 startTime, uint64 endTime, uint112 price ) external onlyOwner { saleInfo.startTime = startTime; saleInfo.endTime = endTime; saleInfo.price = price; } // [[[ Interactor Functions ]]] function getInteractor() external view returns (address) { return interactor; } function setInteractor(address _interactor) external { interactor = _interactor; } function interact( uint256 tokenId, bytes calldata interactionData, bytes calldata validationData ) external { IInteractor(interactor).interact( msg.sender, tokenId, interactionData, validationData ); } function getInteractionData( uint256 tokenId ) internal view returns (bytes memory data) { (data, ) = IInteractor(interactor).getInteractionData( address(this), tokenId ); } //[[[[PRIVATE FUNCTIONS]]]] /// @notice adds a single import function _addImport(IHTMLRenderer.FileType memory _import) private { imports.push(_import); } /// @notice adds many imports function _addManyImports(IHTMLRenderer.FileType[] memory _imports) private { uint256 numImports = _imports.length; for (uint256 i; i < numImports; i++) { _addImport(_imports[i]); } } /// @notice sets a single import for the given index function _setImport( uint256 index, IHTMLRenderer.FileType memory _import ) private { imports[index] = _import; } /// @notice store the script and ovverwrite the script pointer function _setScript(string memory script) private { scriptPointer = SSTORE2.write(bytes(script)); } /// @notice set the preview base URI function _setPreviewBaseURI(string memory _previewBaseURI) private { previewBaseURI = _previewBaseURI; } /// @notice mint the artist proofs function _mintArtistProofs(uint16 amount) private { if (proofsMinted) revert ProofsMinted(); for (uint256 i = 0; i < amount; i++) { _seedAndMint(owner()); } proofsMinted = true; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; /// @title Base64 /// @author Brecht Devos - <[email protected]> /// @notice Provides functions for encoding/decoding base64 library Base64 { string internal constant TABLE_ENCODE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; bytes internal constant TABLE_DECODE = hex"0000000000000000000000000000000000000000000000000000000000000000" hex"00000000000000000000003e0000003f3435363738393a3b3c3d000000000000" hex"00000102030405060708090a0b0c0d0e0f101112131415161718190000000000" hex"001a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132330000000000"; function encode(bytes memory data) internal pure returns (string memory) { if (data.length == 0) return ''; // load the table into memory string memory table = TABLE_ENCODE; // multiply by 4/3 rounded up uint256 encodedLen = 4 * ((data.length + 2) / 3); // add some extra buffer at the end required for the writing string memory result = new string(encodedLen + 32); assembly { // set the actual output length mstore(result, encodedLen) // prepare the lookup table let tablePtr := add(table, 1) // input ptr let dataPtr := data let endPtr := add(dataPtr, mload(data)) // result ptr, jump over length let resultPtr := add(result, 32) // run over the input, 3 bytes at a time for {} lt(dataPtr, endPtr) {} { // read 3 bytes dataPtr := add(dataPtr, 3) let input := mload(dataPtr) // write 4 characters mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F)))) resultPtr := add(resultPtr, 1) mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F)))) resultPtr := add(resultPtr, 1) mstore8(resultPtr, mload(add(tablePtr, and(shr( 6, input), 0x3F)))) resultPtr := add(resultPtr, 1) mstore8(resultPtr, mload(add(tablePtr, and( input, 0x3F)))) resultPtr := add(resultPtr, 1) } // padding with '=' switch mod(mload(data), 3) case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) } case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) } } return result; } function decode(string memory _data) internal pure returns (bytes memory) { bytes memory data = bytes(_data); if (data.length == 0) return new bytes(0); require(data.length % 4 == 0, "invalid base64 decoder input"); // load the table into memory bytes memory table = TABLE_DECODE; // every 4 characters represent 3 bytes uint256 decodedLen = (data.length / 4) * 3; // add some extra buffer at the end required for the writing bytes memory result = new bytes(decodedLen + 32); assembly { // padding with '=' let lastBytes := mload(add(data, mload(data))) if eq(and(lastBytes, 0xFF), 0x3d) { decodedLen := sub(decodedLen, 1) if eq(and(lastBytes, 0xFFFF), 0x3d3d) { decodedLen := sub(decodedLen, 1) } } // set the actual output length mstore(result, decodedLen) // prepare the lookup table let tablePtr := add(table, 1) // input ptr let dataPtr := data let endPtr := add(dataPtr, mload(data)) // result ptr, jump over length let resultPtr := add(result, 32) // run over the input, 4 characters at a time for {} lt(dataPtr, endPtr) {} { // read 4 characters dataPtr := add(dataPtr, 4) let input := mload(dataPtr) // write 3 bytes let output := add( add( shl(18, and(mload(add(tablePtr, and(shr(24, input), 0xFF))), 0xFF)), shl(12, and(mload(add(tablePtr, and(shr(16, input), 0xFF))), 0xFF))), add( shl( 6, and(mload(add(tablePtr, and(shr( 8, input), 0xFF))), 0xFF)), and(mload(add(tablePtr, and( input , 0xFF))), 0xFF) ) ) mstore(resultPtr, shl(232, output)) resultPtr := add(resultPtr, 3) } } return result; } }
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.13; struct Content { bytes32 checksum; address pointer; } struct File { uint256 size; // content length in bytes, max 24k Content[] contents; } function read(File memory file) view returns (string memory contents) { Content[] memory chunks = file.contents; // Adapted from https://gist.github.com/xtremetom/20411eb126aaf35f98c8a8ffa00123cd assembly { let len := mload(chunks) let totalSize := 0x20 contents := mload(0x40) let size let chunk let pointer // loop through all pointer addresses // - get content // - get address // - get data size // - get code and add to contents // - update total size for { let i := 0 } lt(i, len) { i := add(i, 1) } { chunk := mload(add(chunks, add(0x20, mul(i, 0x20)))) pointer := mload(add(chunk, 0x20)) size := sub(extcodesize(pointer), 1) extcodecopy(pointer, add(contents, totalSize), 1, size) totalSize := add(totalSize, size) } // update contents size mstore(contents, sub(totalSize, 0x20)) // store contents mstore(0x40, add(contents, and(add(totalSize, 0x1f), not(0x1f)))) } } using { read } for File global;
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.13; interface IContentStore { event NewChecksum(bytes32 indexed checksum, uint256 contentSize); error ChecksumExists(bytes32 checksum); error ChecksumNotFound(bytes32 checksum); function pointers(bytes32 checksum) external view returns (address pointer); function checksumExists(bytes32 checksum) external view returns (bool); function contentLength(bytes32 checksum) external view returns (uint256 size); function addPointer(address pointer) external returns (bytes32 checksum); function addContent(bytes memory content) external returns (bytes32 checksum, address pointer); function getPointer(bytes32 checksum) external view returns (address pointer); }
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.13; import {File} from "./File.sol"; import {IContentStore} from "./IContentStore.sol"; interface IFileStore { event FileCreated( string indexed indexedFilename, bytes32 indexed checksum, string filename, uint256 size, bytes metadata ); event FileDeleted( string indexed indexedFilename, bytes32 indexed checksum, string filename ); error FileNotFound(string filename); error FilenameExists(string filename); error EmptyFile(); function contentStore() external view returns (IContentStore); function files(string memory filename) external view returns (bytes32 checksum); function fileExists(string memory filename) external view returns (bool); function getChecksum(string memory filename) external view returns (bytes32 checksum); function getFile(string memory filename) external view returns (File memory file); function createFile(string memory filename, bytes32[] memory checksums) external returns (File memory file); function createFile( string memory filename, bytes32[] memory checksums, bytes memory extraData ) external returns (File memory file); function deleteFile(string memory filename) external; }
// 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 IERC1822Proxiable { /** * @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.6.0) (proxy/Proxy.sol) pragma solidity ^0.8.0; /** * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to * be specified by overriding the virtual {_implementation} function. * * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a * different contract through the {_delegate} function. * * The success and return data of the delegated call will be returned back to the caller of the proxy. */ abstract contract Proxy { /** * @dev Delegates the current call to `implementation`. * * This function does not return to its internal call site, it will return directly to the external caller. */ function _delegate(address implementation) internal virtual { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function * and {_fallback} should delegate. */ function _implementation() internal view virtual returns (address); /** * @dev Delegates the current call to the address returned by `_implementation()`. * * This function does not return to its internal call site, it will return directly to the external caller. */ function _fallback() internal virtual { _beforeFallback(); _delegate(_implementation()); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other * function in the contract matches the call data. */ fallback() external payable virtual { _fallback(); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data * is empty. */ receive() external payable virtual { _fallback(); } /** * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback` * call, or as part of the Solidity `fallback` or `receive` functions. * * If overridden should call `super._beforeFallback()`. */ function _beforeFallback() internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol) pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "./OwnableUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides 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} and {acceptOwnership}. * * This module is used through inheritance. It will make available all functions * from parent (Ownable). */ abstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable { function __Ownable2Step_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable2Step_init_unchained() internal onlyInitializing { } address private _pendingOwner; event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); /** * @dev Returns the address of the pending owner. */ function pendingOwner() public view virtual returns (address) { return _pendingOwner; } /** * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual override onlyOwner { _pendingOwner = newOwner; emit OwnershipTransferStarted(owner(), newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner. * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual override { delete _pendingOwner; super._transferOwnership(newOwner); } /** * @dev The new owner accepts the ownership transfer. */ function acceptOwnership() external { address sender = _msgSender(); require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner"); _transferOwnership(sender); } /** * @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.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Internal function that returns the initialized version. Returns `_initialized` */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Internal function that returns the initialized version. Returns `_initializing` */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts 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() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _ownerOf(tokenId); require(owner != address(0), "ERC721: invalid token ID"); 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) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721Upgradeable.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner or approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); 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: caller is not token owner or 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: caller is not token owner or 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 the owner of the `tokenId`. Does NOT revert if token doesn't exist */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @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 _ownerOf(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) { address owner = ERC721Upgradeable.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == 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, 1); // Check that tokenId was not minted by `_beforeTokenTransfer` hook require(!_exists(tokenId), "ERC721: token already minted"); unchecked { // Will not overflow unless all 2**256 token ids are minted to the same owner. // Given that tokens are minted one by one, it is impossible in practice that // this ever happens. Might change if we allow batch minting. // The ERC fails to describe this case. _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId, 1); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721Upgradeable.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721Upgradeable.ownerOf(tokenId); // Clear approvals delete _tokenApprovals[tokenId]; unchecked { // Cannot overflow, as that would require more tokens to be burned/transferred // out than the owner initially received through minting and transferring in. _balances[owner] -= 1; } delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId, 1); } /** * @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, 1); // Check that tokenId was not transferred by `_beforeTokenTransfer` hook require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; unchecked { // `_balances[from]` cannot overflow for the same reason as described in `_burn`: // `from`'s balance is the number of token held, which is at least one before the current // transfer. // `_balances[to]` could overflow in the conditions described in `_mint`. That would require // all 2**256 token ids to be minted, which in practice is impossible. _balances[from] -= 1; _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {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 an {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 Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @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 { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`. * - When `from` is zero, the tokens will be minted for `to`. * - When `to` is zero, ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256, /* firstTokenId */ uint256 batchSize ) internal virtual { if (batchSize > 1) { if (from != address(0)) { _balances[from] -= batchSize; } if (to != address(0)) { _balances[to] += batchSize; } } } /** * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`. * - When `from` is zero, the tokens were minted for `to`. * - When `to` is zero, ``from``'s tokens were burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) 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 (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721ReceiverUpgradeable { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/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.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/MathUpgradeable.sol"; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = MathUpgradeable.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, MathUpgradeable.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts 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.7.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library MathUpgradeable { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./utils/Bytecode.sol"; /** @title A key-value storage with auto-generated keys for storing chunks of data with a lower write & read cost. @author Agustin Aguilar <[email protected]> Readme: https://github.com/0xsequence/sstore2#readme */ library SSTORE2 { error WriteError(); /** @notice Stores `_data` and returns `pointer` as key for later retrieval @dev The pointer is a contract address with `_data` as code @param _data to be written @return pointer Pointer to the written `_data` */ function write(bytes memory _data) internal returns (address pointer) { // Append 00 to _data so contract can't be called // Build init code bytes memory code = Bytecode.creationCodeFor( abi.encodePacked( hex'00', _data ) ); // Deploy contract using create assembly { pointer := create(0, add(code, 32), mload(code)) } // Address MUST be non-zero if (pointer == address(0)) revert WriteError(); } /** @notice Reads the contents of the `_pointer` code as data, skips the first byte @dev The function is intended for reading pointers generated by `write` @param _pointer to be read @return data read from `_pointer` contract */ function read(address _pointer) internal view returns (bytes memory) { return Bytecode.codeAt(_pointer, 1, type(uint256).max); } /** @notice Reads the contents of the `_pointer` code as data, skips the first byte @dev The function is intended for reading pointers generated by `write` @param _pointer to be read @param _start number of bytes to skip @return data read from `_pointer` contract */ function read(address _pointer, uint256 _start) internal view returns (bytes memory) { return Bytecode.codeAt(_pointer, _start + 1, type(uint256).max); } /** @notice Reads the contents of the `_pointer` code as data, skips the first byte @dev The function is intended for reading pointers generated by `write` @param _pointer to be read @param _start number of bytes to skip @param _end index before which to end extraction @return data read from `_pointer` contract */ function read(address _pointer, uint256 _start, uint256 _end) internal view returns (bytes memory) { return Bytecode.codeAt(_pointer, _start + 1, _end + 1); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library Bytecode { error InvalidCodeAtRange(uint256 _size, uint256 _start, uint256 _end); /** @notice Generate a creation code that results on a contract with `_code` as bytecode @param _code The returning value of the resulting `creationCode` @return creationCode (constructor) for new contract */ function creationCodeFor(bytes memory _code) internal pure returns (bytes memory) { /* 0x00 0x63 0x63XXXXXX PUSH4 _code.length size 0x01 0x80 0x80 DUP1 size size 0x02 0x60 0x600e PUSH1 14 14 size size 0x03 0x60 0x6000 PUSH1 00 0 14 size size 0x04 0x39 0x39 CODECOPY size 0x05 0x60 0x6000 PUSH1 00 0 size 0x06 0xf3 0xf3 RETURN <CODE> */ return abi.encodePacked( hex"63", uint32(_code.length), hex"80_60_0E_60_00_39_60_00_F3", _code ); } /** @notice Returns the size of the code on a given address @param _addr Address that may or may not contain code @return size of the code on the given `_addr` */ function codeSize(address _addr) internal view returns (uint256 size) { assembly { size := extcodesize(_addr) } } /** @notice Returns the code of a given address @dev It will fail if `_end < _start` @param _addr Address that may or may not contain code @param _start number of bytes of code to skip on read @param _end index before which to end extraction @return oCode read from `_addr` deployed bytecode Forked from: https://gist.github.com/KardanovIR/fe98661df9338c842b4a30306d507fbd */ function codeAt(address _addr, uint256 _start, uint256 _end) internal view returns (bytes memory oCode) { uint256 csize = codeSize(_addr); if (csize == 0) return bytes(""); if (_start > csize) return bytes(""); if (_end < _start) revert InvalidCodeAtRange(csize, _start, _end); unchecked { uint256 reqSize = _end - _start; uint256 maxSize = csize - _start; uint256 size = maxSize < reqSize ? maxSize : reqSize; assembly { // allocate output byte array - this could also be done without assembly // by using o_code = new bytes(size) oCode := mload(0x40) // new "memory end" including padding mstore(0x40, add(oCode, and(add(add(size, 0x20), 0x1f), not(0x1f)))) // store length in memory mstore(oCode, size) // actually retrieve the code, this needs assembly extcodecopy(_addr, add(oCode, 0x20), _start, size) } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {ERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol"; import {CountersUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol"; import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import {IToken} from "./tokens/interfaces/IToken.sol"; import {IObservability} from "./observability/Observability.sol"; import {UUPS} from "./lib/proxy/UUPS.sol"; import {ITokenFactory} from "./interfaces/ITokenFactory.sol"; import {VersionedContract} from "./VersionedContract.sol"; abstract contract TokenBase is IToken, ERC721Upgradeable, ReentrancyGuardUpgradeable, Ownable2StepUpgradeable, VersionedContract, UUPS { using CountersUpgradeable for CountersUpgradeable.Counter; CountersUpgradeable.Counter private _tokenIdCounter; mapping(uint256 => bytes32) public tokenIdToPreviousBlockHash; mapping(address => bool) public allowedMinters; address public immutable factory; address public immutable o11y; uint256 internal immutable FUNDS_SEND_GAS_LIMIT = 210_000; TokenInfo public tokenInfo; //[[[[MODIFIERS]]]] /// @notice restricts to only users with minter role modifier onlyAllowedMinter() { if (!allowedMinters[msg.sender]) revert SenderNotMinter(); _; } //[[[[SETUP FUNCTIONS]]]] constructor(address _factory, address _o11y) { factory = _factory; o11y = _o11y; } //[[[[VIEW FUNCTIONS]]]] /// @notice gets the total supply of tokens function totalSupply() public view returns (uint256) { return _tokenIdCounter.current(); } //[[[METADATA FUNCTIONS]]] function updateDescription(string memory description) external onlyOwner { tokenInfo.description = description; } //[[[[WITHDRAW FUNCTIONS]]]] /// @notice withdraws the funds from the contract function withdraw() external nonReentrant returns (bool) { uint256 amount = address(this).balance; (bool successFunds, ) = tokenInfo.fundsRecipent.call{ value: amount, gas: FUNDS_SEND_GAS_LIMIT }(""); if (!successFunds) revert FundsSendFailure(); IObservability(o11y).emitFundsWithdrawn( msg.sender, tokenInfo.fundsRecipent, amount ); return successFunds; } /// @notice sets the funds recipent for token funds function setFundsRecipent(address fundsRecipent) external onlyOwner { tokenInfo.fundsRecipent = fundsRecipent; } //[[[[MINT FUNCTIONS]]]] /// @notice sets the minter role for the given user function setMinter(address user, bool isAllowed) public onlyOwner { allowedMinters[user] = isAllowed; } /// @notice mint a token for the given address function safeMint(address to) public onlyAllowedMinter { if (totalSupply() >= tokenInfo.maxSupply) revert MaxSupplyReached(); _seedAndMint(to); } //[[[[PRIVATE FUNCTIONS]]]] /// @notice seeds the token id and mints the token function _seedAndMint(address to) internal { uint256 tokenId = _tokenIdCounter.current(); tokenIdToPreviousBlockHash[tokenId] = blockhash(block.number - 1); _tokenIdCounter.increment(); _safeMint(to, tokenId); } /// @notice checks if an upgrade is valid function _authorizeUpgrade(address newImpl) internal override onlyOwner { if ( !ITokenFactory(factory).isValidUpgrade( _getImplementation(), newImpl ) ) { revert ITokenFactory.InvalidUpgrade(newImpl); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; abstract contract VersionedContract { function contractVersion() external pure returns (string memory) { return "1.2.0"; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.16; interface IInteractable { function getInteractor() external view returns (address); function setInteractor(address _interactor) external; function interact( uint256 tokenId, bytes calldata interactionData, bytes calldata validationData ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.16; interface IInteractor { error InvalidInteraction(); error InvalidData(); event InteractionDataUpdated( address indexed user, address indexed tokenContract, uint256 indexed tokenId, bytes data ); function isValidInteraction( address user, address tokenContract, uint256 tokenId, bytes calldata interactionData, bytes calldata validationData ) external view returns (bool); function getInteractionData( address tokenContract, uint256 tokenId ) external view returns (bytes memory buffer, uint8); function interact( address user, uint256 tokenId, bytes calldata interactionData, bytes calldata validationData ) external; }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface ITokenFactory { error InvalidUpgrade(address impl); error NotDeployed(address impl); /// @notice Creates a new token contract with the given implementation and data function create( address tokenImpl, bytes calldata data ) external returns (address clone); /// @notice checks if an implementation is valid function isValidDeployment(address impl) external view returns (bool); /// @notice registers a new implementation function registerDeployment(address impl) external; /// @notice unregisters an implementation function unregisterDeployment(address impl) external; /// @notice checks if an upgrade is valid function isValidUpgrade( address prevImpl, address newImpl ) external returns (bool); /// @notice registers a new upgrade function registerUpgrade(address prevImpl, address newImpl) external; /// @notice unregisters an upgrade function unregisterUpgrade(address prevImpl, address newImpl) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; /// @title IERC1967Upgrade /// @author Rohan Kulkarni /// @notice The external ERC1967Upgrade events and errors interface IERC1967Upgrade { /// /// /// EVENTS /// /// /// /// @notice Emitted when the implementation is upgraded /// @param impl The address of the implementation event Upgraded(address impl); /// /// /// ERRORS /// /// /// /// @dev Reverts if an implementation is an invalid upgrade /// @param impl The address of the invalid implementation error INVALID_UPGRADE(address impl); /// @dev Reverts if an implementation upgrade is not stored at the storage slot of the original error UNSUPPORTED_UUID(); /// @dev Reverts if an implementation does not support ERC1822 proxiableUUID() error ONLY_UUPS(); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.16; import {IERC1822Proxiable} from "@openzeppelin/contracts/interfaces/draft-IERC1822.sol"; import {IERC1967Upgrade} from "./IERC1967Upgrade.sol"; /// @title IUUPS /// @author Rohan Kulkarni /// @notice The external UUPS errors and functions interface IUUPS is IERC1967Upgrade, IERC1822Proxiable { /// /// /// ERRORS /// /// /// /// @dev Reverts if not called directly error ONLY_CALL(); /// @dev Reverts if not called via delegatecall error ONLY_DELEGATECALL(); /// @dev Reverts if not called via proxy error ONLY_PROXY(); /// /// /// FUNCTIONS /// /// /// /// @notice Upgrades to an implementation /// @param newImpl The new implementation address function upgradeTo(address newImpl) external; /// @notice Upgrades to an implementation with an additional function call /// @param newImpl The new implementation address /// @param data The encoded function call function upgradeToAndCall( address newImpl, bytes memory data ) external payable; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import {Proxy} from "@openzeppelin/contracts/proxy/Proxy.sol"; import {IERC1967Upgrade} from "../interfaces/IERC1967Upgrade.sol"; import {ERC1967Upgrade} from "./ERC1967Upgrade.sol"; /// @title ERC1967Proxy /// @author Rohan Kulkarni /// @notice Modified from OpenZeppelin Contracts v4.7.3 (proxy/ERC1967/ERC1967Proxy.sol) /// - Inherits a modern, minimal ERC1967Upgrade contract ERC1967Proxy is IERC1967Upgrade, Proxy, ERC1967Upgrade { /// /// /// CONSTRUCTOR /// /// /// /// @dev Initializes the proxy with an implementation contract and encoded function call /// @param _logic The implementation address /// @param _data The encoded function call constructor(address _logic, bytes memory _data) payable { _upgradeToAndCall(_logic, _data, false); } /// /// /// FUNCTIONS /// /// /// /// @dev The address of the current implementation function _implementation() internal view virtual override returns (address) { return ERC1967Upgrade._getImplementation(); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import {IERC1822Proxiable} from "@openzeppelin/contracts/interfaces/draft-IERC1822.sol"; import {StorageSlot} from "@openzeppelin/contracts/utils/StorageSlot.sol"; import {IERC1967Upgrade} from "../interfaces/IERC1967Upgrade.sol"; import {Address} from "../utils/Address.sol"; /// @title ERC1967Upgrade /// @author Rohan Kulkarni /// @notice Modified from OpenZeppelin Contracts v4.7.3 (proxy/ERC1967/ERC1967Upgrade.sol) /// - Uses custom errors declared in IERC1967Upgrade /// - Removes ERC1967 admin and beacon support abstract contract ERC1967Upgrade is IERC1967Upgrade { /// /// /// CONSTANTS /// /// /// /// @dev bytes32(uint256(keccak256('eip1967.proxy.rollback')) - 1) bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /// @dev bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1) bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /// /// /// FUNCTIONS /// /// /// /// @dev Upgrades to an implementation with security checks for UUPS proxies and an additional function call /// @param _newImpl The new implementation address /// @param _data The encoded function call function _upgradeToAndCallUUPS( address _newImpl, bytes memory _data, bool _forceCall ) internal { if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(_newImpl); } else { try IERC1822Proxiable(_newImpl).proxiableUUID() returns ( bytes32 slot ) { if (slot != _IMPLEMENTATION_SLOT) revert UNSUPPORTED_UUID(); } catch { revert ONLY_UUPS(); } _upgradeToAndCall(_newImpl, _data, _forceCall); } } /// @dev Upgrades to an implementation with an additional function call /// @param _newImpl The new implementation address /// @param _data The encoded function call function _upgradeToAndCall( address _newImpl, bytes memory _data, bool _forceCall ) internal { _upgradeTo(_newImpl); if (_data.length > 0 || _forceCall) { Address.functionDelegateCall(_newImpl, _data); } } /// @dev Performs an implementation upgrade /// @param _newImpl The new implementation address function _upgradeTo(address _newImpl) internal { _setImplementation(_newImpl); emit Upgraded(_newImpl); } /// @dev Stores the address of an implementation /// @param _impl The implementation address function _setImplementation(address _impl) private { if (!Address.isContract(_impl)) revert INVALID_UPGRADE(_impl); StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = _impl; } /// @dev The address of the current implementation function _getImplementation() internal view returns (address) { return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; import {IUUPS} from "../interfaces/IUUPS.sol"; import {ERC1967Upgrade} from "./ERC1967Upgrade.sol"; /// @title UUPS /// @author Rohan Kulkarni /// @notice Modified from OpenZeppelin Contracts v4.7.3 (proxy/utils/UUPSUpgradeable.sol) /// - Uses custom errors declared in IUUPS /// - Inherits a modern, minimal ERC1967Upgrade abstract contract UUPS is IUUPS, ERC1967Upgrade { /// /// /// IMMUTABLES /// /// /// /// @dev The address of the implementation address private immutable __self = address(this); /// /// /// MODIFIERS /// /// /// /// @dev Ensures that execution is via proxy delegatecall with the correct implementation modifier onlyProxy() { if (address(this) == __self) revert ONLY_DELEGATECALL(); if (_getImplementation() != __self) revert ONLY_PROXY(); _; } /// @dev Ensures that execution is via direct call modifier notDelegated() { if (address(this) != __self) revert ONLY_CALL(); _; } /// /// /// FUNCTIONS /// /// /// /// @dev Hook to authorize an implementation upgrade /// @param _newImpl The new implementation address function _authorizeUpgrade(address _newImpl) internal virtual; /// @notice Upgrades to an implementation /// @param _newImpl The new implementation address function upgradeTo(address _newImpl) external onlyProxy { _authorizeUpgrade(_newImpl); _upgradeToAndCallUUPS(_newImpl, "", false); } /// @notice Upgrades to an implementation with an additional function call /// @param _newImpl The new implementation address /// @param _data The encoded function call function upgradeToAndCall( address _newImpl, bytes memory _data ) external payable onlyProxy { _authorizeUpgrade(_newImpl); _upgradeToAndCallUUPS(_newImpl, _data, true); } /// @notice The storage slot of the implementation address function proxiableUUID() external view notDelegated returns (bytes32) { return _IMPLEMENTATION_SLOT; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; /// @title EIP712 /// @author Rohan Kulkarni /// @notice Modified from OpenZeppelin Contracts v4.7.3 (utils/Address.sol) /// - Uses custom errors `INVALID_TARGET()` & `DELEGATE_CALL_FAILED()` /// - Adds util converting address to bytes32 library Address { /// /// /// ERRORS /// /// /// /// @dev Reverts if the target of a delegatecall is not a contract error INVALID_TARGET(); /// @dev Reverts if a delegatecall has failed error DELEGATE_CALL_FAILED(); /// /// /// FUNCTIONS /// /// /// /// @dev Utility to convert an address to bytes32 function toBytes32(address _account) internal pure returns (bytes32) { return bytes32(uint256(uint160(_account)) << 96); } /// @dev If an address is a contract function isContract(address _account) internal view returns (bool rv) { assembly { rv := gt(extcodesize(_account), 0) } } /// @dev Performs a delegatecall on an address function functionDelegateCall( address _target, bytes memory _data ) internal returns (bytes memory) { if (!isContract(_target)) revert INVALID_TARGET(); (bool success, bytes memory returndata) = _target.delegatecall(_data); return verifyCallResult(success, returndata); } /// @dev Verifies a delegatecall was successful function verifyCallResult( bool _success, bytes memory _returndata ) internal pure returns (bytes memory) { if (_success) { return _returndata; } else { if (_returndata.length > 0) { assembly { let returndata_size := mload(_returndata) revert(add(32, _returndata), returndata_size) } } else { revert DELEGATE_CALL_FAILED(); } } } }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.13; import {IObservability, IObservabilityEvents} from "./interface/IObservability.sol"; contract Observability is IObservability, IObservabilityEvents { /// @notice Emitted when a new clone is deployed function emitCloneDeployed(address owner, address clone) external override { emit CloneDeployed(msg.sender, owner, clone); } /// @notice Emitted when a sale has occured function emitSale( address to, uint256 pricePerToken, uint256 amount ) external override { emit Sale(msg.sender, to, pricePerToken, amount); } /// @notice Emitted when funds have been withdrawn function emitFundsWithdrawn( address withdrawnBy, address withdrawnTo, uint256 amount ) external override { emit FundsWithdrawn(msg.sender, withdrawnBy, withdrawnTo, amount); } /// @notice Emitted when a new implementation is registered function emitDeploymentTargetRegistererd(address impl) external override { emit DeploymentTargetRegistered(impl); } /// @notice Emitted when an implementation is unregistered function emitDeploymentTargetUnregistered(address impl) external override { emit DeploymentTargetUnregistered(impl); } /// @notice Emitted when a new upgrade is registered function emitUpgradeRegistered( address prevImpl, address impl ) external override { emit UpgradeRegistered(prevImpl, impl); } /// @notice Emitted when an upgrade is unregistered function emitUpgradeUnregistered( address prevImpl, address impl ) external override { emit UpgradeUnregistered(prevImpl, impl); } }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.13; interface IObservabilityEvents { /// @notice Emitted when a new clone is deployed event CloneDeployed( address indexed factory, address indexed owner, address clone ); /// @notice Emitted when a sale has occured event Sale( address indexed clone, address indexed to, uint256 pricePerToken, uint256 amount ); /// @notice Emitted when funds have been withdrawn event FundsWithdrawn( address indexed clone, address indexed withdrawnBy, address indexed withdrawnTo, uint256 amount ); /// @notice Emitted when a new implementation is registered event DeploymentTargetRegistered(address indexed impl); /// @notice Emitted when an implementation is unregistered event DeploymentTargetUnregistered(address indexed impl); /// @notice Emitted when an upgrade is registered /// @param prevImpl The address of the previous implementation /// @param newImpl The address of the registered upgrade event UpgradeRegistered(address indexed prevImpl, address indexed newImpl); /// @notice Emitted when an upgrade is unregistered /// @param prevImpl The address of the previous implementation /// @param newImpl The address of the unregistered upgrade event UpgradeUnregistered( address indexed prevImpl, address indexed newImpl ); } interface IObservability { function emitCloneDeployed(address owner, address clone) external; function emitSale( address to, uint256 pricePerToken, uint256 amount ) external; function emitFundsWithdrawn( address withdrawnBy, address withdrawnTo, uint256 amount ) external; function emitDeploymentTargetRegistererd(address impl) external; function emitDeploymentTargetUnregistered(address imp) external; function emitUpgradeRegistered(address prevImpl, address impl) external; function emitUpgradeUnregistered(address prevImpl, address impl) external; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.13; import {ERC1967Proxy} from "../lib/proxy/ERC1967Proxy.sol"; contract HTMLRendererProxy is ERC1967Proxy { constructor(address logic, bytes memory data) ERC1967Proxy(logic, data) {} }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.13; interface IHTMLRenderer { struct FileType { string name; address fileSystem; uint8 fileType; } function initilize(address owner) external; /// @notice Returns the HTML for the given script and imports function generateURI( FileType[] calldata imports, string calldata script ) external view returns (string memory); }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IHTMLRenderer} from "../../renderer/interfaces/IHTMLRenderer.sol"; interface IFixedPriceToken { struct SaleInfo { uint16 artistProofCount; uint64 startTime; uint64 endTime; uint112 price; } error SaleNotActive(); error InvalidPrice(); error SoldOut(); error ProofsMinted(); /// @notice initialize the token function initialize(address owner, bytes calldata data) external; /// @notice contruct a generic data URI from token data function genericDataURI( string memory _name, string memory _description, string memory _animationURL, string memory _image ) external pure returns (string memory); /// @notice generate a preview URI for the token function generatePreviewURI( string memory tokenId ) external view returns (string memory); /// @notice generate the html for the token function tokenHTML(uint256 tokenId) external view returns (string memory); /// @notice generate the full script for the token function generateFullScript( uint256 tokenId ) external view returns (string memory); /// @notice get the script for the contract function getScript() external view returns (string memory); /// @notice set the script for the contract function setScript(string memory script) external; /// @notice get the preview base URI for the token function setPreviewBaseURL(string memory uri) external; /// @notice set the html renderer for the token function setHTMLRenderer(address _htmlRenderer) external; /// @notice add multiple imports to the token function addManyImports( IHTMLRenderer.FileType[] calldata _imports ) external; /// @notice set a single import to the token for a given index function setImport( uint256 index, IHTMLRenderer.FileType calldata _import ) external; /// @notice purchase a number of tokens function purchase(uint256 amount) external payable; }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IToken { struct TokenInfo { string name; string symbol; string description; address fundsRecipent; uint256 maxSupply; } error FactoryMustInitilize(); error SenderNotMinter(); error FundsSendFailure(); error MaxSupplyReached(); /// @notice returns the total supply of tokens function totalSupply() external returns (uint256); /// @notice withdraws the funds from the contract function withdraw() external returns (bool); /// @notice mint a token for the given address function safeMint(address to) external; /// @notice sets the funds recipent for token funds function setFundsRecipent(address fundsRecipent) external; /// @notice sets the minter status for the given user function setMinter(address user, bool isAllowed) external; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.13; import {IFixedPriceToken} from "../interfaces/IFixedPriceToken.sol"; import {IHTMLRenderer} from "../../renderer/interfaces/IHTMLRenderer.sol"; abstract contract FixedPriceTokenStorageV1 { /// @notice Storage pointer for the generative script address scriptPointer; /// @notice Address of the HTML renderer address htmlRenderer; /// @notice Base URI for the preview URI string previewBaseURI; /// @notice Required imports for the renderer IHTMLRenderer.FileType[] public imports; /// @notice Sales info for token purchases IFixedPriceToken.SaleInfo public saleInfo; /// @notice Flag to indicate if the artist proofs have been minted bool proofsMinted; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.13; abstract contract FixedPriceTokenStorageV2 { address interactor; }
{ "remappings": [ "@0xsequence/sstore2/=lib/sstore2/", "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "ERC721A-Upgradeable/=lib/ERC721A-Upgradeable/contracts/", "base64-sol/=lib/base64/", "base64/=lib/base64/", "ds-test/=lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "ethfs/=lib/ethfs/packages/contracts/src/", "ethier/=lib/ethfs/packages/contracts/lib/ethier/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "openzeppelin/=lib/ethfs/packages/contracts/lib/openzeppelin-contracts/contracts/", "solady/=lib/ethfs/packages/contracts/lib/solady/src/", "solmate/=lib/ethfs/packages/contracts/lib/solady/lib/solmate/src/", "sstore2/=lib/sstore2/contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_o11y","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"DELEGATE_CALL_FAILED","type":"error"},{"inputs":[],"name":"FactoryMustInitilize","type":"error"},{"inputs":[],"name":"FundsSendFailure","type":"error"},{"inputs":[],"name":"INVALID_TARGET","type":"error"},{"inputs":[{"internalType":"address","name":"impl","type":"address"}],"name":"INVALID_UPGRADE","type":"error"},{"inputs":[{"internalType":"uint256","name":"_size","type":"uint256"},{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"}],"name":"InvalidCodeAtRange","type":"error"},{"inputs":[],"name":"InvalidPrice","type":"error"},{"inputs":[{"internalType":"address","name":"impl","type":"address"}],"name":"InvalidUpgrade","type":"error"},{"inputs":[],"name":"MaxSupplyReached","type":"error"},{"inputs":[{"internalType":"address","name":"impl","type":"address"}],"name":"NotDeployed","type":"error"},{"inputs":[],"name":"ONLY_CALL","type":"error"},{"inputs":[],"name":"ONLY_DELEGATECALL","type":"error"},{"inputs":[],"name":"ONLY_PROXY","type":"error"},{"inputs":[],"name":"ONLY_UUPS","type":"error"},{"inputs":[],"name":"ProofsMinted","type":"error"},{"inputs":[],"name":"SaleNotActive","type":"error"},{"inputs":[],"name":"SenderNotMinter","type":"error"},{"inputs":[],"name":"SoldOut","type":"error"},{"inputs":[],"name":"UNSUPPORTED_UUID","type":"error"},{"inputs":[],"name":"WriteError","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"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":"impl","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"fileSystem","type":"address"},{"internalType":"uint8","name":"fileType","type":"uint8"}],"internalType":"struct IHTMLRenderer.FileType","name":"_import","type":"tuple"}],"name":"addImport","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"fileSystem","type":"address"},{"internalType":"uint8","name":"fileType","type":"uint8"}],"internalType":"struct IHTMLRenderer.FileType[]","name":"_imports","type":"tuple[]"}],"name":"addManyImports","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allowedMinters","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_script","type":"string"},{"internalType":"string","name":"_previewBaseURI","type":"string"},{"internalType":"address","name":"_rendererImpl","type":"address"},{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"address","name":"fundsRecipent","type":"address"},{"internalType":"uint256","name":"maxSupply","type":"uint256"}],"internalType":"struct IToken.TokenInfo","name":"_tokenInfo","type":"tuple"},{"components":[{"internalType":"uint16","name":"artistProofCount","type":"uint16"},{"internalType":"uint64","name":"startTime","type":"uint64"},{"internalType":"uint64","name":"endTime","type":"uint64"},{"internalType":"uint112","name":"price","type":"uint112"}],"internalType":"struct IFixedPriceToken.SaleInfo","name":"_saleInfo","type":"tuple"},{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"fileSystem","type":"address"},{"internalType":"uint8","name":"fileType","type":"uint8"}],"internalType":"struct IHTMLRenderer.FileType[]","name":"_imports","type":"tuple[]"}],"name":"constructInitalProps","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"contractVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"generateFullScript","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"tokenId","type":"string"}],"name":"generatePreviewURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_description","type":"string"},{"internalType":"string","name":"_animationURL","type":"string"},{"internalType":"string","name":"_image","type":"string"}],"name":"genericDataURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getInteractor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getScript","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"imports","outputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"fileSystem","type":"address"},{"internalType":"uint8","name":"fileType","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"interactionData","type":"bytes"},{"internalType":"bytes","name":"validationData","type":"bytes"}],"name":"interact","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":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"o11y","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"purchase","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"safeMint","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":[],"name":"saleInfo","outputs":[{"internalType":"uint16","name":"artistProofCount","type":"uint16"},{"internalType":"uint64","name":"startTime","type":"uint64"},{"internalType":"uint64","name":"endTime","type":"uint64"},{"internalType":"uint112","name":"price","type":"uint112"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fundsRecipent","type":"address"}],"name":"setFundsRecipent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_htmlRenderer","type":"address"}],"name":"setHTMLRenderer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"},{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"fileSystem","type":"address"},{"internalType":"uint8","name":"fileType","type":"uint8"}],"internalType":"struct IHTMLRenderer.FileType","name":"_import","type":"tuple"}],"name":"setImport","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_interactor","type":"address"}],"name":"setInteractor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"bool","name":"isAllowed","type":"bool"}],"name":"setMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setPreviewBaseURL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"startTime","type":"uint64"},{"internalType":"uint64","name":"endTime","type":"uint64"},{"internalType":"uint112","name":"price","type":"uint112"}],"name":"setSaleInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"script","type":"string"}],"name":"setScript","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenHTML","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIdToPreviousBlockHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenInfo","outputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"address","name":"fundsRecipent","type":"address"},{"internalType":"uint256","name":"maxSupply","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":[{"internalType":"string","name":"description","type":"string"}],"name":"updateDescription","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newImpl","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newImpl","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
610100604052306080526203345060e0523480156200001d57600080fd5b50604051620055fd380380620055fd833981016040819052620000409162000075565b6001600160a01b0391821660a0521660c052620000ad565b80516001600160a01b03811681146200007057600080fd5b919050565b600080604083850312156200008957600080fd5b620000948362000058565b9150620000a46020840162000058565b90509250929050565b60805160a05160c05160e0516154d7620001266000396000610f6901526000818161066f0152818161101e015261210a0152600081816109a501528181611c2701528181611caa015261255d015260008181610e7c01528181610ebe0152818161114e01528181611190015261121401526154d76000f3fe6080604052600436106200035c5760003560e01c80638319df4011620001ce578063c45a0155116200010b578063e985e9c511620000a1578063f2fde38b1162000078578063f2fde38b1462000b1f578063f88c8cec1462000b44578063f8cf4bb01462000b69578063fa522ac91462000b8e57600080fd5b8063e985e9c51462000ab1578063ec9ef5861462000ad6578063efef39a11462000b0857600080fd5b8063d00c7c9711620000e2578063d00c7c971462000a11578063d1f578941462000a47578063e30c39781462000a6c578063e735b48a1462000a8c57600080fd5b8063c45a01551462000991578063c87b56dd14620009c7578063cf456ae714620009ec57600080fd5b8063984a34f71162000181578063b79bebaf1162000158578063b79bebaf14620008fd578063b7d168e61462000922578063b88d4fde1462000947578063c36e901b146200096c57600080fd5b8063984a34f71462000883578063a0a8e46014620008a8578063a22cb46514620008d857600080fd5b80638319df401462000730578063871b43aa14620007555780638da5cb5b146200077a5780638e3695b8146200079a578063927fb061146200082357806395d89b41146200086b57600080fd5b80634cb159d8116200029d5780636addb6631162000250578063715018a61162000227578063715018a614620006b657806378a4ab8514620006ce5780637989c0fe14620006f357806379ba5097146200071857600080fd5b80636addb6631462000630578063705bf368146200065b57806370a08231146200069157600080fd5b80634cb159d8146200057a5780634f1ef286146200059f57806352d1902d14620005b6578063620b730314620005ce5780636352211e14620005e657806366e8fce1146200060b57600080fd5b806318160ddd11620003135780633ccfd60b11620002ea5780633ccfd60b14620004e357806340d097c314620004fb578063423afa66146200052057806342842e0e146200055557600080fd5b806318160ddd146200047257806323b872dd14620004995780633659cfe614620004be57600080fd5b806301ffc9a7146200036157806306fdde03146200039b578063081812fc14620003c2578063095ea7b314620004005780630dd50a661462000427578063152f7373146200044c575b600080fd5b3480156200036e57600080fd5b50620003866200038036600462003804565b62000bb3565b60405190151581526020015b60405180910390f35b348015620003a857600080fd5b50620003b362000c07565b60405162000392919062003878565b348015620003cf57600080fd5b50620003e7620003e13660046200388d565b62000ca1565b6040516001600160a01b03909116815260200162000392565b3480156200040d57600080fd5b50620004256200041f366004620038cf565b62000cca565b005b3480156200043457600080fd5b50620003b36200044636600462003ccf565b62000dee565b3480156200045957600080fd5b5061013a5461010090046001600160a01b0316620003e7565b3480156200047f57600080fd5b506200048a62000e28565b60405190815260200162000392565b348015620004a657600080fd5b5062000425620004b836600462003daf565b62000e3a565b348015620004cb57600080fd5b5062000425620004dd36600462003df5565b62000e72565b348015620004f057600080fd5b506200038662000f43565b3480156200050857600080fd5b50620004256200051a36600462003df5565b62001090565b3480156200052d57600080fd5b50620003866200053f36600462003df5565b61012f6020526000908152604090205460ff1681565b3480156200056257600080fd5b50620004256200057436600462003daf565b620010fa565b3480156200058757600080fd5b50620004256200059936600462003df5565b62001117565b62000425620005b036600462003e15565b62001144565b348015620005c357600080fd5b506200048a62001207565b348015620005db57600080fd5b50620003b362001267565b348015620005f357600080fd5b50620003e7620006053660046200388d565b62001282565b3480156200061857600080fd5b50620004256200062a36600462003e6a565b620012e4565b3480156200063d57600080fd5b506200064862001304565b6040516200039295949392919062003ee3565b3480156200066857600080fd5b50620003e77f000000000000000000000000000000000000000000000000000000000000000081565b3480156200069e57600080fd5b506200048a620006b036600462003df5565b620014e1565b348015620006c357600080fd5b506200042562001569565b348015620006db57600080fd5b5062000425620006ed36600462003f40565b62001581565b3480156200070057600080fd5b50620004256200071236600462003f78565b62001596565b3480156200072557600080fd5b506200042562001610565b3480156200073d57600080fd5b50620004256200074f3660046200400d565b6200168b565b3480156200076257600080fd5b50620003b3620007743660046200388d565b62001707565b3480156200078757600080fd5b5060c9546001600160a01b0316620003e7565b348015620007a757600080fd5b5061013954620007e79061ffff8116906001600160401b03620100008204811691600160501b8104909116906001600160701b03600160901b9091041684565b6040805161ffff9590951685526001600160401b03938416602086015291909216908301526001600160701b0316606082015260800162000392565b3480156200083057600080fd5b50620004256200084236600462003df5565b61013a80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b3480156200087857600080fd5b50620003b3620017a9565b3480156200089057600080fd5b5062000425620008a2366004620040a0565b620017ba565b348015620008b557600080fd5b506040805180820190915260058152640312e322e360dc1b6020820152620003b3565b348015620008e557600080fd5b5062000425620008f7366004620040e7565b620017d9565b3480156200090a57600080fd5b50620003b36200091c3660046200388d565b620017e6565b3480156200092f57600080fd5b50620003b36200094136600462004125565b62001870565b3480156200095457600080fd5b506200042562000966366004620041de565b620018d0565b3480156200097957600080fd5b50620003b36200098b36600462003f40565b6200190f565b3480156200099e57600080fd5b50620003e77f000000000000000000000000000000000000000000000000000000000000000081565b348015620009d457600080fd5b50620003b3620009e63660046200388d565b62001936565b348015620009f957600080fd5b506200042562000a0b366004620040e7565b62001a44565b34801562000a1e57600080fd5b5062000a3662000a303660046200388d565b62001a7a565b604051620003929392919062004245565b34801562000a5457600080fd5b506200042562000a663660046200427d565b62001b56565b34801562000a7957600080fd5b5060fb546001600160a01b0316620003e7565b34801562000a9957600080fd5b506200042562000aab36600462003f40565b62001fb5565b34801562000abe57600080fd5b506200038662000ad0366004620042d7565b62001fce565b34801562000ae357600080fd5b506200048a62000af53660046200388d565b61012e6020526000908152604090205481565b6200042562000b193660046200388d565b62001ffc565b34801562000b2c57600080fd5b506200042562000b3e36600462003df5565b620021a8565b34801562000b5157600080fd5b506200042562000b633660046200430a565b6200221c565b34801562000b7657600080fd5b506200042562000b8836600462003df5565b6200223c565b34801562000b9b57600080fd5b506200042562000bad36600462003f40565b62002269565b60006001600160e01b031982166380ac58cd60e01b148062000be557506001600160e01b03198216635b5e139f60e01b145b8062000c0157506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606065805462000c18906200434a565b80601f016020809104026020016040519081016040528092919081815260200182805462000c46906200434a565b801562000c975780601f1062000c6b5761010080835404028352916020019162000c97565b820191906000526020600020905b81548152906001019060200180831162000c7957829003601f168201915b5050505050905090565b600062000cae826200227e565b506000908152606960205260409020546001600160a01b031690565b600062000cd78262001282565b9050806001600160a01b0316836001600160a01b03160362000d4a5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148062000d69575062000d69813362001fce565b62000ddd5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000606482015260840162000d41565b62000de98383620022df565b505050565b606086868686868660405160200162000e0d9695949392919062004405565b60405160208183030381529060405290509695505050505050565b600062000e3561012d5490565b905090565b62000e4633826200234f565b62000e655760405162461bcd60e51b815260040162000d419062004515565b62000de9838383620023b5565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300362000ebc576040516343d22ee960e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031662000ef062002534565b6001600160a01b03161462000f185760405163073a6c8560e51b815260040160405180910390fd5b62000f238162002551565b62000f408160405180602001604052806000815250600062002633565b50565b600062000f4f62002722565b6101335460405147916000916001600160a01b03909116907f000000000000000000000000000000000000000000000000000000000000000090849084818181858888f193505050503d806000811462000fc6576040519150601f19603f3d011682016040523d82523d6000602084013e62000fcb565b606091505b505090508062000fee5760405163050046d960e01b815260040160405180910390fd5b61013354604051633c1ca03760e01b81523360048201526001600160a01b039182166024820152604481018490527f000000000000000000000000000000000000000000000000000000000000000090911690633c1ca03790606401600060405180830381600087803b1580156200106557600080fd5b505af11580156200107a573d6000803e3d6000fd5b50929450505050506200108d6001609755565b90565b33600090815261012f602052604090205460ff16620010c257604051632236705560e11b815260040160405180910390fd5b61013454620010d062000e28565b10620010ef5760405163d05cb60960e01b815260040160405180910390fd5b62000f40816200277d565b62000de983838360405180602001604052806000815250620018d0565b62001121620027c8565b61013380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036200118e576040516343d22ee960e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316620011c262002534565b6001600160a01b031614620011ea5760405163073a6c8560e51b815260040160405180910390fd5b620011f58262002551565b620012038282600162002633565b5050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146200125357604051632bade49760e11b815260040160405180910390fd5b506000805160206200544283398151915290565b6101355460609062000e35906001600160a01b031662002824565b6000818152606760205260408120546001600160a01b03168062000c015760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640162000d41565b620012ee620027c8565b62001203620012fe828462004562565b62002836565b6101308054819062001316906200434a565b80601f016020809104026020016040519081016040528092919081815260200182805462001344906200434a565b8015620013955780601f10620013695761010080835404028352916020019162001395565b820191906000526020600020905b8154815290600101906020018083116200137757829003601f168201915b505050505090806001018054620013ac906200434a565b80601f0160208091040260200160405190810160405280929190818152602001828054620013da906200434a565b80156200142b5780601f10620013ff576101008083540402835291602001916200142b565b820191906000526020600020905b8154815290600101906020018083116200140d57829003601f168201915b50505050509080600201805462001442906200434a565b80601f016020809104026020016040519081016040528092919081815260200182805462001470906200434a565b8015620014c15780601f106200149557610100808354040283529160200191620014c1565b820191906000526020600020905b815481529060010190602001808311620014a357829003601f168201915b50505050600383015460049093015491926001600160a01b031691905085565b60006001600160a01b0382166200154d5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b606482015260840162000d41565b506001600160a01b031660009081526068602052604090205490565b62001573620027c8565b6200157f600062002880565b565b6200158b620027c8565b62000f40816200289b565b620015a0620027c8565b610139805471ffffffffffffffffffffffffffffffff00001916620100006001600160401b039586160267ffffffffffffffff60501b191617600160501b9390941692909202929092176001600160901b0316600160901b6001600160701b039390931692909202919091179055565b60fb5433906001600160a01b03168114620016805760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b606482015260840162000d41565b62000f408162002880565b61013a54604051630b08542d60e01b81526101009091046001600160a01b031690630b08542d90620016cc903390899089908990899089906004016200459a565b600060405180830381600087803b158015620016e757600080fd5b505af1158015620016fc573d6000803e3d6000fd5b505050505050505050565b61013a5460609061010090046001600160a01b031662001737576040518060200160405280600081525062001742565b6200174282620028ca565b600083815261012e60205260409020546200175d9062002952565b620017688462002952565b620017734262002952565b6200177d62001267565b60405160200162001793959493929190620045e6565b6040516020818303038152906040529050919050565b60606066805462000c18906200434a565b620017c4620027c8565b62000f40620017d382620046ef565b620029eb565b6200120333838362002a74565b610136546060906001600160a01b0316631e149ecf610138620018098562001707565b6040518363ffffffff1660e01b815260040162001828929190620046fd565b600060405180830381865afa15801562001846573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000c01919081019062004853565b6060620018a4858585856040516020016200188f9493929190620048a0565b60405160208183030381529060405262002b44565b604051602001620018b6919062004980565b60405160208183030381529060405290505b949350505050565b620018dc33836200234f565b620018fb5760405162461bcd60e51b815260040162000d419062004515565b620019098484848462002cbc565b50505050565b60606101376200192130601462002cf6565b836040516020016200179393929190620049c7565b60606000620019458362002952565b905060006200195362000c07565b826040516020016200196792919062004a7e565b604051602081830303815290604052905060006200198585620017e6565b9050600062001994846200190f565b905062001a3a836101306002018054620019ae906200434a565b80601f0160208091040260200160405190810160405280929190818152602001828054620019dc906200434a565b801562001a2d5780601f1062001a015761010080835404028352916020019162001a2d565b820191906000526020600020905b81548152906001019060200180831162001a0f57829003601f168201915b5050505050848462001870565b9695505050505050565b62001a4e620027c8565b6001600160a01b0391909116600090815261012f60205260409020805460ff1916911515919091179055565b610138818154811062001a8c57600080fd5b906000526020600020906002020160009150905080600001805462001ab1906200434a565b80601f016020809104026020016040519081016040528092919081815260200182805462001adf906200434a565b801562001b305780601f1062001b045761010080835404028352916020019162001b30565b820191906000526020600020905b81548152906001019060200180831162001b1257829003601f168201915b505050600190930154919250506001600160a01b0381169060ff600160a01b9091041683565b600054610100900460ff161580801562001b775750600054600160ff909116105b8062001b935750303b15801562001b93575060005460ff166001145b62001bf85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840162000d41565b6000805460ff19166001179055801562001c1c576000805461ff0019166101001790555b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161462001c665760405163191ade7560e01b815260040160405180910390fd5b6000808080808062001c7b888a018a62003ccf565b6040516337703c3d60e11b81526001600160a01b038581166004830152969c50949a50929850909650945092507f000000000000000000000000000000000000000000000000000000000000000090911690636ee0787a90602401602060405180830381865afa15801562001cf4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001d1a919062004abe565b62001d4457604051639a43351160e01b81526001600160a01b038516600482015260240162000d41565b8360405162001d5390620037df565b6001600160a01b039091168152604060208201819052600090820152606001604051809103906000f08015801562001d8f573d6000803e3d6000fd5b5061013680546001600160a01b0319166001600160a01b039283161790558a16600090815261012f60205260409020805460ff191660011790558251839061013090819062001ddf908262004b30565b506020820151600182019062001df6908262004b30565b506040820151600282019062001e0d908262004b30565b506060828101516003830180546001600160a01b0319166001600160a01b039283161790556080909301516004928301558451610139805460208801516040808a0151958a015161ffff90951669ffffffffffffffffffff1990931692909217620100006001600160401b03928316021769ffffffffffffffffffff16600160501b91909516026001600160901b031693909317600160901b6001600160701b0390931692909202919091179055610136549051632028114560e01b81528d84169281019290925290911690632028114590602401600060405180830381600087803b15801562001efd57600080fd5b505af115801562001f12573d6000803e3d6000fd5b5050505062001f2a8360000151846020015162002eb6565b62001f358a62002880565b62001f408162002836565b62001f4b866200289b565b62001f568562002eec565b815162001f639062002efb565b505050505050801562001909576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b62001fbf620027c8565b61013262001203828262004b30565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b6200200662002722565b610139546201000090046001600160401b03164210806200203a575061013954600160501b90046001600160401b03164210155b15620020595760405163b7b2409760e01b815260040160405180910390fd5b610139546200207990600160901b90046001600160701b03168262004c12565b341015620020995760405162bfc92160e01b815260040160405180910390fd5b6101345481620020a862000e28565b620020b4919062004c34565b1115620020d4576040516352df9fe560e01b815260040160405180910390fd5b6101395460405163bbc0ec1f60e01b8152336004820152600160901b9091046001600160701b03166024820152604481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063bbc0ec1f90606401600060405180830381600087803b1580156200215757600080fd5b505af11580156200216c573d6000803e3d6000fd5b5050505060005b818110156200219c5762002187336200277d565b80620021938162004c4a565b91505062002173565b5062000f406001609755565b620021b2620027c8565b60fb80546001600160a01b0383166001600160a01b03199091168117909155620021e460c9546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b62002226620027c8565b62001203826200223683620046ef565b62002f75565b62002246620027c8565b61013680546001600160a01b0319166001600160a01b0392909216919091179055565b62002273620027c8565b62000f408162002eec565b6000818152606760205260409020546001600160a01b031662000f405760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640162000d41565b600081815260696020526040902080546001600160a01b0319166001600160a01b0384169081179091558190620023168262001282565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806200235d8362001282565b9050806001600160a01b0316846001600160a01b0316148062002387575062002387818562001fce565b80620018c85750836001600160a01b0316620023a38462000ca1565b6001600160a01b031614949350505050565b826001600160a01b0316620023ca8262001282565b6001600160a01b031614620023f35760405162461bcd60e51b815260040162000d419062004c66565b6001600160a01b038216620024575760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840162000d41565b62002466838383600162002fef565b826001600160a01b03166200247b8262001282565b6001600160a01b031614620024a45760405162461bcd60e51b815260040162000d419062004c66565b600081815260696020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260688552838620805460001901905590871680865283862080546001019055868652606790945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60008051602062005442833981519152546001600160a01b031690565b6200255b620027c8565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663666854a06200259462002534565b6040516001600160e01b031960e084901b1681526001600160a01b03918216600482015290841660248201526044016020604051808303816000875af1158015620025e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062002609919062004abe565b62000f405760405163c72492e960e01b81526001600160a01b038216600482015260240162000d41565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615620026695762000de9836200307e565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015620026c6575060408051601f3d908101601f19168201909252620026c39181019062004cab565b60015b620026e45760405163605d905960e11b815260040160405180910390fd5b6000805160206200544283398151915281146200271457604051630424da4b60e11b815260040160405180910390fd5b5062000de9838383620030da565b600260975403620027765760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640162000d41565b6002609755565b60006200278a61012d5490565b90506200279960014362004cc5565b600082815261012e6020526040902090409055620027bc61012d80546001019055565b62001203828262003105565b60c9546001600160a01b031633146200157f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000d41565b606062000c0182600160001962003121565b805160005b8181101562000de9576200286b8382815181106200285d576200285d62004cdb565b6020026020010151620029eb565b80620028778162004c4a565b9150506200283b565b60fb80546001600160a01b031916905562000f4081620031de565b620028a68162003230565b61013580546001600160a01b0319166001600160a01b039290921691909117905550565b61013a54604051633135bb0d60e21b81523060048201526024810183905260609161010090046001600160a01b03169063c4d6ec3490604401600060405180830381865afa15801562002921573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200294b919081019062004cf1565b5092915050565b6060600062002961836200329a565b60010190506000816001600160401b03811115620029835762002983620038fe565b6040519080825280601f01601f191660200182016040528015620029ae576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084620029b857509392505050565b6101388054600181018255600091909152815182916002027ff79a63dcec80ed75c82f36161f17b9c2f407860160383a7be0a0ee7962c527ae0190819062002a34908262004b30565b5060208201516001909101805460409093015160ff16600160a01b026001600160a81b03199093166001600160a01b039092169190911791909117905550565b816001600160a01b0316836001600160a01b03160362002ad75760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640162000d41565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6060815160000362002b6457505060408051602081019091526000815290565b600060405180606001604052806040815260200162005462604091399050600060038451600262002b96919062004c34565b62002ba2919062004d52565b62002baf90600462004c12565b9050600062002bc082602062004c34565b6001600160401b0381111562002bda5762002bda620038fe565b6040519080825280601f01601f19166020018201604052801562002c05576020820181803683370190505b509050818152600183018586518101602084015b8183101562002c73576003830192508251603f8160121c168501518253600182019150603f81600c1c168501518253600182019150603f8160061c168501518253600182019150603f811685015182535060010162002c19565b60038951066001811462002c90576002811462002ca25762002cae565b613d3d60f01b60011983015262002cae565b603d60f81b6000198301525b509398975050505050505050565b62002cc9848484620023b5565b62002cd78484848462003379565b620019095760405162461bcd60e51b815260040162000d419062004d75565b6060600062002d0783600262004c12565b62002d1490600262004c34565b6001600160401b0381111562002d2e5762002d2e620038fe565b6040519080825280601f01601f19166020018201604052801562002d59576020820181803683370190505b509050600360fc1b8160008151811062002d775762002d7762004cdb565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811062002da95762002da962004cdb565b60200101906001600160f81b031916908160001a905350600062002dcf84600262004c12565b62002ddc90600162004c34565b90505b600181111562002e5e576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811062002e145762002e1462004cdb565b1a60f81b82828151811062002e2d5762002e2d62004cdb565b60200101906001600160f81b031916908160001a90535060049490941c9362002e568162004dc7565b905062002ddf565b50831562002eaf5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640162000d41565b9392505050565b600054610100900460ff1662002ee05760405162461bcd60e51b815260040162000d419062004de1565b62001203828262003485565b61013762001203828262004b30565b61013a5460ff161562002f2157604051630396d08760e31b815260040160405180910390fd5b60005b8161ffff1681101562002f635762002f4e62002f4860c9546001600160a01b031690565b6200277d565b8062002f5a8162004c4a565b91505062002f24565b505061013a805460ff19166001179055565b80610138838154811062002f8d5762002f8d62004cdb565b60009182526020909120825160029092020190819062002fae908262004b30565b5060208201516001909101805460409093015160ff16600160a01b026001600160a81b03199093166001600160a01b03909216919091179190911790555050565b600181111562001909576001600160a01b0384161562003039576001600160a01b038416600090815260686020526040812080548392906200303390849062004cc5565b90915550505b6001600160a01b0383161562001909576001600160a01b038316600090815260686020526040812080548392906200307390849062004c34565b909155505050505050565b803b620030aa5760405163310365cd60e21b81526001600160a01b038216600482015260240162000d41565b6000805160206200544283398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b620030e583620034cc565b600082511180620030f35750805b1562000de95762001909838362003516565b62001203828260405180602001604052806000815250620035b1565b6060833b60008190036200314657505060408051602081019091526000815262002eaf565b808411156200316657505060408051602081019091526000815262002eaf565b838310156200319a5760405163162544fd60e11b815260048101829052602481018590526044810184905260640162000d41565b8383038482036000828210620031b15782620031b3565b815b60408051603f8301601f19168101909152818152955090508087602087018a3c505050509392505050565b60c980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000806200325f836040516020016200324a919062004e2c565b604051602081830303815290604052620035eb565b90508051602082016000f091506001600160a01b038216620032945760405163046a55db60e11b815260040160405180910390fd5b50919050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310620032da5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831062003307576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106200332657662386f26fc10000830492506010015b6305f5e10083106200333f576305f5e100830492506008015b61271083106200335457612710830492506004015b6064831062003367576064830492506002015b600a831062000c015760010192915050565b60006001600160a01b0384163b156200347c57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290620033c090339089908890889060040162004e54565b6020604051808303816000875af1925050508015620033fe575060408051601f3d908101601f19168201909252620033fb9181019062004e89565b60015b62003461573d8080156200342f576040519150601f19603f3d011682016040523d82523d6000602084013e62003434565b606091505b508051600003620034595760405162461bcd60e51b815260040162000d419062004d75565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050620018c8565b506001620018c8565b600054610100900460ff16620034af5760405162461bcd60e51b815260040162000d419062004de1565b6065620034bd838262004b30565b50606662000de9828262004b30565b620034d7816200307e565b6040516001600160a01b03821681527fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9060200160405180910390a150565b6060823b62003538576040516337f2022960e01b815260040160405180910390fd5b600080846001600160a01b03168460405162003555919062004ea9565b600060405180830381855af49150503d806000811462003592576040519150601f19603f3d011682016040523d82523d6000602084013e62003597565b606091505b5091509150620035a8828262003603565b95945050505050565b620035bd83836200363e565b620035cc600084848462003379565b62000de95760405162461bcd60e51b815260040162000d419062004d75565b60608151826040516020016200179392919062004ec7565b606082156200361457508062000c01565b815115620036255781518083602001fd5b60405163062536b160e41b815260040160405180910390fd5b6001600160a01b038216620036965760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640162000d41565b6000818152606760205260409020546001600160a01b031615620036fd5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640162000d41565b6200370d60008383600162002fef565b6000818152606760205260409020546001600160a01b031615620037745760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640162000d41565b6001600160a01b038216600081815260686020908152604080832080546001019055848352606790915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6105278062004f1b83390190565b6001600160e01b03198116811462000f4057600080fd5b6000602082840312156200381757600080fd5b813562002eaf81620037ed565b60005b838110156200384157818101518382015260200162003827565b50506000910152565b600081518084526200386481602086016020860162003824565b601f01601f19169290920160200192915050565b60208152600062002eaf60208301846200384a565b600060208284031215620038a057600080fd5b5035919050565b6001600160a01b038116811462000f4057600080fd5b8035620038ca81620038a7565b919050565b60008060408385031215620038e357600080fd5b8235620038f081620038a7565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b0381118282101715620039395762003939620038fe565b60405290565b604051601f8201601f191681016001600160401b03811182821017156200396a576200396a620038fe565b604052919050565b60006001600160401b038211156200398e576200398e620038fe565b50601f01601f191660200190565b600082601f830112620039ae57600080fd5b8135620039c5620039bf8262003972565b6200393f565b818152846020838601011115620039db57600080fd5b816020850160208301376000918101602001919091529392505050565b600060a0828403121562003a0b57600080fd5b62003a1562003914565b905081356001600160401b038082111562003a2f57600080fd5b62003a3d858386016200399c565b8352602084013591508082111562003a5457600080fd5b62003a62858386016200399c565b6020840152604084013591508082111562003a7c57600080fd5b5062003a8b848285016200399c565b60408301525062003a9f60608301620038bd565b60608201526080820135608082015292915050565b80356001600160401b0381168114620038ca57600080fd5b80356001600160701b0381168114620038ca57600080fd5b60006080828403121562003af757600080fd5b604051608081018181106001600160401b038211171562003b1c5762003b1c620038fe565b604052905080823561ffff8116811462003b3557600080fd5b815262003b456020840162003ab4565b602082015262003b586040840162003ab4565b604082015262003b6b6060840162003acc565b60608201525092915050565b60ff8116811462000f4057600080fd5b60006060828403121562003b9a57600080fd5b604051606081016001600160401b03828210818311171562003bc05762003bc0620038fe565b81604052829350843591508082111562003bd957600080fd5b5062003be8858286016200399c565b825250602083013562003bfb81620038a7565b6020820152604083013562003c108162003b77565b6040919091015292915050565b60006001600160401b038084111562003c3a5762003c3a620038fe565b8360051b602062003c4d8183016200393f565b8681529350908401908084018783111562003c6757600080fd5b855b8381101562003ca05780358581111562003c835760008081fd5b62003c918a828a0162003b87565b83525090820190820162003c69565b50505050509392505050565b600082601f83011262003cbe57600080fd5b62002eaf8383356020850162003c1d565b600080600080600080610120878903121562003cea57600080fd5b86356001600160401b038082111562003d0257600080fd5b62003d108a838b016200399c565b9750602089013591508082111562003d2757600080fd5b62003d358a838b016200399c565b965062003d4560408a01620038bd565b9550606089013591508082111562003d5c57600080fd5b62003d6a8a838b01620039f8565b945062003d7b8a60808b0162003ae4565b935061010089013591508082111562003d9357600080fd5b5062003da289828a0162003cac565b9150509295509295509295565b60008060006060848603121562003dc557600080fd5b833562003dd281620038a7565b9250602084013562003de481620038a7565b929592945050506040919091013590565b60006020828403121562003e0857600080fd5b813562002eaf81620038a7565b6000806040838503121562003e2957600080fd5b823562003e3681620038a7565b915060208301356001600160401b0381111562003e5257600080fd5b62003e60858286016200399c565b9150509250929050565b6000806020838503121562003e7e57600080fd5b82356001600160401b038082111562003e9657600080fd5b818501915085601f83011262003eab57600080fd5b81358181111562003ebb57600080fd5b8660208260051b850101111562003ed157600080fd5b60209290920196919550909350505050565b60a08152600062003ef860a08301886200384a565b828103602084015262003f0c81886200384a565b9050828103604084015262003f2281876200384a565b6001600160a01b039590951660608401525050608001529392505050565b60006020828403121562003f5357600080fd5b81356001600160401b0381111562003f6a57600080fd5b620018c8848285016200399c565b60008060006060848603121562003f8e57600080fd5b62003f998462003ab4565b925062003fa96020850162003ab4565b915062003fb96040850162003acc565b90509250925092565b60008083601f84011262003fd557600080fd5b5081356001600160401b0381111562003fed57600080fd5b6020830191508360208285010111156200400657600080fd5b9250929050565b6000806000806000606086880312156200402657600080fd5b8535945060208601356001600160401b03808211156200404557600080fd5b6200405389838a0162003fc2565b909650945060408801359150808211156200406d57600080fd5b506200407c8882890162003fc2565b969995985093965092949392505050565b6000606082840312156200329457600080fd5b600060208284031215620040b357600080fd5b81356001600160401b03811115620040ca57600080fd5b620018c8848285016200408d565b801515811462000f4057600080fd5b60008060408385031215620040fb57600080fd5b82356200410881620038a7565b915060208301356200411a81620040d8565b809150509250929050565b600080600080608085870312156200413c57600080fd5b84356001600160401b03808211156200415457600080fd5b62004162888389016200399c565b955060208701359150808211156200417957600080fd5b62004187888389016200399c565b945060408701359150808211156200419e57600080fd5b620041ac888389016200399c565b93506060870135915080821115620041c357600080fd5b50620041d2878288016200399c565b91505092959194509250565b60008060008060808587031215620041f557600080fd5b84356200420281620038a7565b935060208501356200421481620038a7565b92506040850135915060608501356001600160401b038111156200423757600080fd5b620041d2878288016200399c565b6060815260006200425a60608301866200384a565b6001600160a01b039490941660208301525060ff91909116604090910152919050565b6000806000604084860312156200429357600080fd5b8335620042a081620038a7565b925060208401356001600160401b03811115620042bc57600080fd5b620042ca8682870162003fc2565b9497909650939450505050565b60008060408385031215620042eb57600080fd5b8235620042f881620038a7565b915060208301356200411a81620038a7565b600080604083850312156200431e57600080fd5b8235915060208301356001600160401b038111156200433c57600080fd5b62003e60858286016200408d565b600181811c908216806200435f57607f821691505b6020821081036200329457634e487b7160e01b600052602260045260246000fd5b600081518084526020808501808196508360051b8101915082860160005b85811015620043f8578284038952815160608151818752620043c3828801826200384a565b838901516001600160a01b0316888a015260409384015160ff169390970192909252505097840197908401906001016200439e565b5091979650505050505050565b60006101208083526200441b8184018a6200384a565b905082810360208401526200443181896200384a565b905060018060a01b0380881660408501528382036060850152865160a083526200445f60a08401826200384a565b9050602088015183820360208501526200447a82826200384a565b915050604088015183820360408501526200449682826200384a565b60608a8101518516868201526080808c0151818801528a5161ffff169089015260208a01516001600160401b0390811660a08a015260408b01511660c08901528901516001600160701b031660e08801529150620044f19050565b84810361010086015262004506818762004380565b9b9a5050505050505050505050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b600062002eaf36848462003c1d565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60018060a01b0387168152856020820152608060408201526000620045c460808301868862004571565b8281036060840152620045d981858762004571565b9998505050505050505050565b671e39b1b934b83a1f60c11b8152600086516200460b816008850160208b0162003824565b6e3b30b910313637b1b5a430b9b41e9160891b60089184019182015286516200463c816017840160208b0162003824565b6e111dbb30b9103a37b5b2b724b21e9160891b6017929091019182015285516200466e816026840160208a0162003824565b70111dbb30b9103a34b6b2b9ba30b6b81e9160791b602692909101918201528451620046a281603784016020890162003824565b61223b60f01b603792909101918201528351620046c781603984016020880162003824565b01620046e160398201681e17b9b1b934b83a1f60b91b9052565b604201979650505050505050565b600062000c01368362003b87565b6000604080830181845280865480835260609250828601915060058382821b88010160008a81526020808220825b86811015620047f957605f198c86030188528885528382546200474e816200434a565b808c89015260806001808416600081146200477257600181146200478c57620047b9565b60ff1985168b8401528315158c1b8b0183019550620047b9565b878a52888a208a5b85811015620047b15781548d8201860152908301908a0162004794565b8c0184019650505b508601546001600160a01b038116888b01529250620047d6915050565b60a081901c60ff16878d015250978301979450600291909101906001016200472b565b5050898303908a0152506200480f818a6200384a565b9a9950505050505050505050565b60006200482e620039bf8462003972565b90508281528383830111156200484357600080fd5b62002eaf83602083018462003824565b6000602082840312156200486657600080fd5b81516001600160401b038111156200487d57600080fd5b8201601f810184136200488f57600080fd5b620018c8848251602084016200481d565b683d913730b6b2911d1160b91b81528451600090620048c7816009850160208a0162003824565b71111610113232b9b1b934b83a34b7b7111d1160711b6009918401918201528551620048fb81601b840160208a0162003824565b741116101130b734b6b0ba34b7b72fbab936111d101160591b601b929091019182015284516200493381603084016020890162003824565b6c1116101134b6b0b3b2911d101160991b6030929091019182015283516200496381603d84016020880162003824565b61227d60f01b603d9290910191820152603f019695505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251620049ba81601d85016020870162003824565b91909101601d0192915050565b6000808554620049d7816200434a565b60018281168015620049f2576001811462004a085762004a39565b60ff198416875282151583028701945062004a39565b8960005260208060002060005b8581101562004a305781548a82015290840190820162004a15565b50505082870194505b508751925062004a4e838560208b0162003824565b602f60f81b9390920192835285519162004a6f8382860160208a0162003824565b91909201019695505050505050565b6000835162004a9281846020880162003824565b600160fd1b908301908152835162004ab281600184016020880162003824565b01600101949350505050565b60006020828403121562004ad157600080fd5b815162002eaf81620040d8565b601f82111562000de957600081815260208120601f850160051c8101602086101562004b075750805b601f850160051c820191505b8181101562004b285782815560010162004b13565b505050505050565b81516001600160401b0381111562004b4c5762004b4c620038fe565b62004b648162004b5d84546200434a565b8462004ade565b602080601f83116001811462004b9c576000841562004b835750858301515b600019600386901b1c1916600185901b17855562004b28565b600085815260208120601f198616915b8281101562004bcd5788860151825594840194600190910190840162004bac565b508582101562004bec5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161562004c2f5762004c2f62004bfc565b500290565b8082018082111562000c015762000c0162004bfc565b60006001820162004c5f5762004c5f62004bfc565b5060010190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60006020828403121562004cbe57600080fd5b5051919050565b8181038181111562000c015762000c0162004bfc565b634e487b7160e01b600052603260045260246000fd5b6000806040838503121562004d0557600080fd5b82516001600160401b0381111562004d1c57600080fd5b8301601f8101851362004d2e57600080fd5b62004d3f858251602084016200481d565b92505060208301516200411a8162003b77565b60008262004d7057634e487b7160e01b600052601260045260246000fd5b500490565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60008162004dd95762004dd962004bfc565b506000190190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600081526000825162004e4781600185016020870162003824565b9190910160010192915050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009062001a3a908301846200384a565b60006020828403121562004e9c57600080fd5b815162002eaf81620037ed565b6000825162004ebd81846020870162003824565b9190910192915050565b606360f81b815260e083901b6001600160e01b03191660018201526880600e6000396000f360b81b6005820152815160009062004f0c81600e85016020870162003824565b91909101600e01939250505056fe608060405234801561001057600080fd5b5060405161052738038061052783398101604081905261002f9161026d565b818161003d82826000610046565b50505050610357565b61004f8361007c565b60008251118061005c5750805b156100775761007583836100c460201b6100291760201c565b505b505050565b6100858161015b565b6040516001600160a01b03821681527fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9060200160405180910390a150565b6060823b6100e5576040516337f2022960e01b815260040160405180910390fd5b600080846001600160a01b031684604051610100919061033b565b600060405180830381855af49150503d806000811461013b576040519150601f19603f3d011682016040523d82523d6000602084013e610140565b606091505b50909250905061015082826101f8565b925050505b92915050565b61016e816101f260201b6100bf1760201c565b61019a5760405163310365cd60e21b81526001600160a01b038216600482015260240160405180910390fd5b806101d17f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023060201b6100c51760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b3b151590565b60608215610207575080610155565b8151156102175781518083602001fd5b60405163062536b160e41b815260040160405180910390fd5b90565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561026457818101518382015260200161024c565b50506000910152565b6000806040838503121561028057600080fd5b82516001600160a01b038116811461029757600080fd5b60208401519092506001600160401b03808211156102b457600080fd5b818501915085601f8301126102c857600080fd5b8151818111156102da576102da610233565b604051601f8201601f19908116603f0116810190838211818310171561030257610302610233565b8160405282815288602084870101111561031b57600080fd5b61032c836020830160208801610249565b80955050505050509250929050565b6000825161034d818460208701610249565b9190910192915050565b6101c1806103666000396000f3fe60806040523661001357610011610017565b005b6100115b6100276100226100c8565b610100565b565b6060823b61004a576040516337f2022960e01b815260040160405180910390fd5b600080846001600160a01b031684604051610065919061015c565b600060405180830381855af49150503d80600081146100a0576040519150601f19603f3d011682016040523d82523d6000602084013e6100a5565b606091505b50915091506100b48282610124565b925050505b92915050565b3b151590565b90565b60006100fb7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e80801561011f573d6000f35b3d6000fd5b606082156101335750806100b9565b8151156101435781518083602001fd5b60405163062536b160e41b815260040160405180910390fd5b6000825160005b8181101561017d5760208186018101518583015201610163565b50600092019182525091905056fea26469706673582212201308010693ef369cbeb170eb27d283ecec18c8cb991a72feae10671324c0109464736f6c63430008100033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220258b70ac651c09fb6bbf530caa648533a8c1c56c2636bee7e2f0c0602adb71fd64736f6c634300081000330000000000000000000000006f94f606a9ad1fddf75a73dc42d37a5991260bb0000000000000000000000000b572d9ee104f764b25d5f74776c523d8c593d22d
Deployed Bytecode
0x6080604052600436106200035c5760003560e01c80638319df4011620001ce578063c45a0155116200010b578063e985e9c511620000a1578063f2fde38b1162000078578063f2fde38b1462000b1f578063f88c8cec1462000b44578063f8cf4bb01462000b69578063fa522ac91462000b8e57600080fd5b8063e985e9c51462000ab1578063ec9ef5861462000ad6578063efef39a11462000b0857600080fd5b8063d00c7c9711620000e2578063d00c7c971462000a11578063d1f578941462000a47578063e30c39781462000a6c578063e735b48a1462000a8c57600080fd5b8063c45a01551462000991578063c87b56dd14620009c7578063cf456ae714620009ec57600080fd5b8063984a34f71162000181578063b79bebaf1162000158578063b79bebaf14620008fd578063b7d168e61462000922578063b88d4fde1462000947578063c36e901b146200096c57600080fd5b8063984a34f71462000883578063a0a8e46014620008a8578063a22cb46514620008d857600080fd5b80638319df401462000730578063871b43aa14620007555780638da5cb5b146200077a5780638e3695b8146200079a578063927fb061146200082357806395d89b41146200086b57600080fd5b80634cb159d8116200029d5780636addb6631162000250578063715018a61162000227578063715018a614620006b657806378a4ab8514620006ce5780637989c0fe14620006f357806379ba5097146200071857600080fd5b80636addb6631462000630578063705bf368146200065b57806370a08231146200069157600080fd5b80634cb159d8146200057a5780634f1ef286146200059f57806352d1902d14620005b6578063620b730314620005ce5780636352211e14620005e657806366e8fce1146200060b57600080fd5b806318160ddd11620003135780633ccfd60b11620002ea5780633ccfd60b14620004e357806340d097c314620004fb578063423afa66146200052057806342842e0e146200055557600080fd5b806318160ddd146200047257806323b872dd14620004995780633659cfe614620004be57600080fd5b806301ffc9a7146200036157806306fdde03146200039b578063081812fc14620003c2578063095ea7b314620004005780630dd50a661462000427578063152f7373146200044c575b600080fd5b3480156200036e57600080fd5b50620003866200038036600462003804565b62000bb3565b60405190151581526020015b60405180910390f35b348015620003a857600080fd5b50620003b362000c07565b60405162000392919062003878565b348015620003cf57600080fd5b50620003e7620003e13660046200388d565b62000ca1565b6040516001600160a01b03909116815260200162000392565b3480156200040d57600080fd5b50620004256200041f366004620038cf565b62000cca565b005b3480156200043457600080fd5b50620003b36200044636600462003ccf565b62000dee565b3480156200045957600080fd5b5061013a5461010090046001600160a01b0316620003e7565b3480156200047f57600080fd5b506200048a62000e28565b60405190815260200162000392565b348015620004a657600080fd5b5062000425620004b836600462003daf565b62000e3a565b348015620004cb57600080fd5b5062000425620004dd36600462003df5565b62000e72565b348015620004f057600080fd5b506200038662000f43565b3480156200050857600080fd5b50620004256200051a36600462003df5565b62001090565b3480156200052d57600080fd5b50620003866200053f36600462003df5565b61012f6020526000908152604090205460ff1681565b3480156200056257600080fd5b50620004256200057436600462003daf565b620010fa565b3480156200058757600080fd5b50620004256200059936600462003df5565b62001117565b62000425620005b036600462003e15565b62001144565b348015620005c357600080fd5b506200048a62001207565b348015620005db57600080fd5b50620003b362001267565b348015620005f357600080fd5b50620003e7620006053660046200388d565b62001282565b3480156200061857600080fd5b50620004256200062a36600462003e6a565b620012e4565b3480156200063d57600080fd5b506200064862001304565b6040516200039295949392919062003ee3565b3480156200066857600080fd5b50620003e77f000000000000000000000000b572d9ee104f764b25d5f74776c523d8c593d22d81565b3480156200069e57600080fd5b506200048a620006b036600462003df5565b620014e1565b348015620006c357600080fd5b506200042562001569565b348015620006db57600080fd5b5062000425620006ed36600462003f40565b62001581565b3480156200070057600080fd5b50620004256200071236600462003f78565b62001596565b3480156200072557600080fd5b506200042562001610565b3480156200073d57600080fd5b50620004256200074f3660046200400d565b6200168b565b3480156200076257600080fd5b50620003b3620007743660046200388d565b62001707565b3480156200078757600080fd5b5060c9546001600160a01b0316620003e7565b348015620007a757600080fd5b5061013954620007e79061ffff8116906001600160401b03620100008204811691600160501b8104909116906001600160701b03600160901b9091041684565b6040805161ffff9590951685526001600160401b03938416602086015291909216908301526001600160701b0316606082015260800162000392565b3480156200083057600080fd5b50620004256200084236600462003df5565b61013a80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b3480156200087857600080fd5b50620003b3620017a9565b3480156200089057600080fd5b5062000425620008a2366004620040a0565b620017ba565b348015620008b557600080fd5b506040805180820190915260058152640312e322e360dc1b6020820152620003b3565b348015620008e557600080fd5b5062000425620008f7366004620040e7565b620017d9565b3480156200090a57600080fd5b50620003b36200091c3660046200388d565b620017e6565b3480156200092f57600080fd5b50620003b36200094136600462004125565b62001870565b3480156200095457600080fd5b506200042562000966366004620041de565b620018d0565b3480156200097957600080fd5b50620003b36200098b36600462003f40565b6200190f565b3480156200099e57600080fd5b50620003e77f0000000000000000000000006f94f606a9ad1fddf75a73dc42d37a5991260bb081565b348015620009d457600080fd5b50620003b3620009e63660046200388d565b62001936565b348015620009f957600080fd5b506200042562000a0b366004620040e7565b62001a44565b34801562000a1e57600080fd5b5062000a3662000a303660046200388d565b62001a7a565b604051620003929392919062004245565b34801562000a5457600080fd5b506200042562000a663660046200427d565b62001b56565b34801562000a7957600080fd5b5060fb546001600160a01b0316620003e7565b34801562000a9957600080fd5b506200042562000aab36600462003f40565b62001fb5565b34801562000abe57600080fd5b506200038662000ad0366004620042d7565b62001fce565b34801562000ae357600080fd5b506200048a62000af53660046200388d565b61012e6020526000908152604090205481565b6200042562000b193660046200388d565b62001ffc565b34801562000b2c57600080fd5b506200042562000b3e36600462003df5565b620021a8565b34801562000b5157600080fd5b506200042562000b633660046200430a565b6200221c565b34801562000b7657600080fd5b506200042562000b8836600462003df5565b6200223c565b34801562000b9b57600080fd5b506200042562000bad36600462003f40565b62002269565b60006001600160e01b031982166380ac58cd60e01b148062000be557506001600160e01b03198216635b5e139f60e01b145b8062000c0157506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606065805462000c18906200434a565b80601f016020809104026020016040519081016040528092919081815260200182805462000c46906200434a565b801562000c975780601f1062000c6b5761010080835404028352916020019162000c97565b820191906000526020600020905b81548152906001019060200180831162000c7957829003601f168201915b5050505050905090565b600062000cae826200227e565b506000908152606960205260409020546001600160a01b031690565b600062000cd78262001282565b9050806001600160a01b0316836001600160a01b03160362000d4a5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148062000d69575062000d69813362001fce565b62000ddd5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000606482015260840162000d41565b62000de98383620022df565b505050565b606086868686868660405160200162000e0d9695949392919062004405565b60405160208183030381529060405290509695505050505050565b600062000e3561012d5490565b905090565b62000e4633826200234f565b62000e655760405162461bcd60e51b815260040162000d419062004515565b62000de9838383620023b5565b6001600160a01b037f000000000000000000000000669f16efb456956354ff16fb32216e6b0457133916300362000ebc576040516343d22ee960e01b815260040160405180910390fd5b7f000000000000000000000000669f16efb456956354ff16fb32216e6b045713396001600160a01b031662000ef062002534565b6001600160a01b03161462000f185760405163073a6c8560e51b815260040160405180910390fd5b62000f238162002551565b62000f408160405180602001604052806000815250600062002633565b50565b600062000f4f62002722565b6101335460405147916000916001600160a01b03909116907f000000000000000000000000000000000000000000000000000000000003345090849084818181858888f193505050503d806000811462000fc6576040519150601f19603f3d011682016040523d82523d6000602084013e62000fcb565b606091505b505090508062000fee5760405163050046d960e01b815260040160405180910390fd5b61013354604051633c1ca03760e01b81523360048201526001600160a01b039182166024820152604481018490527f000000000000000000000000b572d9ee104f764b25d5f74776c523d8c593d22d90911690633c1ca03790606401600060405180830381600087803b1580156200106557600080fd5b505af11580156200107a573d6000803e3d6000fd5b50929450505050506200108d6001609755565b90565b33600090815261012f602052604090205460ff16620010c257604051632236705560e11b815260040160405180910390fd5b61013454620010d062000e28565b10620010ef5760405163d05cb60960e01b815260040160405180910390fd5b62000f40816200277d565b62000de983838360405180602001604052806000815250620018d0565b62001121620027c8565b61013380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b037f000000000000000000000000669f16efb456956354ff16fb32216e6b045713391630036200118e576040516343d22ee960e01b815260040160405180910390fd5b7f000000000000000000000000669f16efb456956354ff16fb32216e6b045713396001600160a01b0316620011c262002534565b6001600160a01b031614620011ea5760405163073a6c8560e51b815260040160405180910390fd5b620011f58262002551565b620012038282600162002633565b5050565b6000306001600160a01b037f000000000000000000000000669f16efb456956354ff16fb32216e6b0457133916146200125357604051632bade49760e11b815260040160405180910390fd5b506000805160206200544283398151915290565b6101355460609062000e35906001600160a01b031662002824565b6000818152606760205260408120546001600160a01b03168062000c015760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640162000d41565b620012ee620027c8565b62001203620012fe828462004562565b62002836565b6101308054819062001316906200434a565b80601f016020809104026020016040519081016040528092919081815260200182805462001344906200434a565b8015620013955780601f10620013695761010080835404028352916020019162001395565b820191906000526020600020905b8154815290600101906020018083116200137757829003601f168201915b505050505090806001018054620013ac906200434a565b80601f0160208091040260200160405190810160405280929190818152602001828054620013da906200434a565b80156200142b5780601f10620013ff576101008083540402835291602001916200142b565b820191906000526020600020905b8154815290600101906020018083116200140d57829003601f168201915b50505050509080600201805462001442906200434a565b80601f016020809104026020016040519081016040528092919081815260200182805462001470906200434a565b8015620014c15780601f106200149557610100808354040283529160200191620014c1565b820191906000526020600020905b815481529060010190602001808311620014a357829003601f168201915b50505050600383015460049093015491926001600160a01b031691905085565b60006001600160a01b0382166200154d5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b606482015260840162000d41565b506001600160a01b031660009081526068602052604090205490565b62001573620027c8565b6200157f600062002880565b565b6200158b620027c8565b62000f40816200289b565b620015a0620027c8565b610139805471ffffffffffffffffffffffffffffffff00001916620100006001600160401b039586160267ffffffffffffffff60501b191617600160501b9390941692909202929092176001600160901b0316600160901b6001600160701b039390931692909202919091179055565b60fb5433906001600160a01b03168114620016805760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b606482015260840162000d41565b62000f408162002880565b61013a54604051630b08542d60e01b81526101009091046001600160a01b031690630b08542d90620016cc903390899089908990899089906004016200459a565b600060405180830381600087803b158015620016e757600080fd5b505af1158015620016fc573d6000803e3d6000fd5b505050505050505050565b61013a5460609061010090046001600160a01b031662001737576040518060200160405280600081525062001742565b6200174282620028ca565b600083815261012e60205260409020546200175d9062002952565b620017688462002952565b620017734262002952565b6200177d62001267565b60405160200162001793959493929190620045e6565b6040516020818303038152906040529050919050565b60606066805462000c18906200434a565b620017c4620027c8565b62000f40620017d382620046ef565b620029eb565b6200120333838362002a74565b610136546060906001600160a01b0316631e149ecf610138620018098562001707565b6040518363ffffffff1660e01b815260040162001828929190620046fd565b600060405180830381865afa15801562001846573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405262000c01919081019062004853565b6060620018a4858585856040516020016200188f9493929190620048a0565b60405160208183030381529060405262002b44565b604051602001620018b6919062004980565b60405160208183030381529060405290505b949350505050565b620018dc33836200234f565b620018fb5760405162461bcd60e51b815260040162000d419062004515565b620019098484848462002cbc565b50505050565b60606101376200192130601462002cf6565b836040516020016200179393929190620049c7565b60606000620019458362002952565b905060006200195362000c07565b826040516020016200196792919062004a7e565b604051602081830303815290604052905060006200198585620017e6565b9050600062001994846200190f565b905062001a3a836101306002018054620019ae906200434a565b80601f0160208091040260200160405190810160405280929190818152602001828054620019dc906200434a565b801562001a2d5780601f1062001a015761010080835404028352916020019162001a2d565b820191906000526020600020905b81548152906001019060200180831162001a0f57829003601f168201915b5050505050848462001870565b9695505050505050565b62001a4e620027c8565b6001600160a01b0391909116600090815261012f60205260409020805460ff1916911515919091179055565b610138818154811062001a8c57600080fd5b906000526020600020906002020160009150905080600001805462001ab1906200434a565b80601f016020809104026020016040519081016040528092919081815260200182805462001adf906200434a565b801562001b305780601f1062001b045761010080835404028352916020019162001b30565b820191906000526020600020905b81548152906001019060200180831162001b1257829003601f168201915b505050600190930154919250506001600160a01b0381169060ff600160a01b9091041683565b600054610100900460ff161580801562001b775750600054600160ff909116105b8062001b935750303b15801562001b93575060005460ff166001145b62001bf85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840162000d41565b6000805460ff19166001179055801562001c1c576000805461ff0019166101001790555b336001600160a01b037f0000000000000000000000006f94f606a9ad1fddf75a73dc42d37a5991260bb0161462001c665760405163191ade7560e01b815260040160405180910390fd5b6000808080808062001c7b888a018a62003ccf565b6040516337703c3d60e11b81526001600160a01b038581166004830152969c50949a50929850909650945092507f0000000000000000000000006f94f606a9ad1fddf75a73dc42d37a5991260bb090911690636ee0787a90602401602060405180830381865afa15801562001cf4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001d1a919062004abe565b62001d4457604051639a43351160e01b81526001600160a01b038516600482015260240162000d41565b8360405162001d5390620037df565b6001600160a01b039091168152604060208201819052600090820152606001604051809103906000f08015801562001d8f573d6000803e3d6000fd5b5061013680546001600160a01b0319166001600160a01b039283161790558a16600090815261012f60205260409020805460ff191660011790558251839061013090819062001ddf908262004b30565b506020820151600182019062001df6908262004b30565b506040820151600282019062001e0d908262004b30565b506060828101516003830180546001600160a01b0319166001600160a01b039283161790556080909301516004928301558451610139805460208801516040808a0151958a015161ffff90951669ffffffffffffffffffff1990931692909217620100006001600160401b03928316021769ffffffffffffffffffff16600160501b91909516026001600160901b031693909317600160901b6001600160701b0390931692909202919091179055610136549051632028114560e01b81528d84169281019290925290911690632028114590602401600060405180830381600087803b15801562001efd57600080fd5b505af115801562001f12573d6000803e3d6000fd5b5050505062001f2a8360000151846020015162002eb6565b62001f358a62002880565b62001f408162002836565b62001f4b866200289b565b62001f568562002eec565b815162001f639062002efb565b505050505050801562001909576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b62001fbf620027c8565b61013262001203828262004b30565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b6200200662002722565b610139546201000090046001600160401b03164210806200203a575061013954600160501b90046001600160401b03164210155b15620020595760405163b7b2409760e01b815260040160405180910390fd5b610139546200207990600160901b90046001600160701b03168262004c12565b341015620020995760405162bfc92160e01b815260040160405180910390fd5b6101345481620020a862000e28565b620020b4919062004c34565b1115620020d4576040516352df9fe560e01b815260040160405180910390fd5b6101395460405163bbc0ec1f60e01b8152336004820152600160901b9091046001600160701b03166024820152604481018290527f000000000000000000000000b572d9ee104f764b25d5f74776c523d8c593d22d6001600160a01b03169063bbc0ec1f90606401600060405180830381600087803b1580156200215757600080fd5b505af11580156200216c573d6000803e3d6000fd5b5050505060005b818110156200219c5762002187336200277d565b80620021938162004c4a565b91505062002173565b5062000f406001609755565b620021b2620027c8565b60fb80546001600160a01b0383166001600160a01b03199091168117909155620021e460c9546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b62002226620027c8565b62001203826200223683620046ef565b62002f75565b62002246620027c8565b61013680546001600160a01b0319166001600160a01b0392909216919091179055565b62002273620027c8565b62000f408162002eec565b6000818152606760205260409020546001600160a01b031662000f405760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604482015260640162000d41565b600081815260696020526040902080546001600160a01b0319166001600160a01b0384169081179091558190620023168262001282565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806200235d8362001282565b9050806001600160a01b0316846001600160a01b0316148062002387575062002387818562001fce565b80620018c85750836001600160a01b0316620023a38462000ca1565b6001600160a01b031614949350505050565b826001600160a01b0316620023ca8262001282565b6001600160a01b031614620023f35760405162461bcd60e51b815260040162000d419062004c66565b6001600160a01b038216620024575760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840162000d41565b62002466838383600162002fef565b826001600160a01b03166200247b8262001282565b6001600160a01b031614620024a45760405162461bcd60e51b815260040162000d419062004c66565b600081815260696020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260688552838620805460001901905590871680865283862080546001019055868652606790945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60008051602062005442833981519152546001600160a01b031690565b6200255b620027c8565b7f0000000000000000000000006f94f606a9ad1fddf75a73dc42d37a5991260bb06001600160a01b031663666854a06200259462002534565b6040516001600160e01b031960e084901b1681526001600160a01b03918216600482015290841660248201526044016020604051808303816000875af1158015620025e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062002609919062004abe565b62000f405760405163c72492e960e01b81526001600160a01b038216600482015260240162000d41565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615620026695762000de9836200307e565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015620026c6575060408051601f3d908101601f19168201909252620026c39181019062004cab565b60015b620026e45760405163605d905960e11b815260040160405180910390fd5b6000805160206200544283398151915281146200271457604051630424da4b60e11b815260040160405180910390fd5b5062000de9838383620030da565b600260975403620027765760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640162000d41565b6002609755565b60006200278a61012d5490565b90506200279960014362004cc5565b600082815261012e6020526040902090409055620027bc61012d80546001019055565b62001203828262003105565b60c9546001600160a01b031633146200157f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000d41565b606062000c0182600160001962003121565b805160005b8181101562000de9576200286b8382815181106200285d576200285d62004cdb565b6020026020010151620029eb565b80620028778162004c4a565b9150506200283b565b60fb80546001600160a01b031916905562000f4081620031de565b620028a68162003230565b61013580546001600160a01b0319166001600160a01b039290921691909117905550565b61013a54604051633135bb0d60e21b81523060048201526024810183905260609161010090046001600160a01b03169063c4d6ec3490604401600060405180830381865afa15801562002921573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200294b919081019062004cf1565b5092915050565b6060600062002961836200329a565b60010190506000816001600160401b03811115620029835762002983620038fe565b6040519080825280601f01601f191660200182016040528015620029ae576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084620029b857509392505050565b6101388054600181018255600091909152815182916002027ff79a63dcec80ed75c82f36161f17b9c2f407860160383a7be0a0ee7962c527ae0190819062002a34908262004b30565b5060208201516001909101805460409093015160ff16600160a01b026001600160a81b03199093166001600160a01b039092169190911791909117905550565b816001600160a01b0316836001600160a01b03160362002ad75760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640162000d41565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6060815160000362002b6457505060408051602081019091526000815290565b600060405180606001604052806040815260200162005462604091399050600060038451600262002b96919062004c34565b62002ba2919062004d52565b62002baf90600462004c12565b9050600062002bc082602062004c34565b6001600160401b0381111562002bda5762002bda620038fe565b6040519080825280601f01601f19166020018201604052801562002c05576020820181803683370190505b509050818152600183018586518101602084015b8183101562002c73576003830192508251603f8160121c168501518253600182019150603f81600c1c168501518253600182019150603f8160061c168501518253600182019150603f811685015182535060010162002c19565b60038951066001811462002c90576002811462002ca25762002cae565b613d3d60f01b60011983015262002cae565b603d60f81b6000198301525b509398975050505050505050565b62002cc9848484620023b5565b62002cd78484848462003379565b620019095760405162461bcd60e51b815260040162000d419062004d75565b6060600062002d0783600262004c12565b62002d1490600262004c34565b6001600160401b0381111562002d2e5762002d2e620038fe565b6040519080825280601f01601f19166020018201604052801562002d59576020820181803683370190505b509050600360fc1b8160008151811062002d775762002d7762004cdb565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811062002da95762002da962004cdb565b60200101906001600160f81b031916908160001a905350600062002dcf84600262004c12565b62002ddc90600162004c34565b90505b600181111562002e5e576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811062002e145762002e1462004cdb565b1a60f81b82828151811062002e2d5762002e2d62004cdb565b60200101906001600160f81b031916908160001a90535060049490941c9362002e568162004dc7565b905062002ddf565b50831562002eaf5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640162000d41565b9392505050565b600054610100900460ff1662002ee05760405162461bcd60e51b815260040162000d419062004de1565b62001203828262003485565b61013762001203828262004b30565b61013a5460ff161562002f2157604051630396d08760e31b815260040160405180910390fd5b60005b8161ffff1681101562002f635762002f4e62002f4860c9546001600160a01b031690565b6200277d565b8062002f5a8162004c4a565b91505062002f24565b505061013a805460ff19166001179055565b80610138838154811062002f8d5762002f8d62004cdb565b60009182526020909120825160029092020190819062002fae908262004b30565b5060208201516001909101805460409093015160ff16600160a01b026001600160a81b03199093166001600160a01b03909216919091179190911790555050565b600181111562001909576001600160a01b0384161562003039576001600160a01b038416600090815260686020526040812080548392906200303390849062004cc5565b90915550505b6001600160a01b0383161562001909576001600160a01b038316600090815260686020526040812080548392906200307390849062004c34565b909155505050505050565b803b620030aa5760405163310365cd60e21b81526001600160a01b038216600482015260240162000d41565b6000805160206200544283398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b620030e583620034cc565b600082511180620030f35750805b1562000de95762001909838362003516565b62001203828260405180602001604052806000815250620035b1565b6060833b60008190036200314657505060408051602081019091526000815262002eaf565b808411156200316657505060408051602081019091526000815262002eaf565b838310156200319a5760405163162544fd60e11b815260048101829052602481018590526044810184905260640162000d41565b8383038482036000828210620031b15782620031b3565b815b60408051603f8301601f19168101909152818152955090508087602087018a3c505050509392505050565b60c980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000806200325f836040516020016200324a919062004e2c565b604051602081830303815290604052620035eb565b90508051602082016000f091506001600160a01b038216620032945760405163046a55db60e11b815260040160405180910390fd5b50919050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310620032da5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831062003307576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106200332657662386f26fc10000830492506010015b6305f5e10083106200333f576305f5e100830492506008015b61271083106200335457612710830492506004015b6064831062003367576064830492506002015b600a831062000c015760010192915050565b60006001600160a01b0384163b156200347c57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290620033c090339089908890889060040162004e54565b6020604051808303816000875af1925050508015620033fe575060408051601f3d908101601f19168201909252620033fb9181019062004e89565b60015b62003461573d8080156200342f576040519150601f19603f3d011682016040523d82523d6000602084013e62003434565b606091505b508051600003620034595760405162461bcd60e51b815260040162000d419062004d75565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050620018c8565b506001620018c8565b600054610100900460ff16620034af5760405162461bcd60e51b815260040162000d419062004de1565b6065620034bd838262004b30565b50606662000de9828262004b30565b620034d7816200307e565b6040516001600160a01b03821681527fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9060200160405180910390a150565b6060823b62003538576040516337f2022960e01b815260040160405180910390fd5b600080846001600160a01b03168460405162003555919062004ea9565b600060405180830381855af49150503d806000811462003592576040519150601f19603f3d011682016040523d82523d6000602084013e62003597565b606091505b5091509150620035a8828262003603565b95945050505050565b620035bd83836200363e565b620035cc600084848462003379565b62000de95760405162461bcd60e51b815260040162000d419062004d75565b60608151826040516020016200179392919062004ec7565b606082156200361457508062000c01565b815115620036255781518083602001fd5b60405163062536b160e41b815260040160405180910390fd5b6001600160a01b038216620036965760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640162000d41565b6000818152606760205260409020546001600160a01b031615620036fd5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640162000d41565b6200370d60008383600162002fef565b6000818152606760205260409020546001600160a01b031615620037745760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640162000d41565b6001600160a01b038216600081815260686020908152604080832080546001019055848352606790915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6105278062004f1b83390190565b6001600160e01b03198116811462000f4057600080fd5b6000602082840312156200381757600080fd5b813562002eaf81620037ed565b60005b838110156200384157818101518382015260200162003827565b50506000910152565b600081518084526200386481602086016020860162003824565b601f01601f19169290920160200192915050565b60208152600062002eaf60208301846200384a565b600060208284031215620038a057600080fd5b5035919050565b6001600160a01b038116811462000f4057600080fd5b8035620038ca81620038a7565b919050565b60008060408385031215620038e357600080fd5b8235620038f081620038a7565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b0381118282101715620039395762003939620038fe565b60405290565b604051601f8201601f191681016001600160401b03811182821017156200396a576200396a620038fe565b604052919050565b60006001600160401b038211156200398e576200398e620038fe565b50601f01601f191660200190565b600082601f830112620039ae57600080fd5b8135620039c5620039bf8262003972565b6200393f565b818152846020838601011115620039db57600080fd5b816020850160208301376000918101602001919091529392505050565b600060a0828403121562003a0b57600080fd5b62003a1562003914565b905081356001600160401b038082111562003a2f57600080fd5b62003a3d858386016200399c565b8352602084013591508082111562003a5457600080fd5b62003a62858386016200399c565b6020840152604084013591508082111562003a7c57600080fd5b5062003a8b848285016200399c565b60408301525062003a9f60608301620038bd565b60608201526080820135608082015292915050565b80356001600160401b0381168114620038ca57600080fd5b80356001600160701b0381168114620038ca57600080fd5b60006080828403121562003af757600080fd5b604051608081018181106001600160401b038211171562003b1c5762003b1c620038fe565b604052905080823561ffff8116811462003b3557600080fd5b815262003b456020840162003ab4565b602082015262003b586040840162003ab4565b604082015262003b6b6060840162003acc565b60608201525092915050565b60ff8116811462000f4057600080fd5b60006060828403121562003b9a57600080fd5b604051606081016001600160401b03828210818311171562003bc05762003bc0620038fe565b81604052829350843591508082111562003bd957600080fd5b5062003be8858286016200399c565b825250602083013562003bfb81620038a7565b6020820152604083013562003c108162003b77565b6040919091015292915050565b60006001600160401b038084111562003c3a5762003c3a620038fe565b8360051b602062003c4d8183016200393f565b8681529350908401908084018783111562003c6757600080fd5b855b8381101562003ca05780358581111562003c835760008081fd5b62003c918a828a0162003b87565b83525090820190820162003c69565b50505050509392505050565b600082601f83011262003cbe57600080fd5b62002eaf8383356020850162003c1d565b600080600080600080610120878903121562003cea57600080fd5b86356001600160401b038082111562003d0257600080fd5b62003d108a838b016200399c565b9750602089013591508082111562003d2757600080fd5b62003d358a838b016200399c565b965062003d4560408a01620038bd565b9550606089013591508082111562003d5c57600080fd5b62003d6a8a838b01620039f8565b945062003d7b8a60808b0162003ae4565b935061010089013591508082111562003d9357600080fd5b5062003da289828a0162003cac565b9150509295509295509295565b60008060006060848603121562003dc557600080fd5b833562003dd281620038a7565b9250602084013562003de481620038a7565b929592945050506040919091013590565b60006020828403121562003e0857600080fd5b813562002eaf81620038a7565b6000806040838503121562003e2957600080fd5b823562003e3681620038a7565b915060208301356001600160401b0381111562003e5257600080fd5b62003e60858286016200399c565b9150509250929050565b6000806020838503121562003e7e57600080fd5b82356001600160401b038082111562003e9657600080fd5b818501915085601f83011262003eab57600080fd5b81358181111562003ebb57600080fd5b8660208260051b850101111562003ed157600080fd5b60209290920196919550909350505050565b60a08152600062003ef860a08301886200384a565b828103602084015262003f0c81886200384a565b9050828103604084015262003f2281876200384a565b6001600160a01b039590951660608401525050608001529392505050565b60006020828403121562003f5357600080fd5b81356001600160401b0381111562003f6a57600080fd5b620018c8848285016200399c565b60008060006060848603121562003f8e57600080fd5b62003f998462003ab4565b925062003fa96020850162003ab4565b915062003fb96040850162003acc565b90509250925092565b60008083601f84011262003fd557600080fd5b5081356001600160401b0381111562003fed57600080fd5b6020830191508360208285010111156200400657600080fd5b9250929050565b6000806000806000606086880312156200402657600080fd5b8535945060208601356001600160401b03808211156200404557600080fd5b6200405389838a0162003fc2565b909650945060408801359150808211156200406d57600080fd5b506200407c8882890162003fc2565b969995985093965092949392505050565b6000606082840312156200329457600080fd5b600060208284031215620040b357600080fd5b81356001600160401b03811115620040ca57600080fd5b620018c8848285016200408d565b801515811462000f4057600080fd5b60008060408385031215620040fb57600080fd5b82356200410881620038a7565b915060208301356200411a81620040d8565b809150509250929050565b600080600080608085870312156200413c57600080fd5b84356001600160401b03808211156200415457600080fd5b62004162888389016200399c565b955060208701359150808211156200417957600080fd5b62004187888389016200399c565b945060408701359150808211156200419e57600080fd5b620041ac888389016200399c565b93506060870135915080821115620041c357600080fd5b50620041d2878288016200399c565b91505092959194509250565b60008060008060808587031215620041f557600080fd5b84356200420281620038a7565b935060208501356200421481620038a7565b92506040850135915060608501356001600160401b038111156200423757600080fd5b620041d2878288016200399c565b6060815260006200425a60608301866200384a565b6001600160a01b039490941660208301525060ff91909116604090910152919050565b6000806000604084860312156200429357600080fd5b8335620042a081620038a7565b925060208401356001600160401b03811115620042bc57600080fd5b620042ca8682870162003fc2565b9497909650939450505050565b60008060408385031215620042eb57600080fd5b8235620042f881620038a7565b915060208301356200411a81620038a7565b600080604083850312156200431e57600080fd5b8235915060208301356001600160401b038111156200433c57600080fd5b62003e60858286016200408d565b600181811c908216806200435f57607f821691505b6020821081036200329457634e487b7160e01b600052602260045260246000fd5b600081518084526020808501808196508360051b8101915082860160005b85811015620043f8578284038952815160608151818752620043c3828801826200384a565b838901516001600160a01b0316888a015260409384015160ff169390970192909252505097840197908401906001016200439e565b5091979650505050505050565b60006101208083526200441b8184018a6200384a565b905082810360208401526200443181896200384a565b905060018060a01b0380881660408501528382036060850152865160a083526200445f60a08401826200384a565b9050602088015183820360208501526200447a82826200384a565b915050604088015183820360408501526200449682826200384a565b60608a8101518516868201526080808c0151818801528a5161ffff169089015260208a01516001600160401b0390811660a08a015260408b01511660c08901528901516001600160701b031660e08801529150620044f19050565b84810361010086015262004506818762004380565b9b9a5050505050505050505050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b600062002eaf36848462003c1d565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60018060a01b0387168152856020820152608060408201526000620045c460808301868862004571565b8281036060840152620045d981858762004571565b9998505050505050505050565b671e39b1b934b83a1f60c11b8152600086516200460b816008850160208b0162003824565b6e3b30b910313637b1b5a430b9b41e9160891b60089184019182015286516200463c816017840160208b0162003824565b6e111dbb30b9103a37b5b2b724b21e9160891b6017929091019182015285516200466e816026840160208a0162003824565b70111dbb30b9103a34b6b2b9ba30b6b81e9160791b602692909101918201528451620046a281603784016020890162003824565b61223b60f01b603792909101918201528351620046c781603984016020880162003824565b01620046e160398201681e17b9b1b934b83a1f60b91b9052565b604201979650505050505050565b600062000c01368362003b87565b6000604080830181845280865480835260609250828601915060058382821b88010160008a81526020808220825b86811015620047f957605f198c86030188528885528382546200474e816200434a565b808c89015260806001808416600081146200477257600181146200478c57620047b9565b60ff1985168b8401528315158c1b8b0183019550620047b9565b878a52888a208a5b85811015620047b15781548d8201860152908301908a0162004794565b8c0184019650505b508601546001600160a01b038116888b01529250620047d6915050565b60a081901c60ff16878d015250978301979450600291909101906001016200472b565b5050898303908a0152506200480f818a6200384a565b9a9950505050505050505050565b60006200482e620039bf8462003972565b90508281528383830111156200484357600080fd5b62002eaf83602083018462003824565b6000602082840312156200486657600080fd5b81516001600160401b038111156200487d57600080fd5b8201601f810184136200488f57600080fd5b620018c8848251602084016200481d565b683d913730b6b2911d1160b91b81528451600090620048c7816009850160208a0162003824565b71111610113232b9b1b934b83a34b7b7111d1160711b6009918401918201528551620048fb81601b840160208a0162003824565b741116101130b734b6b0ba34b7b72fbab936111d101160591b601b929091019182015284516200493381603084016020890162003824565b6c1116101134b6b0b3b2911d101160991b6030929091019182015283516200496381603d84016020880162003824565b61227d60f01b603d9290910191820152603f019695505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251620049ba81601d85016020870162003824565b91909101601d0192915050565b6000808554620049d7816200434a565b60018281168015620049f2576001811462004a085762004a39565b60ff198416875282151583028701945062004a39565b8960005260208060002060005b8581101562004a305781548a82015290840190820162004a15565b50505082870194505b508751925062004a4e838560208b0162003824565b602f60f81b9390920192835285519162004a6f8382860160208a0162003824565b91909201019695505050505050565b6000835162004a9281846020880162003824565b600160fd1b908301908152835162004ab281600184016020880162003824565b01600101949350505050565b60006020828403121562004ad157600080fd5b815162002eaf81620040d8565b601f82111562000de957600081815260208120601f850160051c8101602086101562004b075750805b601f850160051c820191505b8181101562004b285782815560010162004b13565b505050505050565b81516001600160401b0381111562004b4c5762004b4c620038fe565b62004b648162004b5d84546200434a565b8462004ade565b602080601f83116001811462004b9c576000841562004b835750858301515b600019600386901b1c1916600185901b17855562004b28565b600085815260208120601f198616915b8281101562004bcd5788860151825594840194600190910190840162004bac565b508582101562004bec5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161562004c2f5762004c2f62004bfc565b500290565b8082018082111562000c015762000c0162004bfc565b60006001820162004c5f5762004c5f62004bfc565b5060010190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60006020828403121562004cbe57600080fd5b5051919050565b8181038181111562000c015762000c0162004bfc565b634e487b7160e01b600052603260045260246000fd5b6000806040838503121562004d0557600080fd5b82516001600160401b0381111562004d1c57600080fd5b8301601f8101851362004d2e57600080fd5b62004d3f858251602084016200481d565b92505060208301516200411a8162003b77565b60008262004d7057634e487b7160e01b600052601260045260246000fd5b500490565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60008162004dd95762004dd962004bfc565b506000190190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600081526000825162004e4781600185016020870162003824565b9190910160010192915050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009062001a3a908301846200384a565b60006020828403121562004e9c57600080fd5b815162002eaf81620037ed565b6000825162004ebd81846020870162003824565b9190910192915050565b606360f81b815260e083901b6001600160e01b03191660018201526880600e6000396000f360b81b6005820152815160009062004f0c81600e85016020870162003824565b91909101600e01939250505056fe608060405234801561001057600080fd5b5060405161052738038061052783398101604081905261002f9161026d565b818161003d82826000610046565b50505050610357565b61004f8361007c565b60008251118061005c5750805b156100775761007583836100c460201b6100291760201c565b505b505050565b6100858161015b565b6040516001600160a01b03821681527fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9060200160405180910390a150565b6060823b6100e5576040516337f2022960e01b815260040160405180910390fd5b600080846001600160a01b031684604051610100919061033b565b600060405180830381855af49150503d806000811461013b576040519150601f19603f3d011682016040523d82523d6000602084013e610140565b606091505b50909250905061015082826101f8565b925050505b92915050565b61016e816101f260201b6100bf1760201c565b61019a5760405163310365cd60e21b81526001600160a01b038216600482015260240160405180910390fd5b806101d17f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023060201b6100c51760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b3b151590565b60608215610207575080610155565b8151156102175781518083602001fd5b60405163062536b160e41b815260040160405180910390fd5b90565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561026457818101518382015260200161024c565b50506000910152565b6000806040838503121561028057600080fd5b82516001600160a01b038116811461029757600080fd5b60208401519092506001600160401b03808211156102b457600080fd5b818501915085601f8301126102c857600080fd5b8151818111156102da576102da610233565b604051601f8201601f19908116603f0116810190838211818310171561030257610302610233565b8160405282815288602084870101111561031b57600080fd5b61032c836020830160208801610249565b80955050505050509250929050565b6000825161034d818460208701610249565b9190910192915050565b6101c1806103666000396000f3fe60806040523661001357610011610017565b005b6100115b6100276100226100c8565b610100565b565b6060823b61004a576040516337f2022960e01b815260040160405180910390fd5b600080846001600160a01b031684604051610065919061015c565b600060405180830381855af49150503d80600081146100a0576040519150601f19603f3d011682016040523d82523d6000602084013e6100a5565b606091505b50915091506100b48282610124565b925050505b92915050565b3b151590565b90565b60006100fb7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e80801561011f573d6000f35b3d6000fd5b606082156101335750806100b9565b8151156101435781518083602001fd5b60405163062536b160e41b815260040160405180910390fd5b6000825160005b8181101561017d5760208186018101518583015201610163565b50600092019182525091905056fea26469706673582212201308010693ef369cbeb170eb27d283ecec18c8cb991a72feae10671324c0109464736f6c63430008100033360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220258b70ac651c09fb6bbf530caa648533a8c1c56c2636bee7e2f0c0602adb71fd64736f6c63430008100033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000006f94f606a9ad1fddf75a73dc42d37a5991260bb0000000000000000000000000b572d9ee104f764b25d5f74776c523d8c593d22d
-----Decoded View---------------
Arg [0] : _factory (address): 0x6f94f606a9AD1Fddf75A73Dc42d37A5991260bB0
Arg [1] : _o11y (address): 0xb572D9ee104F764b25d5f74776C523D8c593D22d
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000006f94f606a9ad1fddf75a73dc42d37a5991260bb0
Arg [1] : 000000000000000000000000b572d9ee104f764b25d5f74776c523d8c593d22d
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 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.