Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 17918603 | 436 days ago | IN | 0 ETH | 0.05060336 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
IndelibleOpenEdition
Compiler Version
v0.8.17+commit.8df45f5f
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.0; import "erc721a-upgradeable/contracts/ERC721AUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/common/ERC2981Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "operator-filter-registry/src/upgradeable/OperatorFiltererUpgradeable.sol"; import "solady/src/utils/LibPRNG.sol"; import "solady/src/utils/Base64.sol"; import "solady/src/utils/SSTORE2.sol"; import "./lib/DynamicBuffer.sol"; import "./lib/HelperLib.sol"; import "./lib/Bytecode.sol"; import "./interfaces/IIndelibleSecurity.sol"; import "./ICommon.sol"; struct OpenEditionSettings { uint256 maxPerAddress; uint256 publicMintPrice; uint256 mintStart; uint256 mintEnd; bool isContractSealed; string description; } contract IndelibleOpenEdition is ERC721AUpgradeable, OwnableUpgradeable, ERC2981Upgradeable, OperatorFiltererUpgradeable, ReentrancyGuardUpgradeable { using HelperLib for string; using DynamicBuffer for bytes; using LibPRNG for LibPRNG.PRNG; event MetadataUpdate(uint256 _tokenId); event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId); mapping(uint256 => address) private chunks; mapping(address => uint256) private latestBlockNumber; uint256 numberOfChunks; uint256 numberOfTraits; string private mimetype; uint256 private signatureLifespan; address private indelibleSecurity; address payable private collectorFeeRecipient; uint256 public collectorFee; string public imageUrl; string public animationUrl; OpenEditionSettings public settings; WithdrawRecipient[] public withdrawRecipients; /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } function initialize( string memory _name, string memory _symbol, OpenEditionSettings calldata _settings, RoyaltySettings calldata _royaltySettings, WithdrawRecipient[] calldata _withdrawRecipients, FactorySettings calldata _factorySettings ) public initializerERC721A initializer { __ERC721A_init(_name, _symbol); __Ownable_init(); settings = _settings; collectorFeeRecipient = payable(_factorySettings.collectorFeeRecipient); collectorFee = _factorySettings.collectorFee; indelibleSecurity = _factorySettings.indelibleSecurity; signatureLifespan = _factorySettings.signatureLifespan; for (uint256 i = 0; i < _withdrawRecipients.length; ) { withdrawRecipients.push(_withdrawRecipients[i]); unchecked { ++i; } } _setDefaultRoyalty( _royaltySettings.royaltyAddress, _royaltySettings.royaltyAmount ); transferOwnership(_factorySettings.deployer); OperatorFiltererUpgradeable.__OperatorFilterer_init( _factorySettings.operatorFilter, _factorySettings.operatorFilter != address(0) // only subscribe if a filter is provided ); } modifier whenUnsealed() { if (settings.isContractSealed) { revert NotAuthorized(); } _; } function handleMint( uint256 quantity, address recipient, uint256 totalCollectorFee ) internal { if ( quantity < 1 || (settings.mintEnd > 0 && block.timestamp > settings.mintEnd) ) { revert InvalidInput(); } if (msg.sender != tx.origin) { revert NotAuthorized(); } uint256 batchQuantity = quantity / 20; uint256 remainder = quantity % 20; for (uint256 i = 0; i < batchQuantity; ) { _mint(recipient, 20); unchecked { ++i; } } if (remainder > 0) { _mint(recipient, remainder); } if (totalCollectorFee > 0) { sendCollectorFee(totalCollectorFee); } } function publicMint(uint256 quantity, address to) internal { bool isMintActive = (settings.mintStart != 0 && settings.mintStart <= block.timestamp && (settings.mintEnd == 0 || block.timestamp < settings.mintEnd)); if (msg.sender != owner() && !isMintActive) { revert NotAvailable(); } bool hasCorrectValue = msg.sender == owner() ? quantity * collectorFee == msg.value : quantity * (settings.publicMintPrice + collectorFee) == msg.value; bool hasCorrectQuantity = settings.maxPerAddress == 0 || _numberMinted(to) + quantity <= settings.maxPerAddress; if ( (msg.sender != owner() && !hasCorrectQuantity) || !hasCorrectValue ) { revert InvalidInput(); } handleMint(quantity, to, quantity * collectorFee); } function mint(uint256 quantity) external payable nonReentrant { publicMint(quantity, msg.sender); } function airdrop( uint256 quantity, address to ) external payable nonReentrant { publicMint(quantity, to); } function airdrop( uint256 quantity, address[] calldata to ) external payable nonReentrant { for (uint256 i = 0; i < to.length; ) { publicMint(quantity, to[i]); unchecked { ++i; } } } function signatureMint( Signature calldata signature, uint256 _nonce, uint256 _quantity, uint256 _maxPerAddress, uint256 _mintPrice, uint256 _collectorFee ) external payable nonReentrant { bytes32 messageHash = keccak256( abi.encodePacked( _nonce, address(this), msg.sender, _quantity, _maxPerAddress, _mintPrice, _collectorFee, block.chainid ) ); IIndelibleSecurity securityContract = IIndelibleSecurity( indelibleSecurity ); address signerAddress = securityContract.signerAddress(); if (verifySignature(messageHash, signature) != signerAddress) { revert NotAuthorized(); } bool hasCorrectValue = _quantity * (_mintPrice + _collectorFee) == msg.value; bool hasCorrectQuantity = _maxPerAddress == 0 || _numberMinted(msg.sender) + _quantity <= _maxPerAddress; bool hasCorrectNonce = _nonce > latestBlockNumber[msg.sender] && _nonce + signatureLifespan > block.number; if (!hasCorrectValue || !hasCorrectQuantity || !hasCorrectNonce) { revert InvalidInput(); } latestBlockNumber[msg.sender] = block.number; handleMint(_quantity, msg.sender, _quantity * _collectorFee); } function verifySignature( bytes32 messageHash, Signature calldata signature ) public pure returns (address) { bytes memory prefix = "\x19Ethereum Signed Message:\n32"; bytes memory prefixedMessage = abi.encodePacked(prefix, messageHash); bytes32 hashedMessage = keccak256(prefixedMessage); return ecrecover(hashedMessage, signature.v, signature.r, signature.s); } function sendCollectorFee(uint256 totalFee) internal { (bool sent, ) = collectorFeeRecipient.call{value: totalFee}(""); if (!sent) { revert NotAuthorized(); } } function getMedia() public view returns (string memory) { bytes memory media; uint256 size; uint256 ptr = 0x20; address currentChunk; unchecked { // solhint-disable-next-line no-inline-assembly assembly { media := mload(0x40) } for (uint256 i = 0; i < numberOfChunks; i++) { currentChunk = chunks[i]; size = Bytecode.codeSize(currentChunk) - 1; // solhint-disable-next-line no-inline-assembly assembly { extcodecopy(currentChunk, add(media, ptr), 1, size) } ptr += size; } // solhint-disable-next-line no-inline-assembly assembly { mstore(0x40, add(media, and(add(ptr, 0x1f), not(0x1f)))) mstore(media, sub(ptr, 0x20)) } } return string.concat("data:", mimetype, ";base64,", Base64.encode(media)); } function tokenMediaData() internal view returns (string memory) { bool hasImage = bytes(imageUrl).length > 0; bool hasAnimation = bytes(animationUrl).length > 0; bool hasMediaOnchain = numberOfChunks > 0; if (hasImage && hasAnimation) { return string( abi.encodePacked( '","image":"', imageUrl, '","animation_url":"', animationUrl ) ); } if (hasImage) { return string( abi.encodePacked( '","image":"', imageUrl, hasMediaOnchain ? string( abi.encodePacked( '","animation_url":"', getMedia() ) ) : "" ) ); } if (hasAnimation) { return string( abi.encodePacked( hasMediaOnchain ? string( abi.encodePacked('","image":"', getMedia()) ) : "", '","animation_url":"', animationUrl ) ); } if (hasMediaOnchain) { return string(abi.encodePacked('","image":"', getMedia())); } return ""; } function tokenURI( uint256 tokenId ) public view override returns (string memory) { if (!_exists(tokenId)) { revert InvalidInput(); } return string.concat( 'data:application/json,{"name":"', name(), " #", _toString(tokenId), '","description":"', settings.description, tokenMediaData(), '","properties":[{"trait_type":"name","value":"', name(), '"},{"trait_type":"number","value":', _toString(tokenId), "}]}" ); } function didMintEnd() public view returns (bool) { return settings.mintEnd > 0 && block.timestamp > settings.mintEnd; } function addChunk( uint256 total, string calldata _mimetype, bytes calldata chunk ) public whenUnsealed onlyOwner { numberOfChunks = total; mimetype = _mimetype; chunks[0] = SSTORE2.write(chunk); } function addChunk( uint256 index, bytes calldata chunk ) public whenUnsealed onlyOwner { chunks[index] = SSTORE2.write(chunk); } function getChunk(uint256 chunkIndex) external view returns (bytes memory) { return SSTORE2.read(chunks[chunkIndex]); } function setMaxPerAddress(uint256 maxPerAddress) external onlyOwner { settings.maxPerAddress = maxPerAddress; } function setImageUrl(string calldata url) external onlyOwner { imageUrl = url; if (_totalMinted() > 0) { emit BatchMetadataUpdate(0, _totalMinted() - 1); } } function setAnimationUrl(string calldata url) external onlyOwner { animationUrl = url; if (_totalMinted() > 0) { emit BatchMetadataUpdate(0, _totalMinted() - 1); } } function setPublicMintPrice(uint256 publicMintPrice) external onlyOwner { settings.publicMintPrice = publicMintPrice; } function setMintStart(uint256 mintStart) external whenUnsealed onlyOwner { settings.mintStart = mintStart; } function setMintEnd(uint256 mintEnd) external whenUnsealed onlyOwner { settings.mintEnd = mintEnd; } function sealContract() external whenUnsealed onlyOwner { settings.isContractSealed = true; } function withdraw() external onlyOwner nonReentrant { uint256 balance = address(this).balance; uint256 amount = balance; uint256 distAmount = 0; address payable receiver = payable(owner()); if (withdrawRecipients.length > 0) { for (uint256 i = 0; i < withdrawRecipients.length; ) { address payable currRecepient = payable( withdrawRecipients[i].recipientAddress ); distAmount = (amount * (10000 - withdrawRecipients[i].percentage)) / 10000; AddressUpgradeable.sendValue( currRecepient, amount - distAmount ); unchecked { ++i; } } } balance = address(this).balance; AddressUpgradeable.sendValue(receiver, balance); } function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC721AUpgradeable, ERC2981Upgradeable) returns (bool) { return ERC721AUpgradeable.supportsInterface(interfaceId) || ERC2981Upgradeable.supportsInterface(interfaceId); } function setApprovalForAll( address operator, bool approved ) public override onlyAllowedOperatorApproval(operator) { super.setApprovalForAll(operator, approved); } function approve( address operator, uint256 tokenId ) public payable override onlyAllowedOperatorApproval(operator) { super.approve(operator, tokenId); } function transferFrom( address from, address to, uint256 tokenId ) public payable override onlyAllowedOperator(from) { super.transferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId ) public payable override onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public payable override onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, data); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981Upgradeable is IERC165Upgradeable { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardUpgradeable is Initializable { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981Upgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981Upgradeable is Initializable, IERC2981Upgradeable, ERC165Upgradeable { function __ERC2981_init() internal onlyInitializing { } function __ERC2981_init_unchained() internal onlyInitializing { } struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC165Upgradeable) returns (bool) { return interfaceId == type(IERC2981Upgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981Upgradeable */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[48] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates merkle trees that are safe * against this attack out of the box. */ library MerkleProofUpgradeable { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} * * _Available since v4.7._ */ function verifyCalldata( bytes32[] calldata proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} * * _Available since v4.7._ */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). * * _Available since v4.7._ */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// 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 pragma solidity ^0.8.0; struct FactorySettings { address indelibleSecurity; address collectorFeeRecipient; uint256 collectorFee; address deployer; address operatorFilter; uint256 signatureLifespan; } struct WithdrawRecipient { address recipientAddress; uint256 percentage; } struct RoyaltySettings { address royaltyAddress; uint96 royaltyAmount; } struct Signature { bytes32 r; bytes32 s; uint8 v; } error NotAvailable(); error NotAuthorized(); error InvalidInput();
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IIndelibleSecurity { function signerAddress() external view returns (address); }
// 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 // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0; /// @title DynamicBuffer /// @author David Huber (@cxkoda) and Simon Fremaux (@dievardump). See also /// https://raw.githubusercontent.com/dievardump/solidity-dynamic-buffer /// @notice This library is used to allocate a big amount of container memory // which will be subsequently filled without needing to reallocate /// memory. /// @dev First, allocate memory. /// Then use `buffer.appendUnchecked(theBytes)` or `appendSafe()` if /// bounds checking is required. library DynamicBuffer { /// @notice Allocates container space for the DynamicBuffer /// @param capacity The intended max amount of bytes in the buffer /// @return buffer The memory location of the buffer /// @dev Allocates `capacity + 0x60` bytes of space /// The buffer array starts at the first container data position, /// (i.e. `buffer = container + 0x20`) function allocate(uint256 capacity) internal pure returns (bytes memory buffer) { assembly { // Get next-free memory address let container := mload(0x40) // Allocate memory by setting a new next-free address { // Add 2 x 32 bytes in size for the two length fields // Add 32 bytes safety space for 32B chunked copy let size := add(capacity, 0x60) let newNextFree := add(container, size) mstore(0x40, newNextFree) } // Set the correct container length { let length := add(capacity, 0x40) mstore(container, length) } // The buffer starts at idx 1 in the container (0 is length) buffer := add(container, 0x20) // Init content with length 0 mstore(buffer, 0) } return buffer; } /// @notice Appends data to buffer, and update buffer length /// @param buffer the buffer to append the data to /// @param data the data to append /// @dev Does not perform out-of-bound checks (container capacity) /// for efficiency. function appendUnchecked(bytes memory buffer, bytes memory data) internal pure { assembly { let length := mload(data) for { data := add(data, 0x20) let dataEnd := add(data, length) let copyTo := add(buffer, add(mload(buffer), 0x20)) } lt(data, dataEnd) { data := add(data, 0x20) copyTo := add(copyTo, 0x20) } { // Copy 32B chunks from data to buffer. // This may read over data array boundaries and copy invalid // bytes, which doesn't matter in the end since we will // later set the correct buffer length, and have allocated an // additional word to avoid buffer overflow. mstore(copyTo, mload(data)) } // Update buffer length mstore(buffer, add(mload(buffer), length)) } } /// @notice Appends data to buffer, and update buffer length /// @param buffer the buffer to append the data to /// @param data the data to append /// @dev Performs out-of-bound checks and calls `appendUnchecked`. function appendSafe(bytes memory buffer, bytes memory data) internal pure { uint256 capacity; uint256 length; assembly { capacity := sub(mload(sub(buffer, 0x20)), 0x40) length := mload(buffer) } require( length + data.length <= capacity, "DynamicBuffer: Appending out of bounds." ); appendUnchecked(buffer, data); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library HelperLib { function parseInt(string memory self) internal pure returns (uint8) { bytes memory bresult = bytes(self); uint8 mint = 0; for (uint8 i = 0; i < bresult.length; i++) { if ( (uint8(uint8(bresult[i])) >= 48) && (uint8(uint8(bresult[i])) <= 57) ) { mint *= 10; mint += uint8(bresult[i]) - 48; } } return mint; } function subStr( string memory self, uint256 startIndex, uint256 endIndex ) internal pure returns (string memory) { bytes memory strBytes = bytes(self); bytes memory result = new bytes(endIndex - startIndex); for (uint256 i = startIndex; i < endIndex; i++) { result[i - startIndex] = strBytes[i]; } return string(result); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is a base contract to aid in writing upgradeable diamond facet contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ import {ERC721A__InitializableStorage} from './ERC721A__InitializableStorage.sol'; abstract contract ERC721A__Initializable { using ERC721A__InitializableStorage for ERC721A__InitializableStorage.Layout; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializerERC721A() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require( ERC721A__InitializableStorage.layout()._initializing ? _isConstructor() : !ERC721A__InitializableStorage.layout()._initialized, 'ERC721A__Initializable: contract is already initialized' ); bool isTopLevelCall = !ERC721A__InitializableStorage.layout()._initializing; if (isTopLevelCall) { ERC721A__InitializableStorage.layout()._initializing = true; ERC721A__InitializableStorage.layout()._initialized = true; } _; if (isTopLevelCall) { ERC721A__InitializableStorage.layout()._initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializingERC721A() { require( ERC721A__InitializableStorage.layout()._initializing, 'ERC721A__Initializable: contract is not initializing' ); _; } /// @dev Returns true if and only if the function is running in the constructor function _isConstructor() private view returns (bool) { // extcodesize checks the size of the code stored in an address, and // address returns the current address. Since the code is still not // deployed when running a constructor, any checks on its code size will // yield zero, making it an effective way to detect if a contract is // under construction or not. address self = address(this); uint256 cs; assembly { cs := extcodesize(self) } return cs == 0; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is a base storage for the initialization function for upgradeable diamond facet contracts **/ library ERC721A__InitializableStorage { struct Layout { /* * Indicates that the contract has been initialized. */ bool _initialized; /* * Indicates that the contract is in the process of being initialized. */ bool _initializing; } bytes32 internal constant STORAGE_SLOT = keccak256('ERC721A.contracts.storage.initializable.facet'); function layout() internal pure returns (Layout storage l) { bytes32 slot = STORAGE_SLOT; assembly { l.slot := slot } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library ERC721AStorage { // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364). struct TokenApprovalRef { address value; } struct Layout { // ============================================================= // STORAGE // ============================================================= // The next token ID to be minted. uint256 _currentIndex; // The number of tokens burned. uint256 _burnCounter; // Token name string _name; // Token symbol string _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. // See {_packedOwnershipOf} implementation for details. // // Bits Layout: // - [0..159] `addr` // - [160..223] `startTimestamp` // - [224] `burned` // - [225] `nextInitialized` // - [232..255] `extraData` mapping(uint256 => uint256) _packedOwnerships; // Mapping owner address to address data. // // Bits Layout: // - [0..63] `balance` // - [64..127] `numberMinted` // - [128..191] `numberBurned` // - [192..255] `aux` mapping(address => uint256) _packedAddressData; // Mapping from token ID to approved address. mapping(uint256 => ERC721AStorage.TokenApprovalRef) _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) _operatorApprovals; } bytes32 internal constant STORAGE_SLOT = keccak256('ERC721A.contracts.storage.ERC721A'); function layout() internal pure returns (Layout storage l) { bytes32 slot = STORAGE_SLOT; assembly { l.slot := slot } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721AUpgradeable.sol'; import {ERC721AStorage} from './ERC721AStorage.sol'; import './ERC721A__Initializable.sol'; /** * @dev Interface of ERC721 token receiver. */ interface ERC721A__IERC721ReceiverUpgradeable { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @title ERC721A * * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) * Non-Fungible Token Standard, including the Metadata extension. * Optimized for lower gas during batch mints. * * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) * starting from `_startTokenId()`. * * Assumptions: * * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721AUpgradeable is ERC721A__Initializable, IERC721AUpgradeable { using ERC721AStorage for ERC721AStorage.Layout; // ============================================================= // CONSTANTS // ============================================================= // Mask of an entry in packed address data. uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1; // The bit position of `numberMinted` in packed address data. uint256 private constant _BITPOS_NUMBER_MINTED = 64; // The bit position of `numberBurned` in packed address data. uint256 private constant _BITPOS_NUMBER_BURNED = 128; // The bit position of `aux` in packed address data. uint256 private constant _BITPOS_AUX = 192; // Mask of all 256 bits in packed address data except the 64 bits for `aux`. uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1; // The bit position of `startTimestamp` in packed ownership. uint256 private constant _BITPOS_START_TIMESTAMP = 160; // The bit mask of the `burned` bit in packed ownership. uint256 private constant _BITMASK_BURNED = 1 << 224; // The bit position of the `nextInitialized` bit in packed ownership. uint256 private constant _BITPOS_NEXT_INITIALIZED = 225; // The bit mask of the `nextInitialized` bit in packed ownership. uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225; // The bit position of `extraData` in packed ownership. uint256 private constant _BITPOS_EXTRA_DATA = 232; // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`. uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1; // The mask of the lower 160 bits for addresses. uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; // The maximum `quantity` that can be minted with {_mintERC2309}. // This limit is to prevent overflows on the address data entries. // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309} // is required to cause an overflow, which is unrealistic. uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000; // The `Transfer` event signature is given by: // `keccak256(bytes("Transfer(address,address,uint256)"))`. bytes32 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; // ============================================================= // CONSTRUCTOR // ============================================================= function __ERC721A_init(string memory name_, string memory symbol_) internal onlyInitializingERC721A { __ERC721A_init_unchained(name_, symbol_); } function __ERC721A_init_unchained(string memory name_, string memory symbol_) internal onlyInitializingERC721A { ERC721AStorage.layout()._name = name_; ERC721AStorage.layout()._symbol = symbol_; ERC721AStorage.layout()._currentIndex = _startTokenId(); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @dev Returns the starting token ID. * To change the starting token ID, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId() internal view virtual returns (uint256) { return ERC721AStorage.layout()._currentIndex; } /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() public view virtual override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than `_currentIndex - _startTokenId()` times. unchecked { return ERC721AStorage.layout()._currentIndex - ERC721AStorage.layout()._burnCounter - _startTokenId(); } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view virtual returns (uint256) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { return ERC721AStorage.layout()._currentIndex - _startTokenId(); } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return ERC721AStorage.layout()._burnCounter; } // ============================================================= // ADDRESS DATA OPERATIONS // ============================================================= /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) public view virtual override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return ERC721AStorage.layout()._packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return (ERC721AStorage.layout()._packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return (ERC721AStorage.layout()._packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return uint64(ERC721AStorage.layout()._packedAddressData[owner] >> _BITPOS_AUX); } /** * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal virtual { uint256 packed = ERC721AStorage.layout()._packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); ERC721AStorage.layout()._packedAddressData[owner] = packed; } // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { // The interface IDs are constants representing the first 4 bytes // of the XOR of all function selectors in the interface. // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165) // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`) return interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. } // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() public view virtual override returns (string memory) { return ERC721AStorage.layout()._name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return ERC721AStorage.layout()._symbol; } /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : ''; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, it can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } // ============================================================= // OWNERSHIPS OPERATIONS // ============================================================= /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @dev Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around over time. */ function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @dev Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(ERC721AStorage.layout()._packedOwnerships[index]); } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal virtual { if (ERC721AStorage.layout()._packedOwnerships[index] == 0) { ERC721AStorage.layout()._packedOwnerships[index] = _packedOwnershipOf(index); } } /** * Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) { if (_startTokenId() <= tokenId) { packed = ERC721AStorage.layout()._packedOwnerships[tokenId]; // If not burned. if (packed & _BITMASK_BURNED == 0) { // If the data at the starting slot does not exist, start the scan. if (packed == 0) { if (tokenId >= ERC721AStorage.layout()._currentIndex) revert OwnerQueryForNonexistentToken(); // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `tokenId` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. for (;;) { unchecked { packed = ERC721AStorage.layout()._packedOwnerships[--tokenId]; } if (packed == 0) continue; return packed; } } // Otherwise, the data exists and is not burned. We can skip the scan. // This is possible because we have already achieved the target condition. // This saves 2143 gas on transfers of initialized tokens. return packed; } } revert OwnerQueryForNonexistentToken(); } /** * @dev Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); ownership.burned = packed & _BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)) } } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. See {ERC721A-_approve}. * * Requirements: * * - The caller must own the token or be an approved operator. */ function approve(address to, uint256 tokenId) public payable virtual override { _approve(to, tokenId, true); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return ERC721AStorage.layout()._tokenApprovals[tokenId].value; } /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) public virtual override { ERC721AStorage.layout()._operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return ERC721AStorage.layout()._operatorApprovals[owner][operator]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted. See {_mint}. */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _startTokenId() <= tokenId && tokenId < ERC721AStorage.layout()._currentIndex && // If within bounds, ERC721AStorage.layout()._packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned. } /** * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`. */ function _isSenderApprovedOrOwner( address approvedAddress, address owner, address msgSender ) private pure returns (bool result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, _BITMASK_ADDRESS) // `msgSender == owner || msgSender == approvedAddress`. result := or(eq(msgSender, owner), eq(msgSender, approvedAddress)) } } /** * @dev Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedSlotAndAddress(uint256 tokenId) private view returns (uint256 approvedAddressSlot, address approvedAddress) { ERC721AStorage.TokenApprovalRef storage tokenApproval = ERC721AStorage.layout()._tokenApprovals[tokenId]; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`. assembly { approvedAddressSlot := tokenApproval.slot approvedAddress := sload(approvedAddressSlot) } } // ============================================================= // TRANSFER OPERATIONS // ============================================================= /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) public payable virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // We can directly increment and decrement the balances. --ERC721AStorage.layout()._packedAddressData[from]; // Updates: `balance -= 1`. ++ERC721AStorage.layout()._packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. ERC721AStorage.layout()._packedOwnerships[tokenId] = _packOwnershipData( to, _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (ERC721AStorage.layout()._packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != ERC721AStorage.layout()._currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. ERC721AStorage.layout()._packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public payable virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public payable virtual override { transferFrom(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @dev Hook that is called before a set of serially-ordered token IDs * are about to be transferred. This includes minting. * And also called before burning one token. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token IDs * have been transferred. This includes minting. * And also called after one token has been burned. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * `from` - Previous owner of the given token ID. * `to` - Target address that will receive the token. * `tokenId` - Token ID to be transferred. * `_data` - Optional data to send along with the call. * * Returns whether the call correctly returned the expected magic value. */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try ERC721A__IERC721ReceiverUpgradeable(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (bytes4 retval) { return retval == ERC721A__IERC721ReceiverUpgradeable(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } // ============================================================= // MINT OPERATIONS // ============================================================= /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event for each mint. */ function _mint(address to, uint256 quantity) internal virtual { uint256 startTokenId = ERC721AStorage.layout()._currentIndex; if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // `balance` and `numberMinted` have a maximum limit of 2**64. // `tokenId` has a maximum limit of 2**256. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. ERC721AStorage.layout()._packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. ERC721AStorage.layout()._packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); uint256 toMasked; uint256 end = startTokenId + quantity; // Use assembly to loop and emit the `Transfer` event for gas savings. // The duplicated `log4` removes an extra check and reduces stack juggling. // The assembly, together with the surrounding Solidity code, have been // delicately arranged to nudge the compiler into producing optimized opcodes. assembly { // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. toMasked := and(to, _BITMASK_ADDRESS) // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. startTokenId // `tokenId`. ) // The `iszero(eq(,))` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. // The compiler will optimize the `iszero` away for performance. for { let tokenId := add(startTokenId, 1) } iszero(eq(tokenId, end)) { tokenId := add(tokenId, 1) } { // Emit the `Transfer` event. Similar to above. log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId) } } if (toMasked == 0) revert MintToZeroAddress(); ERC721AStorage.layout()._currentIndex = end; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * This function is intended for efficient minting only during contract creation. * * It emits only one {ConsecutiveTransfer} as defined in * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). * * Calling this function outside of contract creation WILL make your contract * non-compliant with the ERC721 standard. * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 * {ConsecutiveTransfer} event is only permissible during contract creation. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {ConsecutiveTransfer} event. */ function _mintERC2309(address to, uint256 quantity) internal virtual { uint256 startTokenId = ERC721AStorage.layout()._currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are unrealistic due to the above check for `quantity` to be below the limit. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. ERC721AStorage.layout()._packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. ERC721AStorage.layout()._packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to); ERC721AStorage.layout()._currentIndex = startTokenId + quantity; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * See {_mint}. * * Emits a {Transfer} event for each mint. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = ERC721AStorage.layout()._currentIndex; uint256 index = end - quantity; do { if (!_checkContractOnERC721Received(address(0), to, index++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (index < end); // Reentrancy protection. if (ERC721AStorage.layout()._currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Equivalent to `_approve(to, tokenId, false)`. */ function _approve(address to, uint256 tokenId) internal virtual { _approve(to, tokenId, false); } /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - `tokenId` must exist. * * Emits an {Approval} event. */ function _approve( address to, uint256 tokenId, bool approvalCheck ) internal virtual { address owner = ownerOf(tokenId); if (approvalCheck) if (_msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } ERC721AStorage.layout()._tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // Updates: // - `balance -= 1`. // - `numberBurned += 1`. // // We can directly decrement the balance, and increment the number burned. // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`. ERC721AStorage.layout()._packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1; // Updates: // - `address` to the last owner. // - `startTimestamp` to the timestamp of burning. // - `burned` to `true`. // - `nextInitialized` to `true`. ERC721AStorage.layout()._packedOwnerships[tokenId] = _packOwnershipData( from, (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (ERC721AStorage.layout()._packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != ERC721AStorage.layout()._currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. ERC721AStorage.layout()._packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { ERC721AStorage.layout()._burnCounter++; } } // ============================================================= // EXTRA DATA OPERATIONS // ============================================================= /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { uint256 packed = ERC721AStorage.layout()._packedOwnerships[index]; if (packed == 0) revert OwnershipNotInitializedForExtraData(); uint256 extraDataCasted; // Cast `extraData` with assembly to avoid redundant masking. assembly { extraDataCasted := extraData } packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA); ERC721AStorage.layout()._packedOwnerships[index] = packed; } /** * @dev Called during each token transfer to set the 24bit `extraData` field. * Intended to be overridden by the cosumer contract. * * `previousExtraData` - the value of `extraData` before transfer. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _extraData( address from, address to, uint24 previousExtraData ) internal view virtual returns (uint24) {} /** * @dev Returns the next extra data for the packed ownership data. * The returned result is shifted into position. */ function _nextExtraData( address from, address to, uint256 prevOwnershipPacked ) private view returns (uint256) { uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA); return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA; } // ============================================================= // OTHER OPERATIONS // ============================================================= /** * @dev Returns the message sender (defaults to `msg.sender`). * * If you are writing GSN compatible contracts, you need to override this function. */ function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; } /** * @dev Converts a uint256 to its ASCII string decimal representation. */ function _toString(uint256 value) internal pure virtual returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0. let m := add(mload(0x40), 0xa0) // Update the free memory pointer to allocate. mstore(0x40, m) // Assign the `str` to the end. str := sub(m, 0x20) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 1) // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) // prettier-ignore if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721A. */ interface IERC721AUpgradeable { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * Cannot query the balance for the zero address. */ error BalanceQueryForZeroAddress(); /** * Cannot mint to the zero address. */ error MintToZeroAddress(); /** * The quantity of tokens minted must be more than zero. */ error MintZeroQuantity(); /** * The token does not exist. */ error OwnerQueryForNonexistentToken(); /** * The caller must own the token or be an approved operator. */ error TransferCallerNotOwnerNorApproved(); /** * The token must be owned by `from`. */ error TransferFromIncorrectOwner(); /** * Cannot safely transfer to a contract that does not implement the * ERC721Receiver interface. */ error TransferToNonERC721ReceiverImplementer(); /** * Cannot transfer to the zero address. */ error TransferToZeroAddress(); /** * The token does not exist. */ error URIQueryForNonexistentToken(); /** * The `quantity` minted with ERC2309 exceeds the safety limit. */ error MintERC2309QuantityExceedsLimit(); /** * The `extraData` cannot be set on an unintialized ownership slot. */ error OwnershipNotInitializedForExtraData(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. uint24 extraData; } // ============================================================= // TOKEN COUNTERS // ============================================================= /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() external view returns (uint256); // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================================================= // IERC721 // ============================================================= /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables * (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, * checking first that contract recipients are aware of the ERC721 protocol * to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move * this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external payable; /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Transfers `tokenId` from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} * whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external payable; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) external view returns (bool); // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); // ============================================================= // IERC2309 // ============================================================= /** * @dev Emitted when tokens in `fromTokenId` to `toTokenId` * (inclusive) is transferred from `from` to `to`, as defined in the * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard. * * See {_mintERC2309} for more details. */ event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IOperatorFilterRegistry { /** * @notice Returns true if operator is not filtered for a given token, either by address or codeHash. Also returns * true if supplied registrant address is not registered. */ function isOperatorAllowed(address registrant, address operator) external view returns (bool); /** * @notice Registers an address with the registry. May be called by address itself or by EIP-173 owner. */ function register(address registrant) external; /** * @notice Registers an address with the registry and "subscribes" to another address's filtered operators and codeHashes. */ function registerAndSubscribe(address registrant, address subscription) external; /** * @notice Registers an address with the registry and copies the filtered operators and codeHashes from another * address without subscribing. */ function registerAndCopyEntries(address registrant, address registrantToCopy) external; /** * @notice Unregisters an address with the registry and removes its subscription. May be called by address itself or by EIP-173 owner. * Note that this does not remove any filtered addresses or codeHashes. * Also note that any subscriptions to this registrant will still be active and follow the existing filtered addresses and codehashes. */ function unregister(address addr) external; /** * @notice Update an operator address for a registered address - when filtered is true, the operator is filtered. */ function updateOperator(address registrant, address operator, bool filtered) external; /** * @notice Update multiple operators for a registered address - when filtered is true, the operators will be filtered. Reverts on duplicates. */ function updateOperators(address registrant, address[] calldata operators, bool filtered) external; /** * @notice Update a codeHash for a registered address - when filtered is true, the codeHash is filtered. */ function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external; /** * @notice Update multiple codeHashes for a registered address - when filtered is true, the codeHashes will be filtered. Reverts on duplicates. */ function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external; /** * @notice Subscribe an address to another registrant's filtered operators and codeHashes. Will remove previous * subscription if present. * Note that accounts with subscriptions may go on to subscribe to other accounts - in this case, * subscriptions will not be forwarded. Instead the former subscription's existing entries will still be * used. */ function subscribe(address registrant, address registrantToSubscribe) external; /** * @notice Unsubscribe an address from its current subscribed registrant, and optionally copy its filtered operators and codeHashes. */ function unsubscribe(address registrant, bool copyExistingEntries) external; /** * @notice Get the subscription address of a given registrant, if any. */ function subscriptionOf(address addr) external returns (address registrant); /** * @notice Get the set of addresses subscribed to a given registrant. * Note that order is not guaranteed as updates are made. */ function subscribers(address registrant) external returns (address[] memory); /** * @notice Get the subscriber at a given index in the set of addresses subscribed to a given registrant. * Note that order is not guaranteed as updates are made. */ function subscriberAt(address registrant, uint256 index) external returns (address); /** * @notice Copy filtered operators and codeHashes from a different registrantToCopy to addr. */ function copyEntriesOf(address registrant, address registrantToCopy) external; /** * @notice Returns true if operator is filtered by a given address or its subscription. */ function isOperatorFiltered(address registrant, address operator) external returns (bool); /** * @notice Returns true if the hash of an address's code is filtered by a given address or its subscription. */ function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool); /** * @notice Returns true if a codeHash is filtered by a given address or its subscription. */ function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); /** * @notice Returns a list of filtered operators for a given address or its subscription. */ function filteredOperators(address addr) external returns (address[] memory); /** * @notice Returns the set of filtered codeHashes for a given address or its subscription. * Note that order is not guaranteed as updates are made. */ function filteredCodeHashes(address addr) external returns (bytes32[] memory); /** * @notice Returns the filtered operator at the given index of the set of filtered operators for a given address or * its subscription. * Note that order is not guaranteed as updates are made. */ function filteredOperatorAt(address registrant, uint256 index) external returns (address); /** * @notice Returns the filtered codeHash at the given index of the list of filtered codeHashes for a given address or * its subscription. * Note that order is not guaranteed as updates are made. */ function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); /** * @notice Returns true if an address has registered */ function isRegistered(address addr) external returns (bool); /** * @dev Convenience method to compute the code hash of an arbitrary contract */ function codeHashOf(address addr) external returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IOperatorFilterRegistry} from "../IOperatorFilterRegistry.sol"; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /** * @title OperatorFiltererUpgradeable * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another * registrant's entries in the OperatorFilterRegistry when the init function is called. * @dev This smart contract is meant to be inherited by token contracts so they can use the following: * - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods. * - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods. */ abstract contract OperatorFiltererUpgradeable is Initializable { /// @notice Emitted when an operator is not allowed. error OperatorNotAllowed(address operator); IOperatorFilterRegistry constant OPERATOR_FILTER_REGISTRY = IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E); /// @dev The upgradeable initialize function that should be called when the contract is being upgraded. function __OperatorFilterer_init(address subscriptionOrRegistrantToCopy, bool subscribe) internal onlyInitializing { // If an inheriting token contract is deployed to a network without the registry deployed, the modifier // will not revert, but the contract will need to be registered with the registry once it is deployed in // order for the modifier to filter addresses. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { if (!OPERATOR_FILTER_REGISTRY.isRegistered(address(this))) { if (subscribe) { OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy); } else { if (subscriptionOrRegistrantToCopy != address(0)) { OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy); } else { OPERATOR_FILTER_REGISTRY.register(address(this)); } } } } } /** * @dev A helper modifier to check if the operator is allowed. */ modifier onlyAllowedOperator(address from) virtual { // Allow spending tokens from addresses with balance // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred // from an EOA. if (from != msg.sender) { _checkFilterOperator(msg.sender); } _; } /** * @dev A helper modifier to check if the operator approval is allowed. */ modifier onlyAllowedOperatorApproval(address operator) virtual { _checkFilterOperator(operator); _; } /** * @dev A helper function to check if the operator is allowed. */ function _checkFilterOperator(address operator) internal view virtual { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { // under normal circumstances, this function will revert rather than return false, but inheriting or // upgraded contracts may specify their own OperatorFilterRegistry implementations, which may behave // differently if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(operator); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Library to encode strings in Base64. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/Base64.sol) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/Base64.sol) /// @author Modified from (https://github.com/Brechtpd/base64/blob/main/base64.sol) by Brecht Devos - <[email protected]>. library Base64 { /// @dev Encodes `data` using the base64 encoding described in RFC 4648. /// See: https://datatracker.ietf.org/doc/html/rfc4648 /// @param fileSafe Whether to replace '+' with '-' and '/' with '_'. /// @param noPadding Whether to strip away the padding. function encode(bytes memory data, bool fileSafe, bool noPadding) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let dataLength := mload(data) if dataLength { // Multiply by 4/3 rounded up. // The `shl(2, ...)` is equivalent to multiplying by 4. let encodedLength := shl(2, div(add(dataLength, 2), 3)) // Set `result` to point to the start of the free memory. result := mload(0x40) // Store the table into the scratch space. // Offsetted by -1 byte so that the `mload` will load the character. // We will rewrite the free memory pointer at `0x40` later with // the allocated size. // The magic constant 0x0230 will translate "-_" + "+/". mstore(0x1f, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef") mstore(0x3f, sub("ghijklmnopqrstuvwxyz0123456789-_", mul(iszero(fileSafe), 0x0230))) // Skip the first slot, which stores the length. let ptr := add(result, 0x20) let end := add(ptr, encodedLength) // Run over the input, 3 bytes at a time. for {} 1 {} { data := add(data, 3) // Advance 3 bytes. let input := mload(data) // Write 4 bytes. Optimized for fewer stack operations. mstore8(ptr, mload(and(shr(18, input), 0x3F))) mstore8(add(ptr, 1), mload(and(shr(12, input), 0x3F))) mstore8(add(ptr, 2), mload(and(shr(6, input), 0x3F))) mstore8(add(ptr, 3), mload(and(input, 0x3F))) ptr := add(ptr, 4) // Advance 4 bytes. if iszero(lt(ptr, end)) { break } } let r := mod(dataLength, 3) switch noPadding case 0 { // Offset `ptr` and pad with '='. We can simply write over the end. mstore8(sub(ptr, iszero(iszero(r))), 0x3d) // Pad at `ptr - 1` if `r > 0`. mstore8(sub(ptr, shl(1, eq(r, 1))), 0x3d) // Pad at `ptr - 2` if `r == 1`. // Write the length of the string. mstore(result, encodedLength) } default { // Write the length of the string. mstore(result, sub(encodedLength, add(iszero(iszero(r)), eq(r, 1)))) } // Allocate the memory for the string. // Add 31 and mask with `not(31)` to round the // free memory pointer up the next multiple of 32. mstore(0x40, and(add(end, 31), not(31))) } } } /// @dev Encodes `data` using the base64 encoding described in RFC 4648. /// Equivalent to `encode(data, false, false)`. function encode(bytes memory data) internal pure returns (string memory result) { result = encode(data, false, false); } /// @dev Encodes `data` using the base64 encoding described in RFC 4648. /// Equivalent to `encode(data, fileSafe, false)`. function encode(bytes memory data, bool fileSafe) internal pure returns (string memory result) { result = encode(data, fileSafe, false); } /// @dev Encodes base64 encoded `data`. /// /// Supports: /// - RFC 4648 (both standard and file-safe mode). /// - RFC 3501 (63: ','). /// /// Does not support: /// - Line breaks. /// /// Note: For performance reasons, /// this function will NOT revert on invalid `data` inputs. /// Outputs for invalid inputs will simply be undefined behaviour. /// It is the user's responsibility to ensure that the `data` /// is a valid base64 encoded string. function decode(string memory data) internal pure returns (bytes memory result) { /// @solidity memory-safe-assembly assembly { let dataLength := mload(data) if dataLength { let end := add(data, dataLength) let decodedLength := mul(shr(2, dataLength), 3) switch and(dataLength, 3) case 0 { // If padded. // forgefmt: disable-next-item decodedLength := sub( decodedLength, add(eq(and(mload(end), 0xFF), 0x3d), eq(and(mload(end), 0xFFFF), 0x3d3d)) ) } default { // If non-padded. decodedLength := add(decodedLength, sub(and(dataLength, 3), 1)) } result := mload(0x40) // Write the length of the string. mstore(result, decodedLength) // Skip the first slot, which stores the length. let ptr := add(result, 0x20) // Load the table into the scratch space. // Constants are optimized for smaller bytecode with zero gas overhead. // `m` also doubles as the mask of the upper 6 bits. let m := 0xfc000000fc00686c7074787c8084888c9094989ca0a4a8acb0b4b8bcc0c4c8cc mstore(0x5b, m) mstore(0x3b, 0x04080c1014181c2024282c3034383c4044484c5054585c6064) mstore(0x1a, 0xf8fcf800fcd0d4d8dce0e4e8ecf0f4) for {} 1 {} { // Read 4 bytes. data := add(data, 4) let input := mload(data) // Write 3 bytes. // forgefmt: disable-next-item mstore(ptr, or( and(m, mload(byte(28, input))), shr(6, or( and(m, mload(byte(29, input))), shr(6, or( and(m, mload(byte(30, input))), shr(6, mload(byte(31, input))) )) )) )) ptr := add(ptr, 3) if iszero(lt(data, end)) { break } } // Allocate the memory for the string. // Add 32 + 31 and mask with `not(31)` to round the // free memory pointer up the next multiple of 32. mstore(0x40, and(add(add(result, decodedLength), 63), not(31))) // Restore the zero slot. mstore(0x60, 0) } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Library for generating psuedorandom numbers. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibPRNG.sol) library LibPRNG { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* STRUCTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev A psuedorandom number state in memory. struct PRNG { uint256 state; } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Seeds the `prng` with `state`. function seed(PRNG memory prng, uint256 state) internal pure { /// @solidity memory-safe-assembly assembly { mstore(prng, state) } } /// @dev Returns the next psuedorandom uint256. /// All bits of the returned uint256 pass the NIST Statistical Test Suite. function next(PRNG memory prng) internal pure returns (uint256 result) { // We simply use `keccak256` for a great balance between // runtime gas costs, bytecode size, and statistical properties. // // A high-quality LCG with a 32-byte state // is only about 30% more gas efficient during runtime, // but requires a 32-byte multiplier, which can cause bytecode bloat // when this function is inlined. // // Using this method is about 2x more efficient than // `nextRandomness = uint256(keccak256(abi.encode(randomness)))`. /// @solidity memory-safe-assembly assembly { result := keccak256(prng, 0x20) mstore(prng, result) } } /// @dev Returns a psuedorandom uint256, uniformly distributed /// between 0 (inclusive) and `upper` (exclusive). /// If your modulus is big, this method is recommended /// for uniform sampling to avoid modulo bias. /// For uniform sampling across all uint256 values, /// or for small enough moduli such that the bias is neligible, /// use {next} instead. function uniform(PRNG memory prng, uint256 upper) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { for {} 1 {} { result := keccak256(prng, 0x20) mstore(prng, result) if iszero(lt(result, mod(sub(0, upper), upper))) { break } } result := mod(result, upper) } } /// @dev Shuffles the array in-place with Fisher-Yates shuffle. function shuffle(PRNG memory prng, uint256[] memory a) internal pure { /// @solidity memory-safe-assembly assembly { let n := mload(a) let w := not(0) let mask := shr(128, w) if n { for { a := add(a, 0x20) } 1 {} { // We can just directly use `keccak256`, cuz // the other approaches don't save much. let r := keccak256(prng, 0x20) mstore(prng, r) // Note that there will be a very tiny modulo bias // if the length of the array is not a power of 2. // For all practical purposes, it is negligible // and will not be a fairness or security concern. { let j := add(a, shl(5, mod(shr(128, r), n))) n := add(n, w) // `sub(n, 1)`. if iszero(n) { break } let i := add(a, shl(5, n)) let t := mload(i) mstore(i, mload(j)) mstore(j, t) } { let j := add(a, shl(5, mod(and(r, mask), n))) n := add(n, w) // `sub(n, 1)`. if iszero(n) { break } let i := add(a, shl(5, n)) let t := mload(i) mstore(i, mload(j)) mstore(j, t) } } } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Read and write to persistent storage at a fraction of the cost. /// @author Solady (https://github.com/vectorized/solmady/blob/main/src/utils/SSTORE2.sol) /// @author Saw-mon-and-Natalie (https://github.com/Saw-mon-and-Natalie) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SSTORE2.sol) /// @author Modified from 0xSequence (https://github.com/0xSequence/sstore2/blob/master/contracts/SSTORE2.sol) library SSTORE2 { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Unable to deploy the storage contract. error DeploymentFailed(); /// @dev The storage contract address is invalid. error InvalidPointer(); /// @dev Attempt to read outside of the storage contract's bytecode bounds. error ReadOutOfBounds(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* WRITE LOGIC */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Writes `data` into the bytecode of a storage contract and returns its address. function write(bytes memory data) internal returns (address pointer) { // Note: The assembly block below does not expand the memory. /// @solidity memory-safe-assembly assembly { let originalDataLength := mload(data) // Add 1 to data size since we are prefixing it with a STOP opcode. let dataSize := add(originalDataLength, 1) /** * ------------------------------------------------------------------------------+ * Opcode | Mnemonic | Stack | Memory | * ------------------------------------------------------------------------------| * 61 codeSize | PUSH2 codeSize | codeSize | | * 80 | DUP1 | codeSize codeSize | | * 60 0xa | PUSH1 0xa | 0xa codeSize codeSize | | * 3D | RETURNDATASIZE | 0 0xa codeSize codeSize | | * 39 | CODECOPY | codeSize | [0..codeSize): code | * 3D | RETURNDATASZIE | 0 codeSize | [0..codeSize): code | * F3 | RETURN | | [0..codeSize): code | * 00 | STOP | | | * ------------------------------------------------------------------------------+ * @dev Prefix the bytecode with a STOP opcode to ensure it cannot be called. * Also PUSH2 is used since max contract size cap is 24,576 bytes which is less than 2 ** 16. */ mstore( data, or( 0x61000080600a3d393df300, // Left shift `dataSize` by 64 so that it lines up with the 0000 after PUSH2. shl(0x40, dataSize) ) ) // Deploy a new contract with the generated creation code. pointer := create(0, add(data, 0x15), add(dataSize, 0xa)) // If `pointer` is zero, revert. if iszero(pointer) { // Store the function selector of `DeploymentFailed()`. mstore(0x00, 0x30116425) // Revert with (offset, size). revert(0x1c, 0x04) } // Restore original length of the variable size `data`. mstore(data, originalDataLength) } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* READ LOGIC */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns all the `data` from the bytecode of the storage contract at `pointer`. function read(address pointer) internal view returns (bytes memory data) { /// @solidity memory-safe-assembly assembly { let pointerCodesize := extcodesize(pointer) if iszero(pointerCodesize) { // Store the function selector of `InvalidPointer()`. mstore(0x00, 0x11052bb4) // Revert with (offset, size). revert(0x1c, 0x04) } // Offset all indices by 1 to skip the STOP opcode. let size := sub(pointerCodesize, 1) // Get the pointer to the free memory and allocate // enough 32-byte words for the data and the length of the data, // then copy the code to the allocated memory. // Masking with 0xffe0 will suffice, since contract size is less than 16 bits. data := mload(0x40) mstore(0x40, add(data, and(add(size, 0x3f), 0xffe0))) mstore(data, size) mstore(add(add(data, 0x20), size), 0) // Zeroize the last slot. extcodecopy(pointer, add(data, 0x20), 1, size) } } /// @dev Returns the `data` from the bytecode of the storage contract at `pointer`, /// from the byte at `start`, to the end of the data stored. function read(address pointer, uint256 start) internal view returns (bytes memory data) { /// @solidity memory-safe-assembly assembly { let pointerCodesize := extcodesize(pointer) if iszero(pointerCodesize) { // Store the function selector of `InvalidPointer()`. mstore(0x00, 0x11052bb4) // Revert with (offset, size). revert(0x1c, 0x04) } // If `!(pointer.code.size > start)`, reverts. // This also handles the case where `start + 1` overflows. if iszero(gt(pointerCodesize, start)) { // Store the function selector of `ReadOutOfBounds()`. mstore(0x00, 0x84eb0dd1) // Revert with (offset, size). revert(0x1c, 0x04) } let size := sub(pointerCodesize, add(start, 1)) // Get the pointer to the free memory and allocate // enough 32-byte words for the data and the length of the data, // then copy the code to the allocated memory. // Masking with 0xffe0 will suffice, since contract size is less than 16 bits. data := mload(0x40) mstore(0x40, add(data, and(add(size, 0x3f), 0xffe0))) mstore(data, size) mstore(add(add(data, 0x20), size), 0) // Zeroize the last slot. extcodecopy(pointer, add(data, 0x20), add(start, 1), size) } } /// @dev Returns the `data` from the bytecode of the storage contract at `pointer`, /// from the byte at `start`, to the byte at `end` (exclusive) of the data stored. function read(address pointer, uint256 start, uint256 end) internal view returns (bytes memory data) { /// @solidity memory-safe-assembly assembly { let pointerCodesize := extcodesize(pointer) if iszero(pointerCodesize) { // Store the function selector of `InvalidPointer()`. mstore(0x00, 0x11052bb4) // Revert with (offset, size). revert(0x1c, 0x04) } // If `!(pointer.code.size > end) || (start > end)`, revert. // This also handles the cases where `end + 1` or `start + 1` overflow. if iszero( and( gt(pointerCodesize, end), // Within bounds. iszero(gt(start, end)) // Valid range. ) ) { // Store the function selector of `ReadOutOfBounds()`. mstore(0x00, 0x84eb0dd1) // Revert with (offset, size). revert(0x1c, 0x04) } let size := sub(end, start) // Get the pointer to the free memory and allocate // enough 32-byte words for the data and the length of the data, // then copy the code to the allocated memory. // Masking with 0xffe0 will suffice, since contract size is less than 16 bits. data := mload(0x40) mstore(0x40, add(data, and(add(size, 0x3f), 0xffe0))) mstore(data, size) mstore(add(add(data, 0x20), size), 0) // Zeroize the last slot. extcodecopy(pointer, add(data, 0x20), add(start, 1), size) } } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"InvalidInput","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NotAuthorized","type":"error"},{"inputs":[],"name":"NotAvailable","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","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"},{"inputs":[{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"string","name":"_mimetype","type":"string"},{"internalType":"bytes","name":"chunk","type":"bytes"}],"name":"addChunk","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"bytes","name":"chunk","type":"bytes"}],"name":"addChunk","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"airdrop","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"address[]","name":"to","type":"address[]"}],"name":"airdrop","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"animationUrl","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collectorFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"didMintEnd","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"chunkIndex","type":"uint256"}],"name":"getChunk","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMedia","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"imageUrl","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"components":[{"internalType":"uint256","name":"maxPerAddress","type":"uint256"},{"internalType":"uint256","name":"publicMintPrice","type":"uint256"},{"internalType":"uint256","name":"mintStart","type":"uint256"},{"internalType":"uint256","name":"mintEnd","type":"uint256"},{"internalType":"bool","name":"isContractSealed","type":"bool"},{"internalType":"string","name":"description","type":"string"}],"internalType":"struct OpenEditionSettings","name":"_settings","type":"tuple"},{"components":[{"internalType":"address","name":"royaltyAddress","type":"address"},{"internalType":"uint96","name":"royaltyAmount","type":"uint96"}],"internalType":"struct RoyaltySettings","name":"_royaltySettings","type":"tuple"},{"components":[{"internalType":"address","name":"recipientAddress","type":"address"},{"internalType":"uint256","name":"percentage","type":"uint256"}],"internalType":"struct WithdrawRecipient[]","name":"_withdrawRecipients","type":"tuple[]"},{"components":[{"internalType":"address","name":"indelibleSecurity","type":"address"},{"internalType":"address","name":"collectorFeeRecipient","type":"address"},{"internalType":"uint256","name":"collectorFee","type":"uint256"},{"internalType":"address","name":"deployer","type":"address"},{"internalType":"address","name":"operatorFilter","type":"address"},{"internalType":"uint256","name":"signatureLifespan","type":"uint256"}],"internalType":"struct FactorySettings","name":"_factorySettings","type":"tuple"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"sealContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"url","type":"string"}],"name":"setAnimationUrl","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"url","type":"string"}],"name":"setImageUrl","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxPerAddress","type":"uint256"}],"name":"setMaxPerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintEnd","type":"uint256"}],"name":"setMintEnd","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintStart","type":"uint256"}],"name":"setMintStart","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"publicMintPrice","type":"uint256"}],"name":"setPublicMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"settings","outputs":[{"internalType":"uint256","name":"maxPerAddress","type":"uint256"},{"internalType":"uint256","name":"publicMintPrice","type":"uint256"},{"internalType":"uint256","name":"mintStart","type":"uint256"},{"internalType":"uint256","name":"mintEnd","type":"uint256"},{"internalType":"bool","name":"isContractSealed","type":"bool"},{"internalType":"string","name":"description","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"}],"internalType":"struct Signature","name":"signature","type":"tuple"},{"internalType":"uint256","name":"_nonce","type":"uint256"},{"internalType":"uint256","name":"_quantity","type":"uint256"},{"internalType":"uint256","name":"_maxPerAddress","type":"uint256"},{"internalType":"uint256","name":"_mintPrice","type":"uint256"},{"internalType":"uint256","name":"_collectorFee","type":"uint256"}],"name":"signatureMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"messageHash","type":"bytes32"},{"components":[{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"}],"internalType":"struct Signature","name":"signature","type":"tuple"}],"name":"verifySignature","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"withdrawRecipients","outputs":[{"internalType":"address","name":"recipientAddress","type":"address"},{"internalType":"uint256","name":"percentage","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b613c6880620000f46000396000f3fe6080604052600436106102515760003560e01c80636d2f923b11610139578063a22cb465116100b6578063c87b56dd1161007a578063c87b56dd14610667578063e06174e414610687578063e985e9c5146106ae578063eb20614e146106ce578063f103eaaf146106ee578063f2fde38b1461070557600080fd5b8063a22cb465146105f9578063aba8315014610619578063b88d4fde1461062e578063bc63f02e14610641578063bdf7a8e61461065457600080fd5b80637bddd65b116100fd5780637bddd65b14610573578063876171dc146105935780638da5cb5b146105b357806395d89b41146105d1578063a0712d68146105e657600080fd5b80636d2f923b146104de57806370a08231146104fe578063715018a61461051e5780637960c27f1461053357806379627fa11461055357600080fd5b8063397b5b24116101d2578063464a52de11610196578063464a52de1461043657806347442a3c146104565780634e07e2c8146104765780635d82cf6e146104895780636352211e146104a957806368bd580e146104c957600080fd5b8063397b5b24146103cf5780633ccfd60b146103e457806342842e0e146103f95780634307199e1461040c57806344e963a51461042157600080fd5b80632094750e116102195780632094750e1461031d57806323b872dd1461033d57806328e56c5e146103505780632a55205a146103705780632abff1f2146103af57600080fd5b806301ffc9a71461025657806306fdde031461028b578063081812fc146102ad578063095ea7b3146102e557806318160ddd146102fa575b600080fd5b34801561026257600080fd5b50610276610271366004612cba565b610725565b60405190151581526020015b60405180910390f35b34801561029757600080fd5b506102a0610745565b6040516102829190612d2e565b3480156102b957600080fd5b506102cd6102c8366004612d41565b6107e0565b6040516001600160a01b039091168152602001610282565b6102f86102f3366004612d6f565b61082d565b005b34801561030657600080fd5b5061030f610846565b604051908152602001610282565b34801561032957600080fd5b506102f8610338366004612eb4565b610865565b6102f861034b366004612f8b565b610bdb565b34801561035c57600080fd5b506102f861036b36600461300d565b610c06565b34801561037c57600080fd5b5061039061038b36600461304e565b610c81565b604080516001600160a01b039093168352602083019190915201610282565b3480156103bb57600080fd5b506102f86103ca36600461300d565b610d2f565b3480156103db57600080fd5b506102a0610d45565b3480156103f057600080fd5b506102f8610dd4565b6102f8610407366004612f8b565b610ed2565b34801561041857600080fd5b506102a0610ef7565b34801561042d57600080fd5b50610276610f8b565b34801561044257600080fd5b506102cd610451366004613082565b610fa7565b34801561046257600080fd5b506102f86104713660046130af565b61108d565b6102f8610484366004613128565b61115b565b34801561049557600080fd5b506102f86104a4366004612d41565b611361565b3480156104b557600080fd5b506102cd6104c4366004612d41565b61136f565b3480156104d557600080fd5b506102f861137a565b3480156104ea57600080fd5b506102a06104f9366004612d41565b6113b7565b34801561050a57600080fd5b5061030f610519366004613174565b6113db565b34801561052a57600080fd5b506102f8611443565b34801561053f57600080fd5b506102f861054e366004612d41565b611455565b34801561055f57600080fd5b506102f861056e366004613191565b611488565b34801561057f57600080fd5b506102f861058e366004612d41565b611525565b34801561059f57600080fd5b506103906105ae366004612d41565b611533565b3480156105bf57600080fd5b506033546001600160a01b03166102cd565b3480156105dd57600080fd5b506102a061156c565b6102f86105f4366004612d41565b611584565b34801561060557600080fd5b506102f86106143660046131ea565b6115a3565b34801561062557600080fd5b506102a06115b7565b6102f861063c366004613223565b6115c5565b6102f861064f3660046132a2565b6115f2565b6102f86106623660046132c7565b61160e565b34801561067357600080fd5b506102a0610682366004612d41565b611664565b34801561069357600080fd5b5061069c6116e4565b60405161028296959493929190613345565b3480156106ba57600080fd5b506102766106c9366004613384565b611799565b3480156106da57600080fd5b506102f86106e9366004612d41565b6117d6565b3480156106fa57600080fd5b5061030f6101035481565b34801561071157600080fd5b506102f8610720366004613174565b611809565b60006107308261187f565b8061073f575061073f826118cd565b92915050565b606061074f611902565b600201805461075d906133b2565b80601f0160208091040260200160405190810160405280929190818152602001828054610789906133b2565b80156107d65780601f106107ab576101008083540402835291602001916107d6565b820191906000526020600020905b8154815290600101906020018083116107b957829003601f168201915b5050505050905090565b60006107eb82611926565b610808576040516333d1c03960e21b815260040160405180910390fd5b610810611902565b60009283526006016020525060409020546001600160a01b031690565b8161083781611962565b6108418383611a1b565b505050565b600080610851611902565b6001015461085d611902565b540303919050565b600080516020613c1383398151915254610100900460ff1661089a57600080516020613c138339815191525460ff161561089e565b303b155b6109155760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a656400000000000000000060648201526084015b60405180910390fd5b600080516020613c1383398151915254610100900460ff1615801561095157600080516020613c13833981519152805461ffff19166101011790555b600054610100900460ff16158080156109715750600054600160ff909116105b8061098b5750303b15801561098b575060005460ff166001145b6109ee5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161090c565b6000805460ff191660011790558015610a11576000805461ff0019166101001790555b610a1b8989611a27565b610a23611a65565b86610106610a3182826134eb565b50610a4490506040840160208501613174565b61010280546001600160a01b0319166001600160a01b0392909216919091179055604083013561010355610a7b6020840184613174565b61010180546001600160a01b0319166001600160a01b039290921691909117905560a08301356101005560005b84811015610afd5761010c868683818110610ac557610ac5613584565b835460018101855560009485526020909420604090910292909201926002029091019050610af3828261359a565b5050600101610aa8565b50610b23610b0e6020880188613174565b610b1e6040890160208a016135d0565b611a94565b610b366107206080850160608601613174565b610b6b610b4960a0850160808601613174565b6000610b5b60a0870160808801613174565b6001600160a01b03161415611b91565b8015610bb1576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b508015610bd157600080516020613c13833981519152805461ff00191690555b5050505050505050565b826001600160a01b0381163314610bf557610bf533611962565b610c00848484611d30565b50505050565b610c0e611f23565b610105610c1c82848361342c565b506000610c27611f7d565b1115610c7d577f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c60006001610c5a611f7d565b610c64919061360f565b6040805192835260208301919091520160405180910390a15b5050565b60008281526098602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610cf65750604080518082019091526097546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610d15906001600160601b031687613622565b610d1f919061364f565b91519350909150505b9250929050565b610d37611f23565b610104610c1c82848361342c565b6101058054610d53906133b2565b80601f0160208091040260200160405190810160405280929190818152602001828054610d7f906133b2565b8015610dcc5780601f10610da157610100808354040283529160200191610dcc565b820191906000526020600020905b815481529060010190602001808311610daf57829003601f168201915b505050505081565b610ddc611f23565b610de4611f8f565b4780600080610dfb6033546001600160a01b031690565b61010c5490915015610eb55760005b61010c54811015610eb357600061010c8281548110610e2b57610e2b613584565b600091825260209091206002909102015461010c80546001600160a01b0390921692506127109184908110610e6257610e62613584565b906000526020600020906002020160010154612710610e81919061360f565b610e8b9087613622565b610e95919061364f565b9350610eaa81610ea5868861360f565b611fe8565b50600101610e0a565b505b479350610ec28185611fe8565b50505050610ed0600160c955565b565b826001600160a01b0381163314610eec57610eec33611962565b610c00848484612101565b6040516060906000602081805b60fd54811015610f4357600081815260fb60205260409020546001600160a01b031691506001823b039350836001848701843c91830191600101610f04565b50601f19601f830116840160405260208203845260ff610f628561211c565b604051602001610f739291906136f2565b60405160208183030381529060405294505050505090565b6101095460009015801590610fa257506101095442115b905090565b6000806040518060400160405280601c81526020017f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250905060008185604051602001610ff7929190613739565b60408051601f19818403018152918152815160208301209192506001908290611026906060890190890161375b565b604080516000815260208181018084529490945260ff909216908201528735606082015290870135608082015260a0016020604051602081039080840390855afa158015611078573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b61010a5460ff16156110b25760405163ea8e4eb560e01b815260040160405180910390fd5b6110ba611f23565b60fd85905560ff6110cc84868361342c565b5061110c82828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061212a92505050565b6000805260fb6020527fc88390e7e62175be0932452175b6a7222b6b094ab0ef984a5153c620345d897580546001600160a01b0319166001600160a01b03929092169190911790555050505050565b611163611f8f565b60408051602081018790526bffffffffffffffffffffffff1930606090811b8216938301939093523390921b9091166054820152606881018590526088810184905260a8810183905260c881018290524660e88201526000906101080160408051601f198184030181528282528051602091820120610101546305b7633d60e41b855292519094506001600160a01b03909216926000928492635b7633d092600480820193918290030181865afa158015611222573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611246919061377e565b9050806001600160a01b031661125c848b610fa7565b6001600160a01b0316146112835760405163ea8e4eb560e01b815260040160405180910390fd5b600034611290868861379b565b61129a908a613622565b14905060008715806112bf575087896112b23361216c565b6112bc919061379b565b11155b33600090815260fc6020526040812054919250908b1180156112ee575043610100548c6112ec919061379b565b115b90508215806112fb575081155b80611304575080155b156113225760405163b4fa3fb360e01b815260040160405180910390fd5b33600081815260fc60205260409020439055611349908b906113448a83613622565b6121b1565b505050505050611359600160c955565b505050505050565b611369611f23565b61010755565b600061073f82612269565b61010a5460ff161561139f5760405163ea8e4eb560e01b815260040160405180910390fd5b6113a7611f23565b61010a805460ff19166001179055565b600081815260fb602052604090205460609061073f906001600160a01b031661230e565b60006001600160a01b038216611404576040516323d3ad8160e21b815260040160405180910390fd5b6001600160401b03611414611902565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b61144b611f23565b610ed06000612358565b61010a5460ff161561147a5760405163ea8e4eb560e01b815260040160405180910390fd5b611482611f23565b61010855565b61010a5460ff16156114ad5760405163ea8e4eb560e01b815260040160405180910390fd5b6114b5611f23565b6114f482828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061212a92505050565b600093845260fb602052604090932080546001600160a01b0319166001600160a01b03909416939093179092555050565b61152d611f23565b61010655565b61010c818154811061154457600080fd5b6000918252602090912060029091020180546001909101546001600160a01b03909116915082565b6060611576611902565b600301805461075d906133b2565b61158c611f8f565b61159681336123aa565b6115a0600160c955565b50565b816115ad81611962565b6108418383612527565b6101048054610d53906133b2565b836001600160a01b03811633146115df576115df33611962565b6115eb858585856125a4565b5050505050565b6115fa611f8f565b61160482826123aa565b610c7d600160c955565b611616611f8f565b60005b81811015611659576116518484848481811061163757611637613584565b905060200201602081019061164c9190613174565b6123aa565b600101611619565b50610841600160c955565b606061166f82611926565b61168c5760405163b4fa3fb360e01b815260040160405180910390fd5b611694610745565b61169d836125e8565b61010b6116a861262c565b6116b0610745565b6116b9876125e8565b6040516020016116ce969594939291906137ae565b6040516020818303038152906040529050919050565b610106805461010754610108546101095461010a5461010b8054959694959394929360ff9092169291611716906133b2565b80601f0160208091040260200160405190810160405280929190818152602001828054611742906133b2565b801561178f5780601f106117645761010080835404028352916020019161178f565b820191906000526020600020905b81548152906001019060200180831161177257829003601f168201915b5050505050905086565b60006117a3611902565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b61010a5460ff16156117fb5760405163ea8e4eb560e01b815260040160405180910390fd5b611803611f23565b61010955565b611811611f23565b6001600160a01b0381166118765760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161090c565b6115a081612358565b60006301ffc9a760e01b6001600160e01b0319831614806118b057506380ac58cd60e01b6001600160e01b03198316145b8061073f5750506001600160e01b031916635b5e139f60e01b1490565b60006001600160e01b0319821663152a902d60e11b148061073f57506301ffc9a760e01b6001600160e01b031983161461073f565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b6000611930611902565b548210801561073f5750600160e01b611947611902565b60008481526004919091016020526040902054161592915050565b6daaeb6d7670e522a718067333cd4e3b156115a057604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156119cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f391906138f5565b6115a057604051633b79c77360e21b81526001600160a01b038216600482015260240161090c565b610c7d8282600161278a565b600080516020613c1383398151915254610100900460ff16611a5b5760405162461bcd60e51b815260040161090c90613912565b610c7d828261283f565b600054610100900460ff16611a8c5760405162461bcd60e51b815260040161090c90613966565b610ed06128b2565b6127106001600160601b0382161115611b025760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b606482015260840161090c565b6001600160a01b038216611b585760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c696420726563656976657200000000000000604482015260640161090c565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217609755565b600054610100900460ff16611bb85760405162461bcd60e51b815260040161090c90613966565b6daaeb6d7670e522a718067333cd4e3b15610c7d5760405163c3c5a54760e01b81523060048201526daaeb6d7670e522a718067333cd4e9063c3c5a547906024016020604051808303816000875af1158015611c18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3c91906138f5565b610c7d578015611cb057604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b158015611c9c57600080fd5b505af1158015611359573d6000803e3d6000fd5b6001600160a01b03821615611cff5760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af290390604401611c82565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401611c82565b6000611d3b82612269565b9050836001600160a01b0316816001600160a01b031614611d6e5760405162a1148160e81b815260040160405180910390fd5b600080611d7a846128e2565b91509150611d9f8187611d8a3390565b6001600160a01b039081169116811491141790565b611dca57611dad8633611799565b611dca57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516611df157604051633a954ecd60e21b815260040160405180910390fd5b8015611dfc57600082555b611e04611902565b6001600160a01b0387166000908152600591909101602052604090208054600019019055611e30611902565b6001600160a01b03861660008181526005929092016020526040909120805460010190554260a01b17600160e11b17611e67611902565b60008681526004919091016020526040812091909155600160e11b84169003611edd5760018401611e96611902565b600082815260049190910160205260408120549003611edb57611eb7611902565b548114611edb5783611ec7611902565b600083815260049190910160205260409020555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611359565b6033546001600160a01b03163314610ed05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161090c565b600080611f88611902565b5403919050565b600260c95403611fe15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161090c565b600260c955565b804710156120385760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161090c565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612085576040519150601f19603f3d011682016040523d82523d6000602084013e61208a565b606091505b50509050806108415760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161090c565b610841838383604051806020016040528060008152506115c5565b606061073f8260008061290a565b60008151600181018060401b6a61000080600a3d393df300178452600a8101601585016000f0925050816121665763301164256000526004601cfd5b90915290565b60006001600160401b036040612180611902565b6005016000856001600160a01b03166001600160a01b0316815260200190815260200160002054901c169050919050565b60018310806121cf575061010954158015906121cf57506101095442115b156121ed5760405163b4fa3fb360e01b815260040160405180910390fd5b33321461220d5760405163ea8e4eb560e01b815260040160405180910390fd5b600061221a60148561364f565b905060006122296014866139b1565b905060005b8281101561224957612241856014612a09565b60010161222e565b50801561225a5761225a8482612a09565b82156115eb576115eb83612b44565b6000612273611902565b600083815260049190910160205260408120549150600160e01b821690036122f557806000036122f0576122a5611902565b5482106122c557604051636f96cda160e11b815260040160405180910390fd5b6122cd611902565b6000199092016000818152600493909301602052604090922054905080156122c5575b919050565b604051636f96cda160e11b815260040160405180910390fd5b6060813b80612325576311052bb46000526004601cfd5b600181039050604051915061ffe0603f820116820160405280825260008160208401015280600160208401853c50919050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61010854600090158015906123c25750610108544210155b80156123db57506101095415806123db57506101095442105b90506123ef6033546001600160a01b031690565b6001600160a01b0316336001600160a01b03161415801561240e575080155b1561242c5760405163d9b9141960e01b815260040160405180910390fd5b60006124406033546001600160a01b031690565b6001600160a01b0316336001600160a01b03161461247b576101035461010754349161246b9161379b565b6124759086613622565b1461248d565b34610103548561248b9190613622565b145b6101065490915060009015806124b9575061010654856124ac8661216c565b6124b6919061379b565b11155b90506124cd6033546001600160a01b031690565b6001600160a01b0316336001600160a01b0316141580156124ec575080155b806124f5575081155b156125135760405163b4fa3fb360e01b815260040160405180910390fd5b6115eb858561010354886113449190613622565b80612530611902565b336000818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6125af848484610bdb565b6001600160a01b0383163b15610c00576125cb84848484612bb9565b610c00576040516368d2bf6b60e11b815260040160405180910390fd5b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a9004806126025750819003601f19909101908152919050565b6060600080610104805461263f906133b2565b90501190506000806101058054612655906133b2565b60fd54921092505015158280156126695750815b1561269c576101046101056040516020016126859291906139c5565b604051602081830303815290604052935050505090565b82156126f857610104816126bf57604051806020016040528060008152506126e7565b6126c7610ef7565b6040516020016126d79190613a14565b6040516020818303038152906040525b604051602001612685929190613a50565b811561275457806127185760405180602001604052806000815250612740565b612720610ef7565b6040516020016127309190613a89565b6040516020818303038152906040525b610105604051602001612685929190613abd565b801561277257612762610ef7565b6040516020016126859190613a89565b60405180602001604052806000815250935050505090565b60006127958361136f565b905081156127d457336001600160a01b038216146127d4576127b78133611799565b6127d4576040516367d9dca160e11b815260040160405180910390fd5b836127dd611902565b6000858152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551859287811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a450505050565b600080516020613c1383398151915254610100900460ff166128735760405162461bcd60e51b815260040161090c90613912565b8161287c611902565b6002019061288a9082613af9565b5080612894611902565b600301906128a29082613af9565b5060006128ad611902565b555050565b600054610100900460ff166128d95760405162461bcd60e51b815260040161090c90613966565b610ed033612358565b60008060006128ef611902565b60009485526006016020525050604090912080549092909150565b606083518015612a01576003600282010460021b60405192507f4142434445464748494a4b4c4d4e4f505152535455565758595a616263646566601f526102308515027f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392d5f03603f52602083018181015b6003880197508751603f8160121c16518353603f81600c1c16516001840153603f8160061c16516002840153603f81165160038401535060048201915080821061297a57600384068680156129da576001821482151501850387526129f2565b603d821515850353603d6001831460011b8503538487525b5050601f01601f191660405250505b509392505050565b6000612a13611902565b5490506000829003612a385760405163b562e8dd60e01b815260040160405180910390fd5b680100000000000000018202612a4c611902565b6001600160a01b038516600081815260059290920160205260409091208054929092019091554260a01b6001841460e11b1717612a87611902565b600083815260049190910160205260408120919091556001600160a01b0384169083830190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114612b1157808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101612ad9565b5081600003612b3257604051622e076360e81b815260040160405180910390fd5b80612b3b611902565b55506108419050565b610102546040516000916001600160a01b03169083908381818185875af1925050503d8060008114612b92576040519150601f19603f3d011682016040523d82523d6000602084013e612b97565b606091505b5050905080610c7d5760405163ea8e4eb560e01b815260040160405180910390fd5b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612bee903390899088908890600401613bb8565b6020604051808303816000875af1925050508015612c29575060408051601f3d908101601f19168201909252612c2691810190613bf5565b60015b612c87573d808015612c57576040519150601f19603f3d011682016040523d82523d6000602084013e612c5c565b606091505b508051600003612c7f576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6001600160e01b0319811681146115a057600080fd5b600060208284031215612ccc57600080fd5b8135612cd781612ca4565b9392505050565b60005b83811015612cf9578181015183820152602001612ce1565b50506000910152565b60008151808452612d1a816020860160208601612cde565b601f01601f19169290920160200192915050565b602081526000612cd76020830184612d02565b600060208284031215612d5357600080fd5b5035919050565b6001600160a01b03811681146115a057600080fd5b60008060408385031215612d8257600080fd5b8235612d8d81612d5a565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115612dcb57612dcb612d9b565b604051601f8501601f19908116603f01168101908282118183101715612df357612df3612d9b565b81604052809350858152868686011115612e0c57600080fd5b858560208301376000602087830101525050509392505050565b600082601f830112612e3757600080fd5b612cd783833560208501612db1565b600060c08284031215612e5857600080fd5b50919050565b600060408284031215612e5857600080fd5b60008083601f840112612e8257600080fd5b5081356001600160401b03811115612e9957600080fd5b6020830191508360208260061b8501011115610d2857600080fd5b6000806000806000806000610180888a031215612ed057600080fd5b87356001600160401b0380821115612ee757600080fd5b612ef38b838c01612e26565b985060208a0135915080821115612f0957600080fd5b612f158b838c01612e26565b975060408a0135915080821115612f2b57600080fd5b612f378b838c01612e46565b9650612f468b60608c01612e5e565b955060a08a0135915080821115612f5c57600080fd5b50612f698a828b01612e70565b9094509250612f7d90508960c08a01612e46565b905092959891949750929550565b600080600060608486031215612fa057600080fd5b8335612fab81612d5a565b92506020840135612fbb81612d5a565b929592945050506040919091013590565b60008083601f840112612fde57600080fd5b5081356001600160401b03811115612ff557600080fd5b602083019150836020828501011115610d2857600080fd5b6000806020838503121561302057600080fd5b82356001600160401b0381111561303657600080fd5b61304285828601612fcc565b90969095509350505050565b6000806040838503121561306157600080fd5b50508035926020909101359150565b600060608284031215612e5857600080fd5b6000806080838503121561309557600080fd5b823591506130a68460208501613070565b90509250929050565b6000806000806000606086880312156130c757600080fd5b8535945060208601356001600160401b03808211156130e557600080fd5b6130f189838a01612fcc565b9096509450604088013591508082111561310a57600080fd5b5061311788828901612fcc565b969995985093965092949392505050565b600080600080600080610100878903121561314257600080fd5b61314c8888613070565b986060880135985060808801359760a0810135975060c0810135965060e00135945092505050565b60006020828403121561318657600080fd5b8135612cd781612d5a565b6000806000604084860312156131a657600080fd5b8335925060208401356001600160401b038111156131c357600080fd5b6131cf86828701612fcc565b9497909650939450505050565b80151581146115a057600080fd5b600080604083850312156131fd57600080fd5b823561320881612d5a565b91506020830135613218816131dc565b809150509250929050565b6000806000806080858703121561323957600080fd5b843561324481612d5a565b9350602085013561325481612d5a565b92506040850135915060608501356001600160401b0381111561327657600080fd5b8501601f8101871361328757600080fd5b61329687823560208401612db1565b91505092959194509250565b600080604083850312156132b557600080fd5b82359150602083013561321881612d5a565b6000806000604084860312156132dc57600080fd5b8335925060208401356001600160401b03808211156132fa57600080fd5b818601915086601f83011261330e57600080fd5b81358181111561331d57600080fd5b8760208260051b850101111561333257600080fd5b6020830194508093505050509250925092565b868152856020820152846040820152836060820152821515608082015260c060a0820152600061337860c0830184612d02565b98975050505050505050565b6000806040838503121561339757600080fd5b82356133a281612d5a565b9150602083013561321881612d5a565b600181811c908216806133c657607f821691505b602082108103612e5857634e487b7160e01b600052602260045260246000fd5b601f82111561084157600081815260208120601f850160051c8101602086101561340d5750805b601f850160051c820191505b8181101561135957828155600101613419565b6001600160401b0383111561344357613443612d9b565b6134578361345183546133b2565b836133e6565b6000601f84116001811461348b57600085156134735750838201355b600019600387901b1c1916600186901b1783556115eb565b600083815260209020601f19861690835b828110156134bc578685013582556020948501946001909201910161349c565b50868210156134d95760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b8135815560208201356001820155604082013560028201556060820135600382015560048101608083013561351f816131dc565b815490151560ff1660ff199190911617905560a082013536839003601e1901811261354957600080fd5b820180356001600160401b0381111561356157600080fd5b60208201915080360382131561357657600080fd5b610c0081836005860161342c565b634e487b7160e01b600052603260045260246000fd5b81356135a581612d5a565b81546001600160a01b0319166001600160a01b03919091161781556020919091013560019190910155565b6000602082840312156135e257600080fd5b81356001600160601b0381168114612cd757600080fd5b634e487b7160e01b600052601160045260246000fd5b8181038181111561073f5761073f6135f9565b808202811582820484141761073f5761073f6135f9565b634e487b7160e01b600052601260045260246000fd5b60008261365e5761365e613639565b500490565b60008154613670816133b2565b60018281168015613688576001811461369d576136cc565b60ff19841687528215158302870194506136cc565b8560005260208060002060005b858110156136c35781548a8201529084019082016136aa565b50505082870194505b5050505092915050565b600081516136e8818560208601612cde565b9290920192915050565b643230ba309d60d91b8152600061370c6005830185613663565b670ed8985cd94d8d0b60c21b8152835161372d816008840160208801612cde565b01600801949350505050565b6000835161374b818460208801612cde565b9190910191825250602001919050565b60006020828403121561376d57600080fd5b813560ff81168114612cd757600080fd5b60006020828403121561379057600080fd5b8151612cd781612d5a565b8082018082111561073f5761073f6135f9565b7f646174613a6170706c69636174696f6e2f6a736f6e2c7b226e616d65223a22008152600087516137e681601f850160208c01612cde565b61202360f01b601f918401918201528751613808816021840160208c01612cde565b701116113232b9b1b934b83a34b7b7111d1160791b602192909101918201526138346032820188613663565b90508551613846818360208a01612cde565b8082019150507f222c2270726f70657274696573223a5b7b2274726169745f74797065223a226e81526d30b6b29116113b30b63ab2911d1160911b6020820152845161389981602e840160208901612cde565b7f227d2c7b2274726169745f74797065223a226e756d626572222c2276616c7565602e929091019182015261111d60f11b604e8201526138dc60508201856136d6565b627d5d7d60e81b81526003019998505050505050505050565b60006020828403121561390757600080fd5b8151612cd7816131dc565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000826139c0576139c0613639565b500690565b6a11161134b6b0b3b2911d1160a91b815260006139e5600b830185613663565b7211161130b734b6b0ba34b7b72fbab936111d1160691b8152613a0b6013820185613663565b95945050505050565b7211161130b734b6b0ba34b7b72fbab936111d1160691b81528151600090613a43816013850160208701612cde565b9190910160130192915050565b6a11161134b6b0b3b2911d1160a91b81526000613a70600b830185613663565b8351613a80818360208801612cde565b01949350505050565b6a11161134b6b0b3b2911d1160a91b81528151600090613ab081600b850160208701612cde565b91909101600b0192915050565b60008351613acf818460208801612cde565b7211161130b734b6b0ba34b7b72fbab936111d1160691b908301908152613a0b6013820185613663565b81516001600160401b03811115613b1257613b12612d9b565b613b2681613b2084546133b2565b846133e6565b602080601f831160018114613b5b5760008415613b435750858301515b600019600386901b1c1916600185901b178555611359565b600085815260208120601f198616915b82811015613b8a57888601518255948401946001909101908401613b6b565b5085821015613ba85787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613beb90830184612d02565b9695505050505050565b600060208284031215613c0757600080fd5b8151612cd781612ca456feee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa26469706673582212203dd7c0beb697531b1a5a65e418eac0bbf1d730882ba3845a14ac8c9b2bccb63064736f6c63430008110033
Deployed Bytecode
0x6080604052600436106102515760003560e01c80636d2f923b11610139578063a22cb465116100b6578063c87b56dd1161007a578063c87b56dd14610667578063e06174e414610687578063e985e9c5146106ae578063eb20614e146106ce578063f103eaaf146106ee578063f2fde38b1461070557600080fd5b8063a22cb465146105f9578063aba8315014610619578063b88d4fde1461062e578063bc63f02e14610641578063bdf7a8e61461065457600080fd5b80637bddd65b116100fd5780637bddd65b14610573578063876171dc146105935780638da5cb5b146105b357806395d89b41146105d1578063a0712d68146105e657600080fd5b80636d2f923b146104de57806370a08231146104fe578063715018a61461051e5780637960c27f1461053357806379627fa11461055357600080fd5b8063397b5b24116101d2578063464a52de11610196578063464a52de1461043657806347442a3c146104565780634e07e2c8146104765780635d82cf6e146104895780636352211e146104a957806368bd580e146104c957600080fd5b8063397b5b24146103cf5780633ccfd60b146103e457806342842e0e146103f95780634307199e1461040c57806344e963a51461042157600080fd5b80632094750e116102195780632094750e1461031d57806323b872dd1461033d57806328e56c5e146103505780632a55205a146103705780632abff1f2146103af57600080fd5b806301ffc9a71461025657806306fdde031461028b578063081812fc146102ad578063095ea7b3146102e557806318160ddd146102fa575b600080fd5b34801561026257600080fd5b50610276610271366004612cba565b610725565b60405190151581526020015b60405180910390f35b34801561029757600080fd5b506102a0610745565b6040516102829190612d2e565b3480156102b957600080fd5b506102cd6102c8366004612d41565b6107e0565b6040516001600160a01b039091168152602001610282565b6102f86102f3366004612d6f565b61082d565b005b34801561030657600080fd5b5061030f610846565b604051908152602001610282565b34801561032957600080fd5b506102f8610338366004612eb4565b610865565b6102f861034b366004612f8b565b610bdb565b34801561035c57600080fd5b506102f861036b36600461300d565b610c06565b34801561037c57600080fd5b5061039061038b36600461304e565b610c81565b604080516001600160a01b039093168352602083019190915201610282565b3480156103bb57600080fd5b506102f86103ca36600461300d565b610d2f565b3480156103db57600080fd5b506102a0610d45565b3480156103f057600080fd5b506102f8610dd4565b6102f8610407366004612f8b565b610ed2565b34801561041857600080fd5b506102a0610ef7565b34801561042d57600080fd5b50610276610f8b565b34801561044257600080fd5b506102cd610451366004613082565b610fa7565b34801561046257600080fd5b506102f86104713660046130af565b61108d565b6102f8610484366004613128565b61115b565b34801561049557600080fd5b506102f86104a4366004612d41565b611361565b3480156104b557600080fd5b506102cd6104c4366004612d41565b61136f565b3480156104d557600080fd5b506102f861137a565b3480156104ea57600080fd5b506102a06104f9366004612d41565b6113b7565b34801561050a57600080fd5b5061030f610519366004613174565b6113db565b34801561052a57600080fd5b506102f8611443565b34801561053f57600080fd5b506102f861054e366004612d41565b611455565b34801561055f57600080fd5b506102f861056e366004613191565b611488565b34801561057f57600080fd5b506102f861058e366004612d41565b611525565b34801561059f57600080fd5b506103906105ae366004612d41565b611533565b3480156105bf57600080fd5b506033546001600160a01b03166102cd565b3480156105dd57600080fd5b506102a061156c565b6102f86105f4366004612d41565b611584565b34801561060557600080fd5b506102f86106143660046131ea565b6115a3565b34801561062557600080fd5b506102a06115b7565b6102f861063c366004613223565b6115c5565b6102f861064f3660046132a2565b6115f2565b6102f86106623660046132c7565b61160e565b34801561067357600080fd5b506102a0610682366004612d41565b611664565b34801561069357600080fd5b5061069c6116e4565b60405161028296959493929190613345565b3480156106ba57600080fd5b506102766106c9366004613384565b611799565b3480156106da57600080fd5b506102f86106e9366004612d41565b6117d6565b3480156106fa57600080fd5b5061030f6101035481565b34801561071157600080fd5b506102f8610720366004613174565b611809565b60006107308261187f565b8061073f575061073f826118cd565b92915050565b606061074f611902565b600201805461075d906133b2565b80601f0160208091040260200160405190810160405280929190818152602001828054610789906133b2565b80156107d65780601f106107ab576101008083540402835291602001916107d6565b820191906000526020600020905b8154815290600101906020018083116107b957829003601f168201915b5050505050905090565b60006107eb82611926565b610808576040516333d1c03960e21b815260040160405180910390fd5b610810611902565b60009283526006016020525060409020546001600160a01b031690565b8161083781611962565b6108418383611a1b565b505050565b600080610851611902565b6001015461085d611902565b540303919050565b600080516020613c1383398151915254610100900460ff1661089a57600080516020613c138339815191525460ff161561089e565b303b155b6109155760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a656400000000000000000060648201526084015b60405180910390fd5b600080516020613c1383398151915254610100900460ff1615801561095157600080516020613c13833981519152805461ffff19166101011790555b600054610100900460ff16158080156109715750600054600160ff909116105b8061098b5750303b15801561098b575060005460ff166001145b6109ee5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161090c565b6000805460ff191660011790558015610a11576000805461ff0019166101001790555b610a1b8989611a27565b610a23611a65565b86610106610a3182826134eb565b50610a4490506040840160208501613174565b61010280546001600160a01b0319166001600160a01b0392909216919091179055604083013561010355610a7b6020840184613174565b61010180546001600160a01b0319166001600160a01b039290921691909117905560a08301356101005560005b84811015610afd5761010c868683818110610ac557610ac5613584565b835460018101855560009485526020909420604090910292909201926002029091019050610af3828261359a565b5050600101610aa8565b50610b23610b0e6020880188613174565b610b1e6040890160208a016135d0565b611a94565b610b366107206080850160608601613174565b610b6b610b4960a0850160808601613174565b6000610b5b60a0870160808801613174565b6001600160a01b03161415611b91565b8015610bb1576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b508015610bd157600080516020613c13833981519152805461ff00191690555b5050505050505050565b826001600160a01b0381163314610bf557610bf533611962565b610c00848484611d30565b50505050565b610c0e611f23565b610105610c1c82848361342c565b506000610c27611f7d565b1115610c7d577f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c60006001610c5a611f7d565b610c64919061360f565b6040805192835260208301919091520160405180910390a15b5050565b60008281526098602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610cf65750604080518082019091526097546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610d15906001600160601b031687613622565b610d1f919061364f565b91519350909150505b9250929050565b610d37611f23565b610104610c1c82848361342c565b6101058054610d53906133b2565b80601f0160208091040260200160405190810160405280929190818152602001828054610d7f906133b2565b8015610dcc5780601f10610da157610100808354040283529160200191610dcc565b820191906000526020600020905b815481529060010190602001808311610daf57829003601f168201915b505050505081565b610ddc611f23565b610de4611f8f565b4780600080610dfb6033546001600160a01b031690565b61010c5490915015610eb55760005b61010c54811015610eb357600061010c8281548110610e2b57610e2b613584565b600091825260209091206002909102015461010c80546001600160a01b0390921692506127109184908110610e6257610e62613584565b906000526020600020906002020160010154612710610e81919061360f565b610e8b9087613622565b610e95919061364f565b9350610eaa81610ea5868861360f565b611fe8565b50600101610e0a565b505b479350610ec28185611fe8565b50505050610ed0600160c955565b565b826001600160a01b0381163314610eec57610eec33611962565b610c00848484612101565b6040516060906000602081805b60fd54811015610f4357600081815260fb60205260409020546001600160a01b031691506001823b039350836001848701843c91830191600101610f04565b50601f19601f830116840160405260208203845260ff610f628561211c565b604051602001610f739291906136f2565b60405160208183030381529060405294505050505090565b6101095460009015801590610fa257506101095442115b905090565b6000806040518060400160405280601c81526020017f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250905060008185604051602001610ff7929190613739565b60408051601f19818403018152918152815160208301209192506001908290611026906060890190890161375b565b604080516000815260208181018084529490945260ff909216908201528735606082015290870135608082015260a0016020604051602081039080840390855afa158015611078573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b61010a5460ff16156110b25760405163ea8e4eb560e01b815260040160405180910390fd5b6110ba611f23565b60fd85905560ff6110cc84868361342c565b5061110c82828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061212a92505050565b6000805260fb6020527fc88390e7e62175be0932452175b6a7222b6b094ab0ef984a5153c620345d897580546001600160a01b0319166001600160a01b03929092169190911790555050505050565b611163611f8f565b60408051602081018790526bffffffffffffffffffffffff1930606090811b8216938301939093523390921b9091166054820152606881018590526088810184905260a8810183905260c881018290524660e88201526000906101080160408051601f198184030181528282528051602091820120610101546305b7633d60e41b855292519094506001600160a01b03909216926000928492635b7633d092600480820193918290030181865afa158015611222573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611246919061377e565b9050806001600160a01b031661125c848b610fa7565b6001600160a01b0316146112835760405163ea8e4eb560e01b815260040160405180910390fd5b600034611290868861379b565b61129a908a613622565b14905060008715806112bf575087896112b23361216c565b6112bc919061379b565b11155b33600090815260fc6020526040812054919250908b1180156112ee575043610100548c6112ec919061379b565b115b90508215806112fb575081155b80611304575080155b156113225760405163b4fa3fb360e01b815260040160405180910390fd5b33600081815260fc60205260409020439055611349908b906113448a83613622565b6121b1565b505050505050611359600160c955565b505050505050565b611369611f23565b61010755565b600061073f82612269565b61010a5460ff161561139f5760405163ea8e4eb560e01b815260040160405180910390fd5b6113a7611f23565b61010a805460ff19166001179055565b600081815260fb602052604090205460609061073f906001600160a01b031661230e565b60006001600160a01b038216611404576040516323d3ad8160e21b815260040160405180910390fd5b6001600160401b03611414611902565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b61144b611f23565b610ed06000612358565b61010a5460ff161561147a5760405163ea8e4eb560e01b815260040160405180910390fd5b611482611f23565b61010855565b61010a5460ff16156114ad5760405163ea8e4eb560e01b815260040160405180910390fd5b6114b5611f23565b6114f482828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061212a92505050565b600093845260fb602052604090932080546001600160a01b0319166001600160a01b03909416939093179092555050565b61152d611f23565b61010655565b61010c818154811061154457600080fd5b6000918252602090912060029091020180546001909101546001600160a01b03909116915082565b6060611576611902565b600301805461075d906133b2565b61158c611f8f565b61159681336123aa565b6115a0600160c955565b50565b816115ad81611962565b6108418383612527565b6101048054610d53906133b2565b836001600160a01b03811633146115df576115df33611962565b6115eb858585856125a4565b5050505050565b6115fa611f8f565b61160482826123aa565b610c7d600160c955565b611616611f8f565b60005b81811015611659576116518484848481811061163757611637613584565b905060200201602081019061164c9190613174565b6123aa565b600101611619565b50610841600160c955565b606061166f82611926565b61168c5760405163b4fa3fb360e01b815260040160405180910390fd5b611694610745565b61169d836125e8565b61010b6116a861262c565b6116b0610745565b6116b9876125e8565b6040516020016116ce969594939291906137ae565b6040516020818303038152906040529050919050565b610106805461010754610108546101095461010a5461010b8054959694959394929360ff9092169291611716906133b2565b80601f0160208091040260200160405190810160405280929190818152602001828054611742906133b2565b801561178f5780601f106117645761010080835404028352916020019161178f565b820191906000526020600020905b81548152906001019060200180831161177257829003601f168201915b5050505050905086565b60006117a3611902565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b61010a5460ff16156117fb5760405163ea8e4eb560e01b815260040160405180910390fd5b611803611f23565b61010955565b611811611f23565b6001600160a01b0381166118765760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161090c565b6115a081612358565b60006301ffc9a760e01b6001600160e01b0319831614806118b057506380ac58cd60e01b6001600160e01b03198316145b8061073f5750506001600160e01b031916635b5e139f60e01b1490565b60006001600160e01b0319821663152a902d60e11b148061073f57506301ffc9a760e01b6001600160e01b031983161461073f565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b6000611930611902565b548210801561073f5750600160e01b611947611902565b60008481526004919091016020526040902054161592915050565b6daaeb6d7670e522a718067333cd4e3b156115a057604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156119cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f391906138f5565b6115a057604051633b79c77360e21b81526001600160a01b038216600482015260240161090c565b610c7d8282600161278a565b600080516020613c1383398151915254610100900460ff16611a5b5760405162461bcd60e51b815260040161090c90613912565b610c7d828261283f565b600054610100900460ff16611a8c5760405162461bcd60e51b815260040161090c90613966565b610ed06128b2565b6127106001600160601b0382161115611b025760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b606482015260840161090c565b6001600160a01b038216611b585760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c696420726563656976657200000000000000604482015260640161090c565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217609755565b600054610100900460ff16611bb85760405162461bcd60e51b815260040161090c90613966565b6daaeb6d7670e522a718067333cd4e3b15610c7d5760405163c3c5a54760e01b81523060048201526daaeb6d7670e522a718067333cd4e9063c3c5a547906024016020604051808303816000875af1158015611c18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3c91906138f5565b610c7d578015611cb057604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b158015611c9c57600080fd5b505af1158015611359573d6000803e3d6000fd5b6001600160a01b03821615611cff5760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af290390604401611c82565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401611c82565b6000611d3b82612269565b9050836001600160a01b0316816001600160a01b031614611d6e5760405162a1148160e81b815260040160405180910390fd5b600080611d7a846128e2565b91509150611d9f8187611d8a3390565b6001600160a01b039081169116811491141790565b611dca57611dad8633611799565b611dca57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516611df157604051633a954ecd60e21b815260040160405180910390fd5b8015611dfc57600082555b611e04611902565b6001600160a01b0387166000908152600591909101602052604090208054600019019055611e30611902565b6001600160a01b03861660008181526005929092016020526040909120805460010190554260a01b17600160e11b17611e67611902565b60008681526004919091016020526040812091909155600160e11b84169003611edd5760018401611e96611902565b600082815260049190910160205260408120549003611edb57611eb7611902565b548114611edb5783611ec7611902565b600083815260049190910160205260409020555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611359565b6033546001600160a01b03163314610ed05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161090c565b600080611f88611902565b5403919050565b600260c95403611fe15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161090c565b600260c955565b804710156120385760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161090c565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612085576040519150601f19603f3d011682016040523d82523d6000602084013e61208a565b606091505b50509050806108415760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161090c565b610841838383604051806020016040528060008152506115c5565b606061073f8260008061290a565b60008151600181018060401b6a61000080600a3d393df300178452600a8101601585016000f0925050816121665763301164256000526004601cfd5b90915290565b60006001600160401b036040612180611902565b6005016000856001600160a01b03166001600160a01b0316815260200190815260200160002054901c169050919050565b60018310806121cf575061010954158015906121cf57506101095442115b156121ed5760405163b4fa3fb360e01b815260040160405180910390fd5b33321461220d5760405163ea8e4eb560e01b815260040160405180910390fd5b600061221a60148561364f565b905060006122296014866139b1565b905060005b8281101561224957612241856014612a09565b60010161222e565b50801561225a5761225a8482612a09565b82156115eb576115eb83612b44565b6000612273611902565b600083815260049190910160205260408120549150600160e01b821690036122f557806000036122f0576122a5611902565b5482106122c557604051636f96cda160e11b815260040160405180910390fd5b6122cd611902565b6000199092016000818152600493909301602052604090922054905080156122c5575b919050565b604051636f96cda160e11b815260040160405180910390fd5b6060813b80612325576311052bb46000526004601cfd5b600181039050604051915061ffe0603f820116820160405280825260008160208401015280600160208401853c50919050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61010854600090158015906123c25750610108544210155b80156123db57506101095415806123db57506101095442105b90506123ef6033546001600160a01b031690565b6001600160a01b0316336001600160a01b03161415801561240e575080155b1561242c5760405163d9b9141960e01b815260040160405180910390fd5b60006124406033546001600160a01b031690565b6001600160a01b0316336001600160a01b03161461247b576101035461010754349161246b9161379b565b6124759086613622565b1461248d565b34610103548561248b9190613622565b145b6101065490915060009015806124b9575061010654856124ac8661216c565b6124b6919061379b565b11155b90506124cd6033546001600160a01b031690565b6001600160a01b0316336001600160a01b0316141580156124ec575080155b806124f5575081155b156125135760405163b4fa3fb360e01b815260040160405180910390fd5b6115eb858561010354886113449190613622565b80612530611902565b336000818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6125af848484610bdb565b6001600160a01b0383163b15610c00576125cb84848484612bb9565b610c00576040516368d2bf6b60e11b815260040160405180910390fd5b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a9004806126025750819003601f19909101908152919050565b6060600080610104805461263f906133b2565b90501190506000806101058054612655906133b2565b60fd54921092505015158280156126695750815b1561269c576101046101056040516020016126859291906139c5565b604051602081830303815290604052935050505090565b82156126f857610104816126bf57604051806020016040528060008152506126e7565b6126c7610ef7565b6040516020016126d79190613a14565b6040516020818303038152906040525b604051602001612685929190613a50565b811561275457806127185760405180602001604052806000815250612740565b612720610ef7565b6040516020016127309190613a89565b6040516020818303038152906040525b610105604051602001612685929190613abd565b801561277257612762610ef7565b6040516020016126859190613a89565b60405180602001604052806000815250935050505090565b60006127958361136f565b905081156127d457336001600160a01b038216146127d4576127b78133611799565b6127d4576040516367d9dca160e11b815260040160405180910390fd5b836127dd611902565b6000858152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551859287811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a450505050565b600080516020613c1383398151915254610100900460ff166128735760405162461bcd60e51b815260040161090c90613912565b8161287c611902565b6002019061288a9082613af9565b5080612894611902565b600301906128a29082613af9565b5060006128ad611902565b555050565b600054610100900460ff166128d95760405162461bcd60e51b815260040161090c90613966565b610ed033612358565b60008060006128ef611902565b60009485526006016020525050604090912080549092909150565b606083518015612a01576003600282010460021b60405192507f4142434445464748494a4b4c4d4e4f505152535455565758595a616263646566601f526102308515027f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392d5f03603f52602083018181015b6003880197508751603f8160121c16518353603f81600c1c16516001840153603f8160061c16516002840153603f81165160038401535060048201915080821061297a57600384068680156129da576001821482151501850387526129f2565b603d821515850353603d6001831460011b8503538487525b5050601f01601f191660405250505b509392505050565b6000612a13611902565b5490506000829003612a385760405163b562e8dd60e01b815260040160405180910390fd5b680100000000000000018202612a4c611902565b6001600160a01b038516600081815260059290920160205260409091208054929092019091554260a01b6001841460e11b1717612a87611902565b600083815260049190910160205260408120919091556001600160a01b0384169083830190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b818114612b1157808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101612ad9565b5081600003612b3257604051622e076360e81b815260040160405180910390fd5b80612b3b611902565b55506108419050565b610102546040516000916001600160a01b03169083908381818185875af1925050503d8060008114612b92576040519150601f19603f3d011682016040523d82523d6000602084013e612b97565b606091505b5050905080610c7d5760405163ea8e4eb560e01b815260040160405180910390fd5b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612bee903390899088908890600401613bb8565b6020604051808303816000875af1925050508015612c29575060408051601f3d908101601f19168201909252612c2691810190613bf5565b60015b612c87573d808015612c57576040519150601f19603f3d011682016040523d82523d6000602084013e612c5c565b606091505b508051600003612c7f576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6001600160e01b0319811681146115a057600080fd5b600060208284031215612ccc57600080fd5b8135612cd781612ca4565b9392505050565b60005b83811015612cf9578181015183820152602001612ce1565b50506000910152565b60008151808452612d1a816020860160208601612cde565b601f01601f19169290920160200192915050565b602081526000612cd76020830184612d02565b600060208284031215612d5357600080fd5b5035919050565b6001600160a01b03811681146115a057600080fd5b60008060408385031215612d8257600080fd5b8235612d8d81612d5a565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115612dcb57612dcb612d9b565b604051601f8501601f19908116603f01168101908282118183101715612df357612df3612d9b565b81604052809350858152868686011115612e0c57600080fd5b858560208301376000602087830101525050509392505050565b600082601f830112612e3757600080fd5b612cd783833560208501612db1565b600060c08284031215612e5857600080fd5b50919050565b600060408284031215612e5857600080fd5b60008083601f840112612e8257600080fd5b5081356001600160401b03811115612e9957600080fd5b6020830191508360208260061b8501011115610d2857600080fd5b6000806000806000806000610180888a031215612ed057600080fd5b87356001600160401b0380821115612ee757600080fd5b612ef38b838c01612e26565b985060208a0135915080821115612f0957600080fd5b612f158b838c01612e26565b975060408a0135915080821115612f2b57600080fd5b612f378b838c01612e46565b9650612f468b60608c01612e5e565b955060a08a0135915080821115612f5c57600080fd5b50612f698a828b01612e70565b9094509250612f7d90508960c08a01612e46565b905092959891949750929550565b600080600060608486031215612fa057600080fd5b8335612fab81612d5a565b92506020840135612fbb81612d5a565b929592945050506040919091013590565b60008083601f840112612fde57600080fd5b5081356001600160401b03811115612ff557600080fd5b602083019150836020828501011115610d2857600080fd5b6000806020838503121561302057600080fd5b82356001600160401b0381111561303657600080fd5b61304285828601612fcc565b90969095509350505050565b6000806040838503121561306157600080fd5b50508035926020909101359150565b600060608284031215612e5857600080fd5b6000806080838503121561309557600080fd5b823591506130a68460208501613070565b90509250929050565b6000806000806000606086880312156130c757600080fd5b8535945060208601356001600160401b03808211156130e557600080fd5b6130f189838a01612fcc565b9096509450604088013591508082111561310a57600080fd5b5061311788828901612fcc565b969995985093965092949392505050565b600080600080600080610100878903121561314257600080fd5b61314c8888613070565b986060880135985060808801359760a0810135975060c0810135965060e00135945092505050565b60006020828403121561318657600080fd5b8135612cd781612d5a565b6000806000604084860312156131a657600080fd5b8335925060208401356001600160401b038111156131c357600080fd5b6131cf86828701612fcc565b9497909650939450505050565b80151581146115a057600080fd5b600080604083850312156131fd57600080fd5b823561320881612d5a565b91506020830135613218816131dc565b809150509250929050565b6000806000806080858703121561323957600080fd5b843561324481612d5a565b9350602085013561325481612d5a565b92506040850135915060608501356001600160401b0381111561327657600080fd5b8501601f8101871361328757600080fd5b61329687823560208401612db1565b91505092959194509250565b600080604083850312156132b557600080fd5b82359150602083013561321881612d5a565b6000806000604084860312156132dc57600080fd5b8335925060208401356001600160401b03808211156132fa57600080fd5b818601915086601f83011261330e57600080fd5b81358181111561331d57600080fd5b8760208260051b850101111561333257600080fd5b6020830194508093505050509250925092565b868152856020820152846040820152836060820152821515608082015260c060a0820152600061337860c0830184612d02565b98975050505050505050565b6000806040838503121561339757600080fd5b82356133a281612d5a565b9150602083013561321881612d5a565b600181811c908216806133c657607f821691505b602082108103612e5857634e487b7160e01b600052602260045260246000fd5b601f82111561084157600081815260208120601f850160051c8101602086101561340d5750805b601f850160051c820191505b8181101561135957828155600101613419565b6001600160401b0383111561344357613443612d9b565b6134578361345183546133b2565b836133e6565b6000601f84116001811461348b57600085156134735750838201355b600019600387901b1c1916600186901b1783556115eb565b600083815260209020601f19861690835b828110156134bc578685013582556020948501946001909201910161349c565b50868210156134d95760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b8135815560208201356001820155604082013560028201556060820135600382015560048101608083013561351f816131dc565b815490151560ff1660ff199190911617905560a082013536839003601e1901811261354957600080fd5b820180356001600160401b0381111561356157600080fd5b60208201915080360382131561357657600080fd5b610c0081836005860161342c565b634e487b7160e01b600052603260045260246000fd5b81356135a581612d5a565b81546001600160a01b0319166001600160a01b03919091161781556020919091013560019190910155565b6000602082840312156135e257600080fd5b81356001600160601b0381168114612cd757600080fd5b634e487b7160e01b600052601160045260246000fd5b8181038181111561073f5761073f6135f9565b808202811582820484141761073f5761073f6135f9565b634e487b7160e01b600052601260045260246000fd5b60008261365e5761365e613639565b500490565b60008154613670816133b2565b60018281168015613688576001811461369d576136cc565b60ff19841687528215158302870194506136cc565b8560005260208060002060005b858110156136c35781548a8201529084019082016136aa565b50505082870194505b5050505092915050565b600081516136e8818560208601612cde565b9290920192915050565b643230ba309d60d91b8152600061370c6005830185613663565b670ed8985cd94d8d0b60c21b8152835161372d816008840160208801612cde565b01600801949350505050565b6000835161374b818460208801612cde565b9190910191825250602001919050565b60006020828403121561376d57600080fd5b813560ff81168114612cd757600080fd5b60006020828403121561379057600080fd5b8151612cd781612d5a565b8082018082111561073f5761073f6135f9565b7f646174613a6170706c69636174696f6e2f6a736f6e2c7b226e616d65223a22008152600087516137e681601f850160208c01612cde565b61202360f01b601f918401918201528751613808816021840160208c01612cde565b701116113232b9b1b934b83a34b7b7111d1160791b602192909101918201526138346032820188613663565b90508551613846818360208a01612cde565b8082019150507f222c2270726f70657274696573223a5b7b2274726169745f74797065223a226e81526d30b6b29116113b30b63ab2911d1160911b6020820152845161389981602e840160208901612cde565b7f227d2c7b2274726169745f74797065223a226e756d626572222c2276616c7565602e929091019182015261111d60f11b604e8201526138dc60508201856136d6565b627d5d7d60e81b81526003019998505050505050505050565b60006020828403121561390757600080fd5b8151612cd7816131dc565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000826139c0576139c0613639565b500690565b6a11161134b6b0b3b2911d1160a91b815260006139e5600b830185613663565b7211161130b734b6b0ba34b7b72fbab936111d1160691b8152613a0b6013820185613663565b95945050505050565b7211161130b734b6b0ba34b7b72fbab936111d1160691b81528151600090613a43816013850160208701612cde565b9190910160130192915050565b6a11161134b6b0b3b2911d1160a91b81526000613a70600b830185613663565b8351613a80818360208801612cde565b01949350505050565b6a11161134b6b0b3b2911d1160a91b81528151600090613ab081600b850160208701612cde565b91909101600b0192915050565b60008351613acf818460208801612cde565b7211161130b734b6b0ba34b7b72fbab936111d1160691b908301908152613a0b6013820185613663565b81516001600160401b03811115613b1257613b12612d9b565b613b2681613b2084546133b2565b846133e6565b602080601f831160018114613b5b5760008415613b435750858301515b600019600386901b1c1916600185901b178555611359565b600085815260208120601f198616915b82811015613b8a57888601518255948401946001909101908401613b6b565b5085821015613ba85787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613beb90830184612d02565b9695505050505050565b600060208284031215613c0757600080fd5b8151612cd781612ca456feee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa26469706673582212203dd7c0beb697531b1a5a65e418eac0bbf1d730882ba3845a14ac8c9b2bccb63064736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.