Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
Jirasan
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
No with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {ERC2981Upgradeable} from "@openzeppelin/contracts-upgradeable/token/common/ERC2981Upgradeable.sol";
import {OperatorFilterer} from "closedsea/src/OperatorFilterer.sol";
import {IERC721AUpgradeable, ERC721AUpgradeable} from "erc721a-upgradeable/contracts/ERC721AUpgradeable.sol";
import {ERC721AQueryableUpgradeable} from "erc721a-upgradeable/contracts/extensions/ERC721AQueryableUpgradeable.sol";
import {ERC721ABurnableUpgradeable} from "erc721a-upgradeable/contracts/extensions/ERC721ABurnableUpgradeable.sol";
import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract Jirasan is
ERC721AQueryableUpgradeable,
ERC721ABurnableUpgradeable,
ERC2981Upgradeable,
OperatorFilterer,
OwnableUpgradeable,
ReentrancyGuardUpgradeable,
IERC721Receiver
{
using ECDSA for bytes32;
/// @notice Base uri
string public currentBaseURI;
/// @dev Treasury
address public treasury;
/// @dev Trusted signer
address public trustedSigner;
/// @notice Maximum supply for the collection
uint256 public maxSupply;
/// @notice Live timestamp
uint256 public liveAt;
/// @notice Expires timestamp
uint256 public expiresAt;
/// @notice Swap paused
bool public isSwapPaused;
/// @notice Operator filter toggle switch
bool private operatorFilteringEnabled;
/// @notice Set soulbound state of pre-sale nfts
bool public isSoulboundActive;
/// @notice An mapping from address to claim
mapping(address => bool) public claimed;
/// @notice An mapping from token id to lock status
mapping(uint256 => bool) public soulbound;
/// @dev Reverts if claim is not active
error CLAIM_NOT_LIVE();
/// @dev Reverts if trying to send out a soulbound NFT
error SOUL_BOUND();
/// @dev Reverts if trying to swap a token you don't own
error NOT_OWNER();
/// @dev Reverts if claim already happened for a particular wallet address
error ALREADY_CLAIMED();
/// @dev Reverts if trying to swap for a token not in the pool
error NOT_IN_POOL();
/// @dev Reverts if swap is not active
error SWAP_NOT_LIVE();
/// @dev Reverts if signature is invalid
error INVALID_SIGNATURE();
event PoolSwap(address indexed swapper, uint256 inTokenId, uint256 outTokenId);
event Claimed(address indexed claimer, address indexed recipient, uint256 amount, uint256 presale, address[] wallets, uint256 startTokenId, uint256 endTokenId);
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
function initialize(
string memory currentBaseURI_
) public initializer initializerERC721A {
__ERC721A_init("Jirasan", "JIRASAN");
__Ownable_init(msg.sender);
__ERC2981_init();
// Setup filter registry
_registerForOperatorFiltering();
operatorFilteringEnabled = true;
// Setup royalties to 5% (default denominator is 10000)
_setDefaultRoyalty(msg.sender, 500);
// Set metadata
currentBaseURI = currentBaseURI_;
// Set treasury
treasury = payable(msg.sender);
// Set other contract configurations
maxSupply = 10001; // (n-1)
liveAt = 1721707200;
expiresAt = 1755277766;
isSoulboundActive = true; // soulbound by default
trustedSigner = msg.sender;
isSwapPaused = true; // Initially paused
}
function _startTokenId() internal view virtual override returns (uint256) {
return 1;
}
function _isValidSignature(
address _recipient,
uint256 _amount,
uint256 _presale,
address[] calldata _wallets,
bytes memory _signature
)
internal
view
returns (bool)
{
bytes32 messageHash = keccak256(abi.encodePacked(_recipient, _amount, _presale, abi.encode(_wallets)));
bytes32 prefixedHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", messageHash));
address recoveredSigner = ECDSA.recover(prefixedHash, _signature);
return recoveredSigner == trustedSigner;
}
/**
* @notice Jirasan Claim w/ signature, handles multiple wallet claiming and pre-sale use case
*
* @param _recipient The address to mint the tokens to
* @param _amount The number of tokens to claim
* @param _presale The number of tokens to claim
* @param _wallets The wallet addresses the signature is covering
* @param _signature The signature for the claim
*/
function claim(
address _recipient,
uint256 _amount,
uint256 _presale,
address[] calldata _wallets,
bytes calldata _signature
) external nonReentrant {
if(!isLive()) revert CLAIM_NOT_LIVE();
if (!_isValidSignature(_recipient, _amount, _presale, _wallets, _signature)) revert INVALID_SIGNATURE();
// Process flipping claimed wallets
for(uint256 i = 0; i < _wallets.length; i++){
if(claimed[_wallets[i]]) revert ALREADY_CLAIMED();
claimed[_wallets[i]] = true;
}
uint256 startTokenId = _nextTokenId();
// Process mints
_mint(_recipient, _amount + _presale);
// Process pre-sale token id locking (assumes that the last `presale` amount tokens is locked)
for (uint256 j = 0; j < _presale; j++) {
soulbound[_totalMinted() - j] = true;
}
// Leverage set of claimed wallets and pre-sale amount for the metadata derivation
emit Claimed(msg.sender, _recipient, _amount, _presale, _wallets, startTokenId, startTokenId + _amount + _presale);
}
/**
* @dev Jirasan Swap
* @param _fromTokenId The incoming token id
* @param _outTokenId The outgoing token id
*/
function swap(uint256 _fromTokenId, uint256 _outTokenId) external {
if(isSwapPaused) revert SWAP_NOT_LIVE();
// Check that the new tokenId is owned by the swap contract
if (ownerOf(_outTokenId) != address(this)) revert NOT_IN_POOL();
// Check that the tokenId is owned by the caller
if (ownerOf(_fromTokenId) != _msgSenderERC721A()) revert NOT_OWNER();
// Transfer the token to the swap contract
super.transferFrom(_msgSenderERC721A(), address(this), _fromTokenId);
// Transfer the new token to the caller
this.transferFrom(address(this), _msgSenderERC721A(), _outTokenId);
emit PoolSwap(_msgSenderERC721A(), _fromTokenId, _outTokenId);
}
/**
* @notice Deposit a set of jirasan tokens to the contract
* @param _tokenIds The token IDs to deposit
*/
function deposit(uint256[] calldata _tokenIds) external onlyOwner {
for (uint256 i = 0; i < _tokenIds.length; i++) {
safeTransferFrom(owner(), address(this), _tokenIds[i]);
}
}
/**
* @notice Withdraw any tokens sent to the contract
* @param _tokenIds The token IDs to withdraw
*/
function withdraw(uint256[] calldata _tokenIds) external onlyOwner {
for (uint256 i = 0; i < _tokenIds.length; i++) {
this.safeTransferFrom(address(this), owner(), _tokenIds[i]);
}
}
/// @notice Override isApprovedForAll
function isApprovedForAll(address owner, address operator) public view virtual override(IERC721AUpgradeable, ERC721AUpgradeable) returns (bool) {
if (operator == address(this)) {
return true;
}
// Fallback to the default implementation
return super.isApprovedForAll(owner, operator);
}
function setApprovalForAll(
address operator,
bool approved
)
public
override(IERC721AUpgradeable, ERC721AUpgradeable)
onlyAllowedOperatorApproval(operator)
{
super.setApprovalForAll(operator, approved);
}
function approve(
address operator,
uint256 tokenId
)
public
payable
override(IERC721AUpgradeable, ERC721AUpgradeable)
onlyAllowedOperatorApproval(operator)
{
if(isSoulboundActive && soulbound[tokenId]) revert SOUL_BOUND();
super.approve(operator, tokenId);
}
function transferFrom(
address from,
address to,
uint256 tokenId
)
public
payable
override(IERC721AUpgradeable, ERC721AUpgradeable)
onlyAllowedOperator(from)
{
if(isSoulboundActive && soulbound[tokenId]) revert SOUL_BOUND();
super.transferFrom(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
)
public
payable
override(IERC721AUpgradeable, ERC721AUpgradeable)
onlyAllowedOperator(from)
{
if(isSoulboundActive && soulbound[tokenId]) revert SOUL_BOUND();
super.safeTransferFrom(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
)
public
payable
override(IERC721AUpgradeable, ERC721AUpgradeable)
onlyAllowedOperator(from)
{
if(isSoulboundActive && soulbound[tokenId]) revert SOUL_BOUND();
super.safeTransferFrom(from, to, tokenId, data);
}
function supportsInterface(
bytes4 interfaceId
)
public
view
virtual
override(
IERC721AUpgradeable,
ERC721AUpgradeable,
ERC2981Upgradeable
)
returns (bool)
{
return
ERC721AUpgradeable.supportsInterface(interfaceId) ||
ERC2981Upgradeable.supportsInterface(interfaceId);
}
function _baseURI() internal view virtual override returns (string memory) {
return currentBaseURI;
}
/// @dev Check if mint is live
function isLive() public view returns (bool) {
return block.timestamp >= liveAt && block.timestamp <= expiresAt;
}
/**
* @notice Sets trusted signer for claims
* @param _trustedSigner The signer for valid claims
*/
function setTrustedSigner(address _trustedSigner) external onlyOwner {
trustedSigner = _trustedSigner;
}
/**
* @notice Sets soulboundness
* @param _isSoulboundActive The boolean value of soulboundness
*/
function setSoulBoundActive(bool _isSoulboundActive) external onlyOwner {
isSoulboundActive = _isSoulboundActive;
}
/**
* @notice Sets swap pause
* @param _isSwapPaused The boolean value of pauseness
*/
function setSwapPaused(bool _isSwapPaused) external onlyOwner {
isSwapPaused = _isSwapPaused;
}
/**
* @notice Sets the collection max supply
* @param _maxSupply The max supply of the collection
*/
function setMaxSupply(uint256 _maxSupply) external onlyOwner {
maxSupply = _maxSupply;
}
/**
* @notice Sets timestamps for live and expires timeframe
* @param _liveAt A unix timestamp for live date
* @param _expiresAt A unix timestamp for expiration date
*/
function setMintWindow(
uint256 _liveAt,
uint256 _expiresAt
) external onlyOwner {
liveAt = _liveAt;
expiresAt = _expiresAt;
}
/**
* @notice Sets the treasury recipient
* @param _treasury The treasury address
*/
function setTreasury(address _treasury) public onlyOwner {
treasury = payable(_treasury);
}
/**
* @notice Sets the base uri for the token metadata
* @param _currentBaseURI The base uri
*/
function setBaseURI(string memory _currentBaseURI) external onlyOwner {
currentBaseURI = _currentBaseURI;
}
/**
* @notice Set default royalty
* @param receiver The royalty receiver address
* @param feeNumerator A number for 10k basis
*/
function setDefaultRoyalty(
address receiver,
uint96 feeNumerator
) external onlyOwner {
_setDefaultRoyalty(receiver, feeNumerator);
}
/**
* @dev Airdrop function
* @param _to The addresses to mint to airdrop too
*/
function airdrop(address[] calldata _to, uint256[] calldata _amounts) external onlyOwner {
for (uint256 i = 0; i < _to.length; i++) {
_mint(_to[i], _amounts[i]);
}
}
function onERC721Received(address, address, uint256, bytes calldata) external pure returns (bytes4) {
return IERC721Receiver.onERC721Received.selector;
}
/**
* @notice Sets soulboundness of a batch of tokens
* @param _tokenIds The token id array
* @param _soulboundness The boolean value
*/
function setSoulBoundTokens(uint256[] calldata _tokenIds, bool _soulboundness) external onlyOwner {
for (uint256 i = 0; i < _tokenIds.length; i++) {
soulbound[_tokenIds[i]] = _soulboundness;
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {Initializable} from "../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.
*
* The initial owner is set to the address provided by the deployer. 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 {
/// @custom:storage-location erc7201:openzeppelin.storage.Ownable
struct OwnableStorage {
address _owner;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;
function _getOwnableStorage() private pure returns (OwnableStorage storage $) {
assembly {
$.slot := OwnableStorageLocation
}
}
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
function __Ownable_init(address initialOwner) internal onlyInitializing {
__Ownable_init_unchained(initialOwner);
}
function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @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) {
OwnableStorage storage $ = _getOwnableStorage();
return $._owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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 {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
OwnableStorage storage $ = _getOwnableStorage();
address oldOwner = $._owner;
$._owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.20;
/**
* @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]
* ```solidity
* 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 Storage of the initializable contract.
*
* It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
* when using with upgradeable contracts.
*
* @custom:storage-location erc7201:openzeppelin.storage.Initializable
*/
struct InitializableStorage {
/**
* @dev Indicates that the contract has been initialized.
*/
uint64 _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool _initializing;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;
/**
* @dev The contract is already initialized.
*/
error InvalidInitialization();
/**
* @dev The contract is not initializing.
*/
error NotInitializing();
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint64 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 in the context of a constructor an `initializer` may be invoked any
* number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
* production.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
// Cache values to avoid duplicated sloads
bool isTopLevelCall = !$._initializing;
uint64 initialized = $._initialized;
// Allowed calls:
// - initialSetup: the contract is not in the initializing state and no previous version was
// initialized
// - construction: the contract is initialized at version 1 (no reininitialization) and the
// current contract is just being deployed
bool initialSetup = initialized == 0 && isTopLevelCall;
bool construction = initialized == 1 && address(this).code.length == 0;
if (!initialSetup && !construction) {
revert InvalidInitialization();
}
$._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 2**64 - 1 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint64 version) {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing || $._initialized >= version) {
revert InvalidInitialization();
}
$._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() {
_checkInitializing();
_;
}
/**
* @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
*/
function _checkInitializing() internal view virtual {
if (!_isInitializing()) {
revert NotInitializing();
}
}
/**
* @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 {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing) {
revert InvalidInitialization();
}
if ($._initialized != type(uint64).max) {
$._initialized = type(uint64).max;
emit Initialized(type(uint64).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint64) {
return _getInitializableStorage()._initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _getInitializableStorage()._initializing;
}
/**
* @dev Returns a pointer to the storage namespace.
*/
// solhint-disable-next-line var-name-mixedcase
function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
assembly {
$.slot := INITIALIZABLE_STORAGE
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/common/ERC2981.sol)
pragma solidity ^0.8.20;
import {IERC2981} from "@openzeppelin/contracts/interfaces/IERC2981.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {ERC165Upgradeable} from "../../utils/introspection/ERC165Upgradeable.sol";
import {Initializable} from "../../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.
*/
abstract contract ERC2981Upgradeable is Initializable, IERC2981, ERC165Upgradeable {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
/// @custom:storage-location erc7201:openzeppelin.storage.ERC2981
struct ERC2981Storage {
RoyaltyInfo _defaultRoyaltyInfo;
mapping(uint256 tokenId => RoyaltyInfo) _tokenRoyaltyInfo;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC2981")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant ERC2981StorageLocation = 0xdaedc9ab023613a7caf35e703657e986ccfad7e3eb0af93a2853f8d65dd86b00;
function _getERC2981Storage() private pure returns (ERC2981Storage storage $) {
assembly {
$.slot := ERC2981StorageLocation
}
}
/**
* @dev The default royalty set is invalid (eg. (numerator / denominator) >= 1).
*/
error ERC2981InvalidDefaultRoyalty(uint256 numerator, uint256 denominator);
/**
* @dev The default royalty receiver is invalid.
*/
error ERC2981InvalidDefaultRoyaltyReceiver(address receiver);
/**
* @dev The royalty set for an specific `tokenId` is invalid (eg. (numerator / denominator) >= 1).
*/
error ERC2981InvalidTokenRoyalty(uint256 tokenId, uint256 numerator, uint256 denominator);
/**
* @dev The royalty receiver for `tokenId` is invalid.
*/
error ERC2981InvalidTokenRoyaltyReceiver(uint256 tokenId, address receiver);
function __ERC2981_init() internal onlyInitializing {
}
function __ERC2981_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165Upgradeable) returns (bool) {
return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @inheritdoc IERC2981
*/
function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual returns (address, uint256) {
ERC2981Storage storage $ = _getERC2981Storage();
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 {
ERC2981Storage storage $ = _getERC2981Storage();
uint256 denominator = _feeDenominator();
if (feeNumerator > denominator) {
// Royalty fee will exceed the sale price
revert ERC2981InvalidDefaultRoyalty(feeNumerator, denominator);
}
if (receiver == address(0)) {
revert ERC2981InvalidDefaultRoyaltyReceiver(address(0));
}
$._defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Removes default royalty information.
*/
function _deleteDefaultRoyalty() internal virtual {
ERC2981Storage storage $ = _getERC2981Storage();
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 {
ERC2981Storage storage $ = _getERC2981Storage();
uint256 denominator = _feeDenominator();
if (feeNumerator > denominator) {
// Royalty fee will exceed the sale price
revert ERC2981InvalidTokenRoyalty(tokenId, feeNumerator, denominator);
}
if (receiver == address(0)) {
revert ERC2981InvalidTokenRoyaltyReceiver(tokenId, address(0));
}
$._tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Resets royalty information for the token id back to the global default.
*/
function _resetTokenRoyalty(uint256 tokenId) internal virtual {
ERC2981Storage storage $ = _getERC2981Storage();
delete $._tokenRoyaltyInfo[tokenId];
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)
pragma solidity ^0.8.20;
import {Initializable} from "../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;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {Initializable} from "../../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);
* }
* ```
*/
abstract contract ERC165Upgradeable is Initializable, IERC165 {
function __ERC165_init() internal onlyInitializing {
}
function __ERC165_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
import {Initializable} from "../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;
/// @custom:storage-location erc7201:openzeppelin.storage.ReentrancyGuard
struct ReentrancyGuardStorage {
uint256 _status;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ReentrancyGuard")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant ReentrancyGuardStorageLocation = 0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00;
function _getReentrancyGuardStorage() private pure returns (ReentrancyGuardStorage storage $) {
assembly {
$.slot := ReentrancyGuardStorageLocation
}
}
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
function __ReentrancyGuard_init() internal onlyInitializing {
__ReentrancyGuard_init_unchained();
}
function __ReentrancyGuard_init_unchained() internal onlyInitializing {
ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
$._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 {
ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
// On the first call to nonReentrant, _status will be NOT_ENTERED
if ($._status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
$._status = ENTERED;
}
function _nonReentrantAfter() private {
ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
$._status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
return $._status == ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC2981.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../utils/introspection/IERC165.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.
*/
interface IERC2981 is IERC165 {
/**
* @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 v5.0.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.20;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be
* reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.20;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS
}
/**
* @dev The signature derives the `address(0)`.
*/
error ECDSAInvalidSignature();
/**
* @dev The signature has an invalid length.
*/
error ECDSAInvalidSignatureLength(uint256 length);
/**
* @dev The signature has an S value that is in the upper half order.
*/
error ECDSAInvalidSignatureS(bytes32 s);
/**
* @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not
* return address(0) without also returning an error description. Errors are documented using an enum (error type)
* and a bytes32 providing additional information about the error.
*
* If no error is returned, then the address can be used for verification purposes.
*
* The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) {
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
/// @solidity memory-safe-assembly
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else {
return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*/
function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) {
unchecked {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
// We do not check for an overflow here since the shift operation results in 0 or 1.
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*/
function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError, bytes32) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS, s);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature, bytes32(0));
}
return (signer, RecoverError.NoError, bytes32(0));
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.
*/
function _throwError(RecoverError error, bytes32 errorArg) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert ECDSAInvalidSignature();
} else if (error == RecoverError.InvalidSignatureLength) {
revert ECDSAInvalidSignatureLength(uint256(errorArg));
} else if (error == RecoverError.InvalidSignatureS) {
revert ECDSAInvalidSignatureS(errorArg);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @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 IERC165 {
/**
* @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.4;
/// @notice Optimized and flexible operator filterer to abide to OpenSea's
/// mandatory on-chain royalty enforcement in order for new collections to
/// receive royalties.
/// For more information, see:
/// See: https://github.com/ProjectOpenSea/operator-filter-registry
abstract contract OperatorFilterer {
/// @dev The default OpenSea operator blocklist subscription.
address internal constant _DEFAULT_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;
/// @dev The OpenSea operator filter registry.
address internal constant _OPERATOR_FILTER_REGISTRY = 0x000000000000AAeB6D7670E522A718067333cd4E;
/// @dev Registers the current contract to OpenSea's operator filter,
/// and subscribe to the default OpenSea operator blocklist.
/// Note: Will not revert nor update existing settings for repeated registration.
function _registerForOperatorFiltering() internal virtual {
_registerForOperatorFiltering(_DEFAULT_SUBSCRIPTION, true);
}
/// @dev Registers the current contract to OpenSea's operator filter.
/// Note: Will not revert nor update existing settings for repeated registration.
function _registerForOperatorFiltering(address subscriptionOrRegistrantToCopy, bool subscribe)
internal
virtual
{
/// @solidity memory-safe-assembly
assembly {
let functionSelector := 0x7d3e3dbe // `registerAndSubscribe(address,address)`.
// Clean the upper 96 bits of `subscriptionOrRegistrantToCopy` in case they are dirty.
subscriptionOrRegistrantToCopy := shr(96, shl(96, subscriptionOrRegistrantToCopy))
for {} iszero(subscribe) {} {
if iszero(subscriptionOrRegistrantToCopy) {
functionSelector := 0x4420e486 // `register(address)`.
break
}
functionSelector := 0xa0af2903 // `registerAndCopyEntries(address,address)`.
break
}
// Store the function selector.
mstore(0x00, shl(224, functionSelector))
// Store the `address(this)`.
mstore(0x04, address())
// Store the `subscriptionOrRegistrantToCopy`.
mstore(0x24, subscriptionOrRegistrantToCopy)
// Register into the registry.
if iszero(call(gas(), _OPERATOR_FILTER_REGISTRY, 0, 0x00, 0x44, 0x00, 0x04)) {
// If the function selector has not been overwritten,
// it is an out-of-gas error.
if eq(shr(224, mload(0x00)), functionSelector) {
// To prevent gas under-estimation.
revert(0, 0)
}
}
// Restore the part of the free memory pointer that was overwritten,
// which is guaranteed to be zero, because of Solidity's memory size limits.
mstore(0x24, 0)
}
}
/// @dev Modifier to guard a function and revert if the caller is a blocked operator.
modifier onlyAllowedOperator(address from) virtual {
if (from != msg.sender) {
if (!_isPriorityOperator(msg.sender)) {
if (_operatorFilteringEnabled()) _revertIfBlocked(msg.sender);
}
}
_;
}
/// @dev Modifier to guard a function from approving a blocked operator..
modifier onlyAllowedOperatorApproval(address operator) virtual {
if (!_isPriorityOperator(operator)) {
if (_operatorFilteringEnabled()) _revertIfBlocked(operator);
}
_;
}
/// @dev Helper function that reverts if the `operator` is blocked by the registry.
function _revertIfBlocked(address operator) private view {
/// @solidity memory-safe-assembly
assembly {
// Store the function selector of `isOperatorAllowed(address,address)`,
// shifted left by 6 bytes, which is enough for 8tb of memory.
// We waste 6-3 = 3 bytes to save on 6 runtime gas (PUSH1 0x224 SHL).
mstore(0x00, 0xc6171134001122334455)
// Store the `address(this)`.
mstore(0x1a, address())
// Store the `operator`.
mstore(0x3a, operator)
// `isOperatorAllowed` always returns true if it does not revert.
if iszero(staticcall(gas(), _OPERATOR_FILTER_REGISTRY, 0x16, 0x44, 0x00, 0x00)) {
// Bubble up the revert if the staticcall reverts.
returndatacopy(0x00, 0x00, returndatasize())
revert(0x00, returndatasize())
}
// We'll skip checking if `from` is inside the blacklist.
// Even though that can block transferring out of wrapper contracts,
// we don't want tokens to be stuck.
// Restore the part of the free memory pointer that was overwritten,
// which is guaranteed to be zero, if less than 8tb of memory is used.
mstore(0x3a, 0)
}
}
/// @dev For deriving contracts to override, so that operator filtering
/// can be turned on / off.
/// Returns true by default.
function _operatorFilteringEnabled() internal view virtual returns (bool) {
return true;
}
/// @dev For deriving contracts to override, so that preferred marketplaces can
/// skip operator filtering, helping users save gas.
/// Returns false for all inputs by default.
function _isPriorityOperator(address) internal view virtual returns (bool) {
return false;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.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;
// The amount of tokens minted above `_sequentialUpTo()`.
// We call these spot mints (i.e. non-sequential mints).
uint256 _spotMinted;
}
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.3.0
// 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()`.
*
* The `_sequentialUpTo()` function can be overriden to enable spot mints
* (i.e. non-consecutive mints) for `tokenId`s greater than `_sequentialUpTo()`.
*
* 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();
if (_sequentialUpTo() < _startTokenId()) _revert(SequentialUpToTooSmall.selector);
}
// =============================================================
// TOKEN COUNTING OPERATIONS
// =============================================================
/**
* @dev Returns the starting token ID for sequential mints.
*
* Override this function to change the starting token ID for sequential mints.
*
* Note: The value returned must never change after any tokens have been minted.
*/
function _startTokenId() internal view virtual returns (uint256) {
return 0;
}
/**
* @dev Returns the maximum token ID (inclusive) for sequential mints.
*
* Override this function to return a value less than 2**256 - 1,
* but greater than `_startTokenId()`, to enable spot (non-sequential) mints.
*
* Note: The value returned must never change after any tokens have been minted.
*/
function _sequentialUpTo() internal view virtual returns (uint256) {
return type(uint256).max;
}
/**
* @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 result) {
// Counter underflow is impossible as `_burnCounter` cannot be incremented
// more than `_currentIndex + _spotMinted - _startTokenId()` times.
unchecked {
// With spot minting, the intermediate `result` can be temporarily negative,
// and the computation must be unchecked.
result = ERC721AStorage.layout()._currentIndex - ERC721AStorage.layout()._burnCounter - _startTokenId();
if (_sequentialUpTo() != type(uint256).max) result += ERC721AStorage.layout()._spotMinted;
}
}
/**
* @dev Returns the total amount of tokens minted in the contract.
*/
function _totalMinted() internal view virtual returns (uint256 result) {
// Counter underflow is impossible as `_currentIndex` does not decrement,
// and it is initialized to `_startTokenId()`.
unchecked {
result = ERC721AStorage.layout()._currentIndex - _startTokenId();
if (_sequentialUpTo() != type(uint256).max) result += ERC721AStorage.layout()._spotMinted;
}
}
/**
* @dev Returns the total number of tokens burned.
*/
function _totalBurned() internal view virtual returns (uint256) {
return ERC721AStorage.layout()._burnCounter;
}
/**
* @dev Returns the total number of tokens that are spot-minted.
*/
function _totalSpotMinted() internal view virtual returns (uint256) {
return ERC721AStorage.layout()._spotMinted;
}
// =============================================================
// 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.selector);
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.selector);
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 Returns whether the ownership slot at `index` is initialized.
* An uninitialized slot does not necessarily mean that the slot has no owner.
*/
function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) {
return ERC721AStorage.layout()._packedOwnerships[index] != 0;
}
/**
* @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);
}
}
/**
* @dev 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 (tokenId > _sequentialUpTo()) {
if (_packedOwnershipExists(packed)) return packed;
_revert(OwnerQueryForNonexistentToken.selector);
}
// If the data at the starting slot does not exist, start the scan.
if (packed == 0) {
if (tokenId >= ERC721AStorage.layout()._currentIndex) _revert(OwnerQueryForNonexistentToken.selector);
// 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;
if (packed & _BITMASK_BURNED == 0) return packed;
// Otherwise, the token is burned, and we must revert.
// This handles the case of batch burned tokens, where only the burned bit
// of the starting slot is set, and remaining slots are left uninitialized.
_revert(OwnerQueryForNonexistentToken.selector);
}
}
// Otherwise, the data exists and 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.
// If the token is not burned, return `packed`. Otherwise, revert.
if (packed & _BITMASK_BURNED == 0) return packed;
}
_revert(OwnerQueryForNonexistentToken.selector);
}
/**
* @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.selector);
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 result) {
if (_startTokenId() <= tokenId) {
if (tokenId > _sequentialUpTo())
return _packedOwnershipExists(ERC721AStorage.layout()._packedOwnerships[tokenId]);
if (tokenId < ERC721AStorage.layout()._currentIndex) {
uint256 packed;
while ((packed = ERC721AStorage.layout()._packedOwnerships[tokenId]) == 0) --tokenId;
result = packed & _BITMASK_BURNED == 0;
}
}
}
/**
* @dev Returns whether `packed` represents a token that exists.
*/
function _packedOwnershipExists(uint256 packed) private pure returns (bool result) {
assembly {
// The following is equivalent to `owner != address(0) && burned == false`.
// Symbolically tested.
result := gt(and(packed, _BITMASK_ADDRESS), and(packed, _BITMASK_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);
// Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean.
from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS));
if (address(uint160(prevOwnershipPacked)) != from) _revert(TransferFromIncorrectOwner.selector);
(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.selector);
_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;
}
}
}
}
// Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;
assembly {
// 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.
from, // `from`.
toMasked, // `to`.
tokenId // `tokenId`.
)
}
if (toMasked == 0) _revert(TransferToZeroAddress.selector);
_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.selector);
}
}
/**
* @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.selector);
}
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.selector);
_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:
// - `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)
);
// Updates:
// - `balance += quantity`.
// - `numberMinted += quantity`.
//
// We can directly add to the `balance` and `numberMinted`.
ERC721AStorage.layout()._packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);
// Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;
if (toMasked == 0) _revert(MintToZeroAddress.selector);
uint256 end = startTokenId + quantity;
uint256 tokenId = startTokenId;
if (end - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector);
do {
assembly {
// 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`.
tokenId // `tokenId`.
)
}
// The `!=` check ensures that large values of `quantity`
// that overflows uint256 will make the loop run out of gas.
} while (++tokenId != end);
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.selector);
if (quantity == 0) _revert(MintZeroQuantity.selector);
if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) _revert(MintERC2309QuantityExceedsLimit.selector);
_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)
);
if (startTokenId + quantity - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector);
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.selector);
}
} while (index < end);
// This prevents reentrancy to `_safeMint`.
// It does not prevent reentrancy to `_safeMintSpot`.
if (ERC721AStorage.layout()._currentIndex != end) revert();
}
}
}
/**
* @dev Equivalent to `_safeMint(to, quantity, '')`.
*/
function _safeMint(address to, uint256 quantity) internal virtual {
_safeMint(to, quantity, '');
}
/**
* @dev Mints a single token at `tokenId`.
*
* Note: A spot-minted `tokenId` that has been burned can be re-minted again.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` must be greater than `_sequentialUpTo()`.
* - `tokenId` must not exist.
*
* Emits a {Transfer} event for each mint.
*/
function _mintSpot(address to, uint256 tokenId) internal virtual {
if (tokenId <= _sequentialUpTo()) _revert(SpotMintTokenIdTooSmall.selector);
uint256 prevOwnershipPacked = ERC721AStorage.layout()._packedOwnerships[tokenId];
if (_packedOwnershipExists(prevOwnershipPacked)) _revert(TokenAlreadyExists.selector);
_beforeTokenTransfers(address(0), to, tokenId, 1);
// Overflows are incredibly unrealistic.
// The `numberMinted` for `to` is incremented by 1, and has a max limit of 2**64 - 1.
// `_spotMinted` is incremented by 1, and has a max limit of 2**256 - 1.
unchecked {
// Updates:
// - `address` to the owner.
// - `startTimestamp` to the timestamp of minting.
// - `burned` to `false`.
// - `nextInitialized` to `true` (as `quantity == 1`).
ERC721AStorage.layout()._packedOwnerships[tokenId] = _packOwnershipData(
to,
_nextInitializedFlag(1) | _nextExtraData(address(0), to, prevOwnershipPacked)
);
// Updates:
// - `balance += 1`.
// - `numberMinted += 1`.
//
// We can directly add to the `balance` and `numberMinted`.
ERC721AStorage.layout()._packedAddressData[to] += (1 << _BITPOS_NUMBER_MINTED) | 1;
// Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;
if (toMasked == 0) _revert(MintToZeroAddress.selector);
assembly {
// 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`.
tokenId // `tokenId`.
)
}
++ERC721AStorage.layout()._spotMinted;
}
_afterTokenTransfers(address(0), to, tokenId, 1);
}
/**
* @dev Safely mints a single token at `tokenId`.
*
* Note: A spot-minted `tokenId` that has been burned can be re-minted again.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}.
* - `tokenId` must be greater than `_sequentialUpTo()`.
* - `tokenId` must not exist.
*
* See {_mintSpot}.
*
* Emits a {Transfer} event.
*/
function _safeMintSpot(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mintSpot(to, tokenId);
unchecked {
if (to.code.length != 0) {
uint256 currentSpotMinted = ERC721AStorage.layout()._spotMinted;
if (!_checkContractOnERC721Received(address(0), to, tokenId, _data)) {
_revert(TransferToNonERC721ReceiverImplementer.selector);
}
// This prevents reentrancy to `_safeMintSpot`.
// It does not prevent reentrancy to `_safeMint`.
if (ERC721AStorage.layout()._spotMinted != currentSpotMinted) revert();
}
}
}
/**
* @dev Equivalent to `_safeMintSpot(to, tokenId, '')`.
*/
function _safeMintSpot(address to, uint256 tokenId) internal virtual {
_safeMintSpot(to, tokenId, '');
}
// =============================================================
// 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 && _msgSenderERC721A() != owner)
if (!isApprovedForAll(owner, _msgSenderERC721A())) {
_revert(ApprovalCallerNotOwnerNorApproved.selector);
}
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.selector);
}
_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 + _spotMinted` 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.selector);
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)
}
}
/**
* @dev For more efficient reverts.
*/
function _revert(bytes4 errorSelector) internal pure {
assembly {
mstore(0x00, errorSelector)
revert(0x00, 0x04)
}
}
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.3.0
// Creator: Chiru Labs
pragma solidity ^0.8.4;
import './IERC721ABurnableUpgradeable.sol';
import '../ERC721AUpgradeable.sol';
import '../ERC721A__Initializable.sol';
/**
* @title ERC721ABurnable.
*
* @dev ERC721A token that can be irreversibly burned (destroyed).
*/
abstract contract ERC721ABurnableUpgradeable is
ERC721A__Initializable,
ERC721AUpgradeable,
IERC721ABurnableUpgradeable
{
function __ERC721ABurnable_init() internal onlyInitializingERC721A {
__ERC721ABurnable_init_unchained();
}
function __ERC721ABurnable_init_unchained() internal onlyInitializingERC721A {}
/**
* @dev Burns `tokenId`. See {ERC721A-_burn}.
*
* Requirements:
*
* - The caller must own `tokenId` or be an approved operator.
*/
function burn(uint256 tokenId) public virtual override {
_burn(tokenId, true);
}
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.3.0
// Creator: Chiru Labs
pragma solidity ^0.8.4;
import './IERC721AQueryableUpgradeable.sol';
import '../ERC721AUpgradeable.sol';
import '../ERC721A__Initializable.sol';
/**
* @title ERC721AQueryable.
*
* @dev ERC721A subclass with convenience query functions.
*/
abstract contract ERC721AQueryableUpgradeable is
ERC721A__Initializable,
ERC721AUpgradeable,
IERC721AQueryableUpgradeable
{
function __ERC721AQueryable_init() internal onlyInitializingERC721A {
__ERC721AQueryable_init_unchained();
}
function __ERC721AQueryable_init_unchained() internal onlyInitializingERC721A {}
/**
* @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
*
* If the `tokenId` is out of bounds:
*
* - `addr = address(0)`
* - `startTimestamp = 0`
* - `burned = false`
* - `extraData = 0`
*
* If the `tokenId` is burned:
*
* - `addr = <Address of owner before token was burned>`
* - `startTimestamp = <Timestamp when token was burned>`
* - `burned = true`
* - `extraData = <Extra data when token was burned>`
*
* Otherwise:
*
* - `addr = <Address of owner>`
* - `startTimestamp = <Timestamp of start of ownership>`
* - `burned = false`
* - `extraData = <Extra data at start of ownership>`
*/
function explicitOwnershipOf(uint256 tokenId)
public
view
virtual
override
returns (TokenOwnership memory ownership)
{
unchecked {
if (tokenId >= _startTokenId()) {
if (tokenId > _sequentialUpTo()) return _ownershipAt(tokenId);
if (tokenId < _nextTokenId()) {
// If the `tokenId` is within bounds,
// scan backwards for the initialized ownership slot.
while (!_ownershipIsInitialized(tokenId)) --tokenId;
return _ownershipAt(tokenId);
}
}
}
}
/**
* @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
* See {ERC721AQueryable-explicitOwnershipOf}
*/
function explicitOwnershipsOf(uint256[] calldata tokenIds)
external
view
virtual
override
returns (TokenOwnership[] memory)
{
TokenOwnership[] memory ownerships;
uint256 i = tokenIds.length;
assembly {
// Grab the free memory pointer.
ownerships := mload(0x40)
// Store the length.
mstore(ownerships, i)
// Allocate one word for the length,
// `tokenIds.length` words for the pointers.
i := shl(5, i) // Multiply `i` by 32.
mstore(0x40, add(add(ownerships, 0x20), i))
}
while (i != 0) {
uint256 tokenId;
assembly {
i := sub(i, 0x20)
tokenId := calldataload(add(tokenIds.offset, i))
}
TokenOwnership memory ownership = explicitOwnershipOf(tokenId);
assembly {
// Store the pointer of `ownership` in the `ownerships` array.
mstore(add(add(ownerships, 0x20), i), ownership)
}
}
return ownerships;
}
/**
* @dev Returns an array of token IDs owned by `owner`,
* in the range [`start`, `stop`)
* (i.e. `start <= tokenId < stop`).
*
* This function allows for tokens to be queried if the collection
* grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
*
* Requirements:
*
* - `start < stop`
*/
function tokensOfOwnerIn(
address owner,
uint256 start,
uint256 stop
) external view virtual override returns (uint256[] memory) {
return _tokensOfOwnerIn(owner, start, stop);
}
/**
* @dev Returns an array of token IDs owned by `owner`.
*
* This function scans the ownership mapping and is O(`totalSupply`) in complexity.
* It is meant to be called off-chain.
*
* See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
* multiple smaller scans if the collection is large enough to cause
* an out-of-gas error (10K collections should be fine).
*/
function tokensOfOwner(address owner) external view virtual override returns (uint256[] memory) {
// If spot mints are enabled, full-range scan is disabled.
if (_sequentialUpTo() != type(uint256).max) _revert(NotCompatibleWithSpotMints.selector);
uint256 start = _startTokenId();
uint256 stop = _nextTokenId();
uint256[] memory tokenIds;
if (start != stop) tokenIds = _tokensOfOwnerIn(owner, start, stop);
return tokenIds;
}
/**
* @dev Helper function for returning an array of token IDs owned by `owner`.
*
* Note that this function is optimized for smaller bytecode size over runtime gas,
* since it is meant to be called off-chain.
*/
function _tokensOfOwnerIn(
address owner,
uint256 start,
uint256 stop
) private view returns (uint256[] memory tokenIds) {
unchecked {
if (start >= stop) _revert(InvalidQueryRange.selector);
// Set `start = max(start, _startTokenId())`.
if (start < _startTokenId()) start = _startTokenId();
uint256 nextTokenId = _nextTokenId();
// If spot mints are enabled, scan all the way until the specified `stop`.
uint256 stopLimit = _sequentialUpTo() != type(uint256).max ? stop : nextTokenId;
// Set `stop = min(stop, stopLimit)`.
if (stop >= stopLimit) stop = stopLimit;
// Number of tokens to scan.
uint256 tokenIdsMaxLength = balanceOf(owner);
// Set `tokenIdsMaxLength` to zero if the range contains no tokens.
if (start >= stop) tokenIdsMaxLength = 0;
// If there are one or more tokens to scan.
if (tokenIdsMaxLength != 0) {
// Set `tokenIdsMaxLength = min(balanceOf(owner), tokenIdsMaxLength)`.
if (stop - start <= tokenIdsMaxLength) tokenIdsMaxLength = stop - start;
uint256 m; // Start of available memory.
assembly {
// Grab the free memory pointer.
tokenIds := mload(0x40)
// Allocate one word for the length, and `tokenIdsMaxLength` words
// for the data. `shl(5, x)` is equivalent to `mul(32, x)`.
m := add(tokenIds, shl(5, add(tokenIdsMaxLength, 1)))
mstore(0x40, m)
}
// We need to call `explicitOwnershipOf(start)`,
// because the slot at `start` may not be initialized.
TokenOwnership memory ownership = explicitOwnershipOf(start);
address currOwnershipAddr;
// If the starting slot exists (i.e. not burned),
// initialize `currOwnershipAddr`.
// `ownership.address` will not be zero,
// as `start` is clamped to the valid token ID range.
if (!ownership.burned) currOwnershipAddr = ownership.addr;
uint256 tokenIdsIdx;
// Use a do-while, which is slightly more efficient for this case,
// as the array will at least contain one element.
do {
if (_sequentialUpTo() != type(uint256).max) {
// Skip the remaining unused sequential slots.
if (start == nextTokenId) start = _sequentialUpTo() + 1;
// Reset `currOwnershipAddr`, as each spot-minted token is a batch of one.
if (start > _sequentialUpTo()) currOwnershipAddr = address(0);
}
ownership = _ownershipAt(start); // This implicitly allocates memory.
assembly {
switch mload(add(ownership, 0x40))
// if `ownership.burned == false`.
case 0 {
// if `ownership.addr != address(0)`.
// The `addr` already has it's upper 96 bits clearned,
// since it is written to memory with regular Solidity.
if mload(ownership) {
currOwnershipAddr := mload(ownership)
}
// if `currOwnershipAddr == owner`.
// The `shl(96, x)` is to make the comparison agnostic to any
// dirty upper 96 bits in `owner`.
if iszero(shl(96, xor(currOwnershipAddr, owner))) {
tokenIdsIdx := add(tokenIdsIdx, 1)
mstore(add(tokenIds, shl(5, tokenIdsIdx)), start)
}
}
// Otherwise, reset `currOwnershipAddr`.
// This handles the case of batch burned tokens
// (burned bit of first slot set, remaining slots left uninitialized).
default {
currOwnershipAddr := 0
}
start := add(start, 1)
// Free temporary memory implicitly allocated for ownership
// to avoid quadratic memory expansion costs.
mstore(0x40, m)
}
} while (!(start == stop || tokenIdsIdx == tokenIdsMaxLength));
// Store the length of the array.
assembly {
mstore(tokenIds, tokenIdsIdx)
}
}
}
}
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.3.0
// Creator: Chiru Labs
pragma solidity ^0.8.4;
import '../IERC721AUpgradeable.sol';
/**
* @dev Interface of ERC721ABurnable.
*/
interface IERC721ABurnableUpgradeable is IERC721AUpgradeable {
/**
* @dev Burns `tokenId`. See {ERC721A-_burn}.
*
* Requirements:
*
* - The caller must own `tokenId` or be an approved operator.
*/
function burn(uint256 tokenId) external;
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.3.0
// Creator: Chiru Labs
pragma solidity ^0.8.4;
import '../IERC721AUpgradeable.sol';
/**
* @dev Interface of ERC721AQueryable.
*/
interface IERC721AQueryableUpgradeable is IERC721AUpgradeable {
/**
* Invalid query range (`start` >= `stop`).
*/
error InvalidQueryRange();
/**
* @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
*
* If the `tokenId` is out of bounds:
*
* - `addr = address(0)`
* - `startTimestamp = 0`
* - `burned = false`
* - `extraData = 0`
*
* If the `tokenId` is burned:
*
* - `addr = <Address of owner before token was burned>`
* - `startTimestamp = <Timestamp when token was burned>`
* - `burned = true`
* - `extraData = <Extra data when token was burned>`
*
* Otherwise:
*
* - `addr = <Address of owner>`
* - `startTimestamp = <Timestamp of start of ownership>`
* - `burned = false`
* - `extraData = <Extra data at start of ownership>`
*/
function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory);
/**
* @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
* See {ERC721AQueryable-explicitOwnershipOf}
*/
function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory);
/**
* @dev Returns an array of token IDs owned by `owner`,
* in the range [`start`, `stop`)
* (i.e. `start <= tokenId < stop`).
*
* This function allows for tokens to be queried if the collection
* grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
*
* Requirements:
*
* - `start < stop`
*/
function tokensOfOwnerIn(
address owner,
uint256 start,
uint256 stop
) external view returns (uint256[] memory);
/**
* @dev Returns an array of token IDs owned by `owner`.
*
* This function scans the ownership mapping and is O(`totalSupply`) in complexity.
* It is meant to be called off-chain.
*
* See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
* multiple smaller scans if the collection is large enough to cause
* an out-of-gas error (10K collections should be fine).
*/
function tokensOfOwner(address owner) external view returns (uint256[] memory);
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.3.0
// 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();
/**
* `_sequentialUpTo()` must be greater than `_startTokenId()`.
*/
error SequentialUpToTooSmall();
/**
* The `tokenId` of a sequential mint exceeds `_sequentialUpTo()`.
*/
error SequentialMintExceedsLimit();
/**
* Spot minting requires a `tokenId` greater than `_sequentialUpTo()`.
*/
error SpotMintTokenIdTooSmall();
/**
* Cannot mint over a token that already exists.
*/
error TokenAlreadyExists();
/**
* The feature is not compatible with spot mints.
*/
error NotCompatibleWithSpotMints();
// =============================================================
// 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);
}{
"evmVersion": "paris",
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ALREADY_CLAIMED","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"CLAIM_NOT_LIVE","type":"error"},{"inputs":[],"name":"ECDSAInvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"name":"ECDSAInvalidSignatureLength","type":"error"},{"inputs":[{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"ECDSAInvalidSignatureS","type":"error"},{"inputs":[{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidDefaultRoyalty","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidDefaultRoyaltyReceiver","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidTokenRoyalty","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidTokenRoyaltyReceiver","type":"error"},{"inputs":[],"name":"INVALID_SIGNATURE","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NOT_IN_POOL","type":"error"},{"inputs":[],"name":"NOT_OWNER","type":"error"},{"inputs":[],"name":"NotCompatibleWithSpotMints","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[],"name":"SOUL_BOUND","type":"error"},{"inputs":[],"name":"SWAP_NOT_LIVE","type":"error"},{"inputs":[],"name":"SequentialMintExceedsLimit","type":"error"},{"inputs":[],"name":"SequentialUpToTooSmall","type":"error"},{"inputs":[],"name":"SpotMintTokenIdTooSmall","type":"error"},{"inputs":[],"name":"TokenAlreadyExists","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":true,"internalType":"address","name":"claimer","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"presale","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"wallets","type":"address[]"},{"indexed":false,"internalType":"uint256","name":"startTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTokenId","type":"uint256"}],"name":"Claimed","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":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"swapper","type":"address"},{"indexed":false,"internalType":"uint256","name":"inTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"outTokenId","type":"uint256"}],"name":"PoolSwap","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":"address[]","name":"_to","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"airdrop","outputs":[],"stateMutability":"nonpayable","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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_presale","type":"uint256"},{"internalType":"address[]","name":"_wallets","type":"address[]"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentBaseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"expiresAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721AUpgradeable.TokenOwnership","name":"ownership","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721AUpgradeable.TokenOwnership[]","name":"","type":"tuple[]"}],"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":"string","name":"currentBaseURI_","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isLive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isSoulboundActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isSwapPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liveAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","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":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_currentBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxSupply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_liveAt","type":"uint256"},{"internalType":"uint256","name":"_expiresAt","type":"uint256"}],"name":"setMintWindow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isSoulboundActive","type":"bool"}],"name":"setSoulBoundActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"bool","name":"_soulboundness","type":"bool"}],"name":"setSoulBoundTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isSwapPaused","type":"bool"}],"name":"setSwapPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_trustedSigner","type":"address"}],"name":"setTrustedSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"soulbound","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"internalType":"uint256","name":"_outTokenId","type":"uint256"}],"name":"swap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"result","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":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"trustedSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b50620000226200002860201b60201c565b6200019c565b60006200003a6200013260201b60201c565b90508060000160089054906101000a900460ff161562000086576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff80168160000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff16146200012f5767ffffffffffffffff8160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055507fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d267ffffffffffffffff6040516200012691906200017f565b60405180910390a15b50565b60007ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00905090565b600067ffffffffffffffff82169050919050565b62000179816200015a565b82525050565b60006020820190506200019660008301846200016e565b92915050565b615fce80620001ac6000396000f3fe6080604052600436106102c95760003560e01c80638403d44f11610175578063b8f7a665116100dc578063d96073cf11610095578063f0f442601161006f578063f0f4426014610b17578063f2fde38b14610b40578063f62d188814610b69578063f74d548014610b92576102c9565b8063d96073cf14610a88578063e10f8aad14610ab1578063e985e9c514610ada576102c9565b8063b8f7a66514610952578063bbce87161461097d578063c23dc68f146109a6578063c87b56dd146109e3578063c884ef8314610a20578063d5abeb0114610a5d576102c9565b8063983d95ce1161012e578063983d95ce1461085357806399a2557a1461087c5780639a21d11a146108b9578063a22cb465146108e2578063ae2ef2711461090b578063b88d4fde14610936576102c9565b80638403d44f146107415780638462151c1461076a5780638622a689146107a75780638da5cb5b146107d257806395d89b41146107fd57806397d4ccd214610828576102c9565b8063462159ff1161023457806361d027b3116101ed5780636f8b44b0116101c75780636f8b44b01461068757806370a08231146106b0578063715018a6146106ed5780637a18159714610704576102c9565b806361d027b3146105f65780636352211e14610621578063672434821461065e576102c9565b8063462159ff146104e857806353f8bb9a1461051357806355f804b31461053e57806356a1c70114610567578063598b8e71146105905780635bbb2177146105b9576102c9565b8063150b7a0211610286578063150b7a02146103e157806318160ddd1461041e57806323b872dd146104495780632a55205a1461046557806342842e0e146104a357806342966c68146104bf576102c9565b806301ffc9a7146102ce57806304634d8d1461030b57806306fdde0314610334578063081812fc1461035f578063095ea7b31461039c5780630f867751146103b8575b600080fd5b3480156102da57600080fd5b506102f560048036038101906102f09190614616565b610bbd565b604051610302919061465e565b60405180910390f35b34801561031757600080fd5b50610332600480360381019061032d919061471b565b610bdf565b005b34801561034057600080fd5b50610349610bf5565b60405161035691906147eb565b60405180910390f35b34801561036b57600080fd5b5061038660048036038101906103819190614843565b610c90565b604051610393919061487f565b60405180910390f35b6103b660048036038101906103b1919061489a565b610cf7565b005b3480156103c457600080fd5b506103df60048036038101906103da91906148da565b610d9c565b005b3480156103ed57600080fd5b506104086004803603810190610403919061497f565b610db6565b6040516104159190614a16565b60405180910390f35b34801561042a57600080fd5b50610433610dcb565b6040516104409190614a40565b60405180910390f35b610463600480360381019061045e9190614a5b565b610e33565b005b34801561047157600080fd5b5061048c600480360381019061048791906148da565b610f0e565b60405161049a929190614aae565b60405180910390f35b6104bd60048036038101906104b89190614a5b565b611109565b005b3480156104cb57600080fd5b506104e660048036038101906104e19190614843565b6111e4565b005b3480156104f457600080fd5b506104fd6111f2565b60405161050a919061465e565b60405180910390f35b34801561051f57600080fd5b50610528611205565b6040516105359190614a40565b60405180910390f35b34801561054a57600080fd5b5061056560048036038101906105609190614c07565b61120b565b005b34801561057357600080fd5b5061058e60048036038101906105899190614c50565b611226565b005b34801561059c57600080fd5b506105b760048036038101906105b29190614cd3565b611272565b005b3480156105c557600080fd5b506105e060048036038101906105db9190614cd3565b6112c5565b6040516105ed9190614e83565b60405180910390f35b34801561060257600080fd5b5061060b611325565b604051610618919061487f565b60405180910390f35b34801561062d57600080fd5b5061064860048036038101906106439190614843565b61134b565b604051610655919061487f565b60405180910390f35b34801561066a57600080fd5b5061068560048036038101906106809190614efb565b61135d565b005b34801561069357600080fd5b506106ae60048036038101906106a99190614843565b6113d1565b005b3480156106bc57600080fd5b506106d760048036038101906106d29190614c50565b6113e3565b6040516106e49190614a40565b60405180910390f35b3480156106f957600080fd5b50610702611483565b005b34801561071057600080fd5b5061072b60048036038101906107269190614843565b611497565b604051610738919061465e565b60405180910390f35b34801561074d57600080fd5b5061076860048036038101906107639190614fa8565b6114b7565b005b34801561077657600080fd5b50610791600480360381019061078c9190614c50565b6114dc565b60405161079e9190615093565b60405180910390f35b3480156107b357600080fd5b506107bc611557565b6040516107c99190614a40565b60405180910390f35b3480156107de57600080fd5b506107e761155d565b6040516107f4919061487f565b60405180910390f35b34801561080957600080fd5b50610812611595565b60405161081f91906147eb565b60405180910390f35b34801561083457600080fd5b5061083d611630565b60405161084a91906147eb565b60405180910390f35b34801561085f57600080fd5b5061087a60048036038101906108759190614cd3565b6116be565b005b34801561088857600080fd5b506108a3600480360381019061089e91906150b5565b611775565b6040516108b09190615093565b60405180910390f35b3480156108c557600080fd5b506108e060048036038101906108db9190614fa8565b61178b565b005b3480156108ee57600080fd5b5061090960048036038101906109049190615108565b6117b0565b005b34801561091757600080fd5b506109206117e5565b60405161092d919061465e565b60405180910390f35b610950600480360381019061094b91906151e9565b6117f8565b005b34801561095e57600080fd5b506109676118d5565b604051610974919061465e565b60405180910390f35b34801561098957600080fd5b506109a4600480360381019061099f919061526c565b6118f0565b005b3480156109b257600080fd5b506109cd60048036038101906109c89190614843565b611c13565b6040516109da919061537d565b60405180910390f35b3480156109ef57600080fd5b50610a0a6004803603810190610a059190614843565b611c88565b604051610a1791906147eb565b60405180910390f35b348015610a2c57600080fd5b50610a476004803603810190610a429190614c50565b611d05565b604051610a54919061465e565b60405180910390f35b348015610a6957600080fd5b50610a72611d25565b604051610a7f9190614a40565b60405180910390f35b348015610a9457600080fd5b50610aaf6004803603810190610aaa91906148da565b611d2b565b005b348015610abd57600080fd5b50610ad86004803603810190610ad39190615398565b611f36565b005b348015610ae657600080fd5b50610b016004803603810190610afc91906153f8565b611fa3565b604051610b0e919061465e565b60405180910390f35b348015610b2357600080fd5b50610b3e6004803603810190610b399190614c50565b611ff4565b005b348015610b4c57600080fd5b50610b676004803603810190610b629190614c50565b612040565b005b348015610b7557600080fd5b50610b906004803603810190610b8b9190614c07565b6120c6565b005b348015610b9e57600080fd5b50610ba7612504565b604051610bb4919061487f565b60405180910390f35b6000610bc88261252a565b80610bd85750610bd7826125bc565b5b9050919050565b610be7612636565b610bf182826126bd565b5050565b6060610bff61286e565b6002018054610c0d90615467565b80601f0160208091040260200160405190810160405280929190818152602001828054610c3990615467565b8015610c865780601f10610c5b57610100808354040283529160200191610c86565b820191906000526020600020905b815481529060010190602001808311610c6957829003601f168201915b5050505050905090565b6000610c9b8261289b565b610cb057610caf63cf4700e460e01b612962565b5b610cb861286e565b600601600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b81610d018161296c565b610d1d57610d0d612973565b15610d1c57610d1b8161297c565b5b5b600660029054906101000a900460ff168015610d5657506008600083815260200190815260200160002060009054906101000a900460ff165b15610d8d576040517fa3292bd500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d9783836129c0565b505050565b610da4612636565b81600481905550806005819055505050565b600063150b7a0260e01b905095945050505050565b6000610dd56129d0565b610ddd61286e565b60010154610de961286e565b60000154030390507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610e1a6129d9565b14610e3057610e2761286e565b60080154810190505b90565b823373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610e8d57610e703361296c565b610e8c57610e7c612973565b15610e8b57610e8a3361297c565b5b5b5b600660029054906101000a900460ff168015610ec657506008600083815260200190815260200160002060009054906101000a900460ff165b15610efd576040517fa3292bd500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f08848484612a01565b50505050565b6000806000610f1b612cf8565b905060008160010160008781526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff16036110b357816000016040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff168152505090505b60006110bd612d20565b6bffffffffffffffffffffffff1682602001516bffffffffffffffffffffffff16876110e991906154c7565b6110f39190615538565b9050816000015181945094505050509250929050565b823373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611163576111463361296c565b61116257611152612973565b15611161576111603361297c565b5b5b5b600660029054906101000a900460ff16801561119c57506008600083815260200190815260200160002060009054906101000a900460ff165b156111d3576040517fa3292bd500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111de848484612d2a565b50505050565b6111ef816001612d4a565b50565b600660029054906101000a900460ff1681565b60045481565b611213612636565b80600090816112229190615715565b5050565b61122e612636565b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61127a612636565b60005b828290508110156112c0576112b361129361155d565b308585858181106112a7576112a66157e7565b5b90506020020135611109565b808060010191505061127d565b505050565b606080600084849050905060405191508082528060051b90508060208301016040525b6000811461131a576000602082039150818601359050600061130982611c13565b9050808360208601015250506112e8565b819250505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061135682612fb1565b9050919050565b611365612636565b60005b848490508110156113ca576113bd858583818110611389576113886157e7565b5b905060200201602081019061139e9190614c50565b8484848181106113b1576113b06157e7565b5b905060200201356130e5565b8080600101915050611368565b5050505050565b6113d9612636565b8060038190555050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361142957611428638f4eb60460e01b612962565b5b67ffffffffffffffff61143a61286e565b60050160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054169050919050565b61148b612636565b6114956000613290565b565b60086020528060005260406000206000915054906101000a900460ff1681565b6114bf612636565b80600660026101000a81548160ff02191690831515021790555050565b60607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6115076129d9565b1461151d5761151c63bdba09d760e01b612962565b5b60006115276129d0565b90506000611533613367565b9050606081831461154c5761154985848461337a565b90505b809350505050919050565b60055481565b600080611568613536565b90508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691505090565b606061159f61286e565b60030180546115ad90615467565b80601f01602080910402602001604051908101604052809291908181526020018280546115d990615467565b80156116265780601f106115fb57610100808354040283529160200191611626565b820191906000526020600020905b81548152906001019060200180831161160957829003601f168201915b5050505050905090565b6000805461163d90615467565b80601f016020809104026020016040519081016040528092919081815260200182805461166990615467565b80156116b65780601f1061168b576101008083540402835291602001916116b6565b820191906000526020600020905b81548152906001019060200180831161169957829003601f168201915b505050505081565b6116c6612636565b60005b82829050811015611770573073ffffffffffffffffffffffffffffffffffffffff166342842e0e306116f961155d565b86868681811061170c5761170b6157e7565b5b905060200201356040518463ffffffff1660e01b815260040161173193929190615816565b600060405180830381600087803b15801561174b57600080fd5b505af115801561175f573d6000803e3d6000fd5b5050505080806001019150506116c9565b505050565b606061178284848461337a565b90509392505050565b611793612636565b80600660006101000a81548160ff02191690831515021790555050565b816117ba8161296c565b6117d6576117c6612973565b156117d5576117d48161297c565b5b5b6117e0838361355e565b505050565b600660009054906101000a900460ff1681565b833373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611852576118353361296c565b61185157611841612973565b156118505761184f3361297c565b5b5b5b600660029054906101000a900460ff16801561188b57506008600084815260200190815260200160002060009054906101000a900460ff165b156118c2576040517fa3292bd500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118ce85858585613672565b5050505050565b600060045442101580156118eb57506005544211155b905090565b6118f86136c4565b6119006118d5565b611936576040517f4d39fcb200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611988878787878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505061371b565b6119be576040517fa3402a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b84849050811015611b0357600760008686848181106119e3576119e26157e7565b5b90506020020160208101906119f89190614c50565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611a77576040517fa308b6e300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600160076000878785818110611a9057611a8f6157e7565b5b9050602002016020810190611aa59190614c50565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506119c1565b506000611b0e613367565b9050611b25888789611b20919061584d565b6130e5565b60005b86811015611b7b5760016008600083611b3f613807565b611b499190615881565b815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611b28565b508773ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f5f9e58d894248b707354c9e8bda0dcf30e32084288af8a0b27d396c2198747cb89898989878d8f8a611bdd919061584d565b611be7919061584d565b604051611bf996959493929190615969565b60405180910390a350611c0a613862565b50505050505050565b611c1b61455b565b611c236129d0565b8210611c8257611c316129d9565b821115611c4857611c418261387b565b9050611c83565b611c50613367565b821015611c81575b611c61826138af565b611c715781600190039150611c58565b611c7a8261387b565b9050611c83565b5b5b919050565b6060611c938261289b565b611ca857611ca763a14c4b5060e01b612962565b5b6000611cb26138d8565b90506000815103611cd25760405180602001604052806000815250611cfd565b80611cdc8461396a565b604051602001611ced929190615a01565b6040516020818303038152906040525b915050919050565b60076020528060005260406000206000915054906101000a900460ff1681565b60035481565b600660009054906101000a900460ff1615611d72576040517ff302244700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff16611d928261134b565b73ffffffffffffffffffffffffffffffffffffffff1614611ddf576040517ff3df485c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611de76139ba565b73ffffffffffffffffffffffffffffffffffffffff16611e068361134b565b73ffffffffffffffffffffffffffffffffffffffff1614611e53576040517f71d78b1200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e65611e5e6139ba565b3084612a01565b3073ffffffffffffffffffffffffffffffffffffffff166323b872dd30611e8a6139ba565b846040518463ffffffff1660e01b8152600401611ea993929190615816565b600060405180830381600087803b158015611ec357600080fd5b505af1158015611ed7573d6000803e3d6000fd5b50505050611ee36139ba565b73ffffffffffffffffffffffffffffffffffffffff167f82ce360ee1020ce141460af73d00dec45f239c7867e5fc3d9917f5c04e5840cc8383604051611f2a929190615a25565b60405180910390a25050565b611f3e612636565b60005b83839050811015611f9d578160086000868685818110611f6457611f636157e7565b5b90506020020135815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611f41565b50505050565b60003073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611fe15760019050611fee565b611feb83836139c2565b90505b92915050565b611ffc612636565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b612048612636565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036120ba5760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016120b1919061487f565b60405180910390fd5b6120c381613290565b50565b60006120d0613a5f565b905060008160000160089054906101000a900460ff1615905060008260000160009054906101000a900467ffffffffffffffff1690506000808267ffffffffffffffff1614801561211e5750825b9050600060018367ffffffffffffffff16148015612153575060003073ffffffffffffffffffffffffffffffffffffffff163b145b905081158015612161575080155b15612198576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018560000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555083156121e85760018560000160086101000a81548160ff0219169083151502179055505b6121f0613a87565b60000160019054906101000a900460ff166122245761220d613a87565b60000160009054906101000a900460ff161561222d565b61222c613ab4565b5b61226c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226390615ac0565b60405180910390fd5b6000612276613a87565b60000160019054906101000a900460ff1615905080156122d957600161229a613a87565b60000160016101000a81548160ff02191690831515021790555060016122be613a87565b60000160006101000a81548160ff0219169083151502179055505b61234d6040518060400160405280600781526020017f4a69726173616e000000000000000000000000000000000000000000000000008152506040518060400160405280600781526020017f4a49524153414e00000000000000000000000000000000000000000000000000815250613acb565b61235633613b31565b61235e613b45565b612366613b4f565b6001600660016101000a81548160ff02191690831515021790555061238d336101f46126bd565b866000908161239c9190615715565b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061271160038190555063669f2ac060048190555063689f69c66005819055506001600660026101000a81548160ff02191690831515021790555033600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600660006101000a81548160ff021916908315150217905550801561249f576000612484613a87565b60000160016101000a81548160ff0219169083151502179055505b5083156124fc5760008560000160086101000a81548160ff0219169083151502179055507fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d260016040516124f39190615b1b565b60405180910390a15b505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061258557506380ac58cd60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806125b55750635b5e139f60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b60007f2a55205a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061262f575061262e82613b70565b5b9050919050565b61263e613bda565b73ffffffffffffffffffffffffffffffffffffffff1661265c61155d565b73ffffffffffffffffffffffffffffffffffffffff16146126bb5761267f613bda565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016126b2919061487f565b60405180910390fd5b565b60006126c7612cf8565b905060006126d3612d20565b6bffffffffffffffffffffffff16905080836bffffffffffffffffffffffff1611156127385782816040517f6f483d0900000000000000000000000000000000000000000000000000000000815260040161272f929190615b67565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036127aa5760006040517fb6d9900a0000000000000000000000000000000000000000000000000000000081526004016127a1919061487f565b60405180910390fd5b60405180604001604052808573ffffffffffffffffffffffffffffffffffffffff168152602001846bffffffffffffffffffffffff168152508260000160008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555090505050505050565b6000807f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090508091505090565b6000816128a66129d0565b1161295c576128b36129d9565b8211156128e6576128df6128c561286e565b600401600084815260200190815260200160002054613be2565b905061295d565b6128ee61286e565b6000015482101561295b5760005b600061290661286e565b60040160008581526020019081526020016000205491508103612934578261292d90615b90565b92506128fc565b60007c01000000000000000000000000000000000000000000000000000000008216149150505b5b5b919050565b8060005260046000fd5b6000919050565b60006001905090565b69c617113400112233445560005230601a5280603a52600080604460166daaeb6d7670e522a718067333cd4e5afa6129b8573d6000803e3d6000fd5b6000603a5250565b6129cc82826001613c23565b5050565b60006001905090565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff905090565b6000612a0c82612fb1565b905073ffffffffffffffffffffffffffffffffffffffff8473ffffffffffffffffffffffffffffffffffffffff161693508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612a8157612a8063a114810060e01b612962565b5b600080612a8d84613d5b565b91509150612aa38187612a9e6139ba565b613d8b565b612ace57612ab886612ab36139ba565b611fa3565b612acd57612acc6359c896be60e01b612962565b5b5b612adb8686866001613dcf565b8015612ae657600082555b612aee61286e565b60050160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081546001900391905081905550612b4561286e565b60050160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815460010191905081905550612bc685612ba2888887613dd5565b7c020000000000000000000000000000000000000000000000000000000017613dfd565b612bce61286e565b60040160008681526020019081526020016000208190555060007c0200000000000000000000000000000000000000000000000000000000841603612c705760006001850190506000612c1f61286e565b60040160008381526020019081526020016000205403612c6e57612c4161286e565b600001548114612c6d5783612c5461286e565b6004016000838152602001908152602001600020819055505b5b505b600073ffffffffffffffffffffffffffffffffffffffff8673ffffffffffffffffffffffffffffffffffffffff161690508481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a460008103612ce257612ce163ea553b3460e01b612962565b5b612cef8787876001613e28565b50505050505050565b60007fdaedc9ab023613a7caf35e703657e986ccfad7e3eb0af93a2853f8d65dd86b00905090565b6000612710905090565b612d45838383604051806020016040528060008152506117f8565b505050565b6000612d5583612fb1565b90506000819050600080612d6886613d5b565b915091508415612db057612d848184612d7f6139ba565b613d8b565b612daf57612d9983612d946139ba565b611fa3565b612dae57612dad6359c896be60e01b612962565b5b5b5b612dbe836000886001613dcf565b8015612dc957600082555b600160806001901b03612dda61286e565b60050160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550612e7a83612e3785600088613dd5565b7c02000000000000000000000000000000000000000000000000000000007c01000000000000000000000000000000000000000000000000000000001717613dfd565b612e8261286e565b60040160008881526020019081526020016000208190555060007c0200000000000000000000000000000000000000000000000000000000851603612f245760006001870190506000612ed361286e565b60040160008381526020019081526020016000205403612f2257612ef561286e565b600001548114612f215784612f0861286e565b6004016000838152602001908152602001600020819055505b5b505b85600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612f8e836000886001613e28565b612f9661286e565b60010160008154809291906001019190505550505050505050565b600081612fbc6129d0565b116130cf57612fc961286e565b6004016000838152602001908152602001600020549050612fe86129d9565b82111561300d57612ff881613be2565b6130e05761300c63df2d9b4260e01b612962565b5b600081036130a65761301d61286e565b6000015482106130385761303763df2d9b4260e01b612962565b5b5b61304161286e565b60040160008360019003935083815260200190815260200160002054905060008103156130a15760007c0100000000000000000000000000000000000000000000000000000000821603156130e0576130a063df2d9b4260e01b612962565b5b613039565b60007c0100000000000000000000000000000000000000000000000000000000821603156130e0575b6130df63df2d9b4260e01b612962565b5b919050565b60006130ef61286e565b6000015490506000820361310e5761310d63b562e8dd60e01b612962565b5b61311b6000848385613dcf565b61313b8361312c6000866000613dd5565b61313585613e2e565b17613dfd565b61314361286e565b600401600083815260200190815260200160002081905550600160406001901b17820261316e61286e565b60050160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600073ffffffffffffffffffffffffffffffffffffffff8473ffffffffffffffffffffffffffffffffffffffff161690506000810361320557613204632e07630060e01b612962565b5b6000838301905060008390506132196129d9565b600183031115613234576132336381647e3a60e01b612962565b5b5b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4818160010191508103613235578161327461286e565b6000018190555050505061328b6000848385613e28565b505050565b600061329a613536565b905060008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050828260000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3505050565b600061337161286e565b60000154905090565b6060818310613394576133936332c1995a60e01b612962565b5b61339c6129d0565b8310156133ae576133ab6129d0565b92505b60006133b8613367565b905060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6133e56129d9565b036133f057816133f2565b835b90508084106133ff578093505b600061340a876113e3565b905084861061341857600090505b6000811461352c57808686031161342f5785850390505b600060405194506001820160051b8501905080604052600061345088611c13565b90506000816040015161346557816000015190505b60005b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6134916129d9565b146134c057868a036134ab5760016134a76129d9565b0199505b6134b36129d9565b8a11156134bf57600091505b5b6134c98a61387b565b92506040830151600081146134e15760009250613507565b8351156134ed57835192505b8b831860601b613506576001820191508a8260051b8a01525b5b5060018a01995083604052888a148061351f57508481145b1561346857808852505050505b5050509392505050565b60007f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300905090565b8061356761286e565b60070160006135746139ba565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff166136216139ba565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051613666919061465e565b60405180910390a35050565b61367d848484610e33565b60008373ffffffffffffffffffffffffffffffffffffffff163b146136be576136a884848484613e3e565b6136bd576136bc63d1a57ed660e01b612962565b5b5b50505050565b60006136ce613f6d565b9050600281600001540361370e576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002816000018190555050565b6000808787878787604051602001613734929190615bb9565b6040516020818303038152906040526040516020016137569493929190615c8d565b6040516020818303038152906040528051906020012090506000816040516020016137819190615d4e565b60405160208183030381529060405280519060200120905060006137a58286613f95565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161493505050509695505050505050565b60006138116129d0565b61381961286e565b600001540390507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6138496129d9565b1461385f5761385661286e565b60080154810190505b90565b600061386c613f6d565b90506001816000018190555050565b61388361455b565b6138a861388e61286e565b600401600084815260200190815260200160002054613fc1565b9050919050565b6000806138ba61286e565b60040160008481526020019081526020016000205414159050919050565b6060600080546138e790615467565b80601f016020809104026020016040519081016040528092919081815260200182805461391390615467565b80156139605780601f1061393557610100808354040283529160200191613960565b820191906000526020600020905b81548152906001019060200180831161394357829003601f168201915b5050505050905090565b606060a060405101806040526020810391506000825281835b6001156139a557600184039350600a81066030018453600a8104905080613983575b50828103602084039350808452505050919050565b600033905090565b60006139cc61286e565b60070160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60007ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00905090565b6000807fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f90508091505090565b6000803090506000813b9050600081149250505090565b613ad3613a87565b60000160019054906101000a900460ff16613b23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613b1a90615de6565b60405180910390fd5b613b2d8282614077565b5050565b613b39614143565b613b4281614183565b50565b613b4d614143565b565b613b6e733cc6cdda760b79bafa08df41ecfa224f810dceb66001614209565b565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600033905090565b60007c0100000000000000000000000000000000000000000000000000000000821673ffffffffffffffffffffffffffffffffffffffff8316119050919050565b6000613c2e8361134b565b9050818015613c7057508073ffffffffffffffffffffffffffffffffffffffff16613c576139ba565b73ffffffffffffffffffffffffffffffffffffffff1614155b15613c9c57613c8681613c816139ba565b611fa3565b613c9b57613c9a63cfb3b94260e01b612962565b5b5b83613ca561286e565b600601600085815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a450505050565b6000806000613d6861286e565b600601600085815260200190815260200160002090508092508254915050915091565b600073ffffffffffffffffffffffffffffffffffffffff8316925073ffffffffffffffffffffffffffffffffffffffff821691508382148383141790509392505050565b50505050565b60008060e883901c905060e8613dec86868461427e565b62ffffff16901b9150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff83169250814260a01b178317905092915050565b50505050565b60006001821460e11b9050919050565b60008373ffffffffffffffffffffffffffffffffffffffff1663150b7a02613e646139ba565b8786866040518563ffffffff1660e01b8152600401613e869493929190615e50565b6020604051808303816000875af1925050508015613ec257506040513d601f19601f82011682018060405250810190613ebf9190615eb1565b60015b613f1a573d8060008114613ef2576040519150601f19603f3d011682016040523d82523d6000602084013e613ef7565b606091505b506000815103613f1257613f1163d1a57ed660e01b612962565b5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b60007f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00905090565b600080600080613fa58686614287565b925092509250613fb582826142e3565b82935050505092915050565b613fc961455b565b81816000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060a082901c816020019067ffffffffffffffff16908167ffffffffffffffff168152505060007c01000000000000000000000000000000000000000000000000000000008316141581604001901515908115158152505060e882901c816060019062ffffff16908162ffffff1681525050919050565b61407f613a87565b60000160019054906101000a900460ff166140cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016140c690615de6565b60405180910390fd5b816140d861286e565b60020190816140e79190615715565b50806140f161286e565b60030190816141009190615715565b506141096129d0565b61411161286e565b600001819055506141206129d0565b6141286129d9565b101561413f5761413e63fed8210f60e01b612962565b5b5050565b61414b614447565b614181576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b61418b614143565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036141fd5760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016141f4919061487f565b60405180910390fd5b61420681613290565b50565b637d3e3dbe8260601b60601c925081614235578261422d57634420e4869050614235565b63a0af290390505b8060e01b60005230600452826024526004600060446000806daaeb6d7670e522a718067333cd4e5af1614274578060005160e01c0361427357600080fd5b5b6000602452505050565b60009392505050565b600080600060418451036142cc5760008060006020870151925060408701519150606087015160001a90506142be88828585614467565b9550955095505050506142dc565b60006002855160001b9250925092505b9250925092565b600060038111156142f7576142f6615ede565b5b82600381111561430a57614309615ede565b5b0315614443576001600381111561432457614323615ede565b5b82600381111561433757614336615ede565b5b0361436e576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600381111561438257614381615ede565b5b82600381111561439557614394615ede565b5b036143da578060001c6040517ffce698f70000000000000000000000000000000000000000000000000000000081526004016143d19190614a40565b60405180910390fd5b6003808111156143ed576143ec615ede565b5b826003811115614400576143ff615ede565b5b0361444257806040517fd78bce0c0000000000000000000000000000000000000000000000000000000081526004016144399190615f1c565b60405180910390fd5b5b5050565b6000614451613a5f565b60000160089054906101000a900460ff16905090565b60008060007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08460001c11156144a7576000600385925092509250614551565b6000600188888888604051600081526020016040526040516144cc9493929190615f53565b6020604051602081039080840390855afa1580156144ee573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361454257600060016000801b93509350935050614551565b8060008060001b935093509350505b9450945094915050565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600067ffffffffffffffff168152602001600015158152602001600062ffffff1681525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6145f3816145be565b81146145fe57600080fd5b50565b600081359050614610816145ea565b92915050565b60006020828403121561462c5761462b6145b4565b5b600061463a84828501614601565b91505092915050565b60008115159050919050565b61465881614643565b82525050565b6000602082019050614673600083018461464f565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006146a482614679565b9050919050565b6146b481614699565b81146146bf57600080fd5b50565b6000813590506146d1816146ab565b92915050565b60006bffffffffffffffffffffffff82169050919050565b6146f8816146d7565b811461470357600080fd5b50565b600081359050614715816146ef565b92915050565b60008060408385031215614732576147316145b4565b5b6000614740858286016146c2565b925050602061475185828601614706565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561479557808201518184015260208101905061477a565b60008484015250505050565b6000601f19601f8301169050919050565b60006147bd8261475b565b6147c78185614766565b93506147d7818560208601614777565b6147e0816147a1565b840191505092915050565b6000602082019050818103600083015261480581846147b2565b905092915050565b6000819050919050565b6148208161480d565b811461482b57600080fd5b50565b60008135905061483d81614817565b92915050565b600060208284031215614859576148586145b4565b5b60006148678482850161482e565b91505092915050565b61487981614699565b82525050565b60006020820190506148946000830184614870565b92915050565b600080604083850312156148b1576148b06145b4565b5b60006148bf858286016146c2565b92505060206148d08582860161482e565b9150509250929050565b600080604083850312156148f1576148f06145b4565b5b60006148ff8582860161482e565b92505060206149108582860161482e565b9150509250929050565b600080fd5b600080fd5b600080fd5b60008083601f84011261493f5761493e61491a565b5b8235905067ffffffffffffffff81111561495c5761495b61491f565b5b60208301915083600182028301111561497857614977614924565b5b9250929050565b60008060008060006080868803121561499b5761499a6145b4565b5b60006149a9888289016146c2565b95505060206149ba888289016146c2565b94505060406149cb8882890161482e565b935050606086013567ffffffffffffffff8111156149ec576149eb6145b9565b5b6149f888828901614929565b92509250509295509295909350565b614a10816145be565b82525050565b6000602082019050614a2b6000830184614a07565b92915050565b614a3a8161480d565b82525050565b6000602082019050614a556000830184614a31565b92915050565b600080600060608486031215614a7457614a736145b4565b5b6000614a82868287016146c2565b9350506020614a93868287016146c2565b9250506040614aa48682870161482e565b9150509250925092565b6000604082019050614ac36000830185614870565b614ad06020830184614a31565b9392505050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b614b14826147a1565b810181811067ffffffffffffffff82111715614b3357614b32614adc565b5b80604052505050565b6000614b466145aa565b9050614b528282614b0b565b919050565b600067ffffffffffffffff821115614b7257614b71614adc565b5b614b7b826147a1565b9050602081019050919050565b82818337600083830152505050565b6000614baa614ba584614b57565b614b3c565b905082815260208101848484011115614bc657614bc5614ad7565b5b614bd1848285614b88565b509392505050565b600082601f830112614bee57614bed61491a565b5b8135614bfe848260208601614b97565b91505092915050565b600060208284031215614c1d57614c1c6145b4565b5b600082013567ffffffffffffffff811115614c3b57614c3a6145b9565b5b614c4784828501614bd9565b91505092915050565b600060208284031215614c6657614c656145b4565b5b6000614c74848285016146c2565b91505092915050565b60008083601f840112614c9357614c9261491a565b5b8235905067ffffffffffffffff811115614cb057614caf61491f565b5b602083019150836020820283011115614ccc57614ccb614924565b5b9250929050565b60008060208385031215614cea57614ce96145b4565b5b600083013567ffffffffffffffff811115614d0857614d076145b9565b5b614d1485828601614c7d565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b614d5581614699565b82525050565b600067ffffffffffffffff82169050919050565b614d7881614d5b565b82525050565b614d8781614643565b82525050565b600062ffffff82169050919050565b614da581614d8d565b82525050565b608082016000820151614dc16000850182614d4c565b506020820151614dd46020850182614d6f565b506040820151614de76040850182614d7e565b506060820151614dfa6060850182614d9c565b50505050565b6000614e0c8383614dab565b60808301905092915050565b6000602082019050919050565b6000614e3082614d20565b614e3a8185614d2b565b9350614e4583614d3c565b8060005b83811015614e76578151614e5d8882614e00565b9750614e6883614e18565b925050600181019050614e49565b5085935050505092915050565b60006020820190508181036000830152614e9d8184614e25565b905092915050565b60008083601f840112614ebb57614eba61491a565b5b8235905067ffffffffffffffff811115614ed857614ed761491f565b5b602083019150836020820283011115614ef457614ef3614924565b5b9250929050565b60008060008060408587031215614f1557614f146145b4565b5b600085013567ffffffffffffffff811115614f3357614f326145b9565b5b614f3f87828801614ea5565b9450945050602085013567ffffffffffffffff811115614f6257614f616145b9565b5b614f6e87828801614c7d565b925092505092959194509250565b614f8581614643565b8114614f9057600080fd5b50565b600081359050614fa281614f7c565b92915050565b600060208284031215614fbe57614fbd6145b4565b5b6000614fcc84828501614f93565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61500a8161480d565b82525050565b600061501c8383615001565b60208301905092915050565b6000602082019050919050565b600061504082614fd5565b61504a8185614fe0565b935061505583614ff1565b8060005b8381101561508657815161506d8882615010565b975061507883615028565b925050600181019050615059565b5085935050505092915050565b600060208201905081810360008301526150ad8184615035565b905092915050565b6000806000606084860312156150ce576150cd6145b4565b5b60006150dc868287016146c2565b93505060206150ed8682870161482e565b92505060406150fe8682870161482e565b9150509250925092565b6000806040838503121561511f5761511e6145b4565b5b600061512d858286016146c2565b925050602061513e85828601614f93565b9150509250929050565b600067ffffffffffffffff82111561516357615162614adc565b5b61516c826147a1565b9050602081019050919050565b600061518c61518784615148565b614b3c565b9050828152602081018484840111156151a8576151a7614ad7565b5b6151b3848285614b88565b509392505050565b600082601f8301126151d0576151cf61491a565b5b81356151e0848260208601615179565b91505092915050565b60008060008060808587031215615203576152026145b4565b5b6000615211878288016146c2565b9450506020615222878288016146c2565b93505060406152338782880161482e565b925050606085013567ffffffffffffffff811115615254576152536145b9565b5b615260878288016151bb565b91505092959194509250565b600080600080600080600060a0888a03121561528b5761528a6145b4565b5b60006152998a828b016146c2565b97505060206152aa8a828b0161482e565b96505060406152bb8a828b0161482e565b955050606088013567ffffffffffffffff8111156152dc576152db6145b9565b5b6152e88a828b01614ea5565b9450945050608088013567ffffffffffffffff81111561530b5761530a6145b9565b5b6153178a828b01614929565b925092505092959891949750929550565b60808201600082015161533e6000850182614d4c565b5060208201516153516020850182614d6f565b5060408201516153646040850182614d7e565b5060608201516153776060850182614d9c565b50505050565b60006080820190506153926000830184615328565b92915050565b6000806000604084860312156153b1576153b06145b4565b5b600084013567ffffffffffffffff8111156153cf576153ce6145b9565b5b6153db86828701614c7d565b935093505060206153ee86828701614f93565b9150509250925092565b6000806040838503121561540f5761540e6145b4565b5b600061541d858286016146c2565b925050602061542e858286016146c2565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061547f57607f821691505b60208210810361549257615491615438565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006154d28261480d565b91506154dd8361480d565b92508282026154eb8161480d565b9150828204841483151761550257615501615498565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006155438261480d565b915061554e8361480d565b92508261555e5761555d615509565b5b828204905092915050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026155cb7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8261558e565b6155d5868361558e565b95508019841693508086168417925050509392505050565b6000819050919050565b600061561261560d6156088461480d565b6155ed565b61480d565b9050919050565b6000819050919050565b61562c836155f7565b61564061563882615619565b84845461559b565b825550505050565b600090565b615655615648565b615660818484615623565b505050565b5b818110156156845761567960008261564d565b600181019050615666565b5050565b601f8211156156c95761569a81615569565b6156a38461557e565b810160208510156156b2578190505b6156c66156be8561557e565b830182615665565b50505b505050565b600082821c905092915050565b60006156ec600019846008026156ce565b1980831691505092915050565b600061570583836156db565b9150826002028217905092915050565b61571e8261475b565b67ffffffffffffffff81111561573757615736614adc565b5b6157418254615467565b61574c828285615688565b600060209050601f83116001811461577f576000841561576d578287015190505b61577785826156f9565b8655506157df565b601f19841661578d86615569565b60005b828110156157b557848901518255600182019150602085019450602081019050615790565b868310156157d257848901516157ce601f8916826156db565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060608201905061582b6000830186614870565b6158386020830185614870565b6158456040830184614a31565b949350505050565b60006158588261480d565b91506158638361480d565b925082820190508082111561587b5761587a615498565b5b92915050565b600061588c8261480d565b91506158978361480d565b92508282039050818111156158af576158ae615498565b5b92915050565b600082825260208201905092915050565b6000819050919050565b60006158dc8383614d4c565b60208301905092915050565b60006158f760208401846146c2565b905092915050565b6000602082019050919050565b600061591883856158b5565b9350615923826158c6565b8060005b8581101561595c5761593982846158e8565b61594388826158d0565b975061594e836158ff565b925050600181019050615927565b5085925050509392505050565b600060a08201905061597e6000830189614a31565b61598b6020830188614a31565b818103604083015261599e81868861590c565b90506159ad6060830185614a31565b6159ba6080830184614a31565b979650505050505050565b600081905092915050565b60006159db8261475b565b6159e581856159c5565b93506159f5818560208601614777565b80840191505092915050565b6000615a0d82856159d0565b9150615a1982846159d0565b91508190509392505050565b6000604082019050615a3a6000830185614a31565b615a476020830184614a31565b9392505050565b7f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460008201527f20697320616c726561647920696e697469616c697a6564000000000000000000602082015250565b6000615aaa603783614766565b9150615ab582615a4e565b604082019050919050565b60006020820190508181036000830152615ad981615a9d565b9050919050565b6000819050919050565b6000615b05615b00615afb84615ae0565b6155ed565b614d5b565b9050919050565b615b1581615aea565b82525050565b6000602082019050615b306000830184615b0c565b92915050565b6000615b51615b4c615b47846146d7565b6155ed565b61480d565b9050919050565b615b6181615b36565b82525050565b6000604082019050615b7c6000830185615b58565b615b896020830184614a31565b9392505050565b6000615b9b8261480d565b915060008203615bae57615bad615498565b5b600182039050919050565b60006020820190508181036000830152615bd481848661590c565b90509392505050565b60008160601b9050919050565b6000615bf582615bdd565b9050919050565b6000615c0782615bea565b9050919050565b615c1f615c1a82614699565b615bfc565b82525050565b6000819050919050565b615c40615c3b8261480d565b615c25565b82525050565b600081519050919050565b600081905092915050565b6000615c6782615c46565b615c718185615c51565b9350615c81818560208601614777565b80840191505092915050565b6000615c998287615c0e565b601482019150615ca98286615c2f565b602082019150615cb98285615c2f565b602082019150615cc98284615c5c565b915081905095945050505050565b7f19457468657265756d205369676e6564204d6573736167653a0a333200000000600082015250565b6000615d0d601c836159c5565b9150615d1882615cd7565b601c82019050919050565b6000819050919050565b6000819050919050565b615d48615d4382615d23565b615d2d565b82525050565b6000615d5982615d00565b9150615d658284615d37565b60208201915081905092915050565b7f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460008201527f206973206e6f7420696e697469616c697a696e67000000000000000000000000602082015250565b6000615dd0603483614766565b9150615ddb82615d74565b604082019050919050565b60006020820190508181036000830152615dff81615dc3565b9050919050565b600082825260208201905092915050565b6000615e2282615c46565b615e2c8185615e06565b9350615e3c818560208601614777565b615e45816147a1565b840191505092915050565b6000608082019050615e656000830187614870565b615e726020830186614870565b615e7f6040830185614a31565b8181036060830152615e918184615e17565b905095945050505050565b600081519050615eab816145ea565b92915050565b600060208284031215615ec757615ec66145b4565b5b6000615ed584828501615e9c565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b615f1681615d23565b82525050565b6000602082019050615f316000830184615f0d565b92915050565b600060ff82169050919050565b615f4d81615f37565b82525050565b6000608082019050615f686000830187615f0d565b615f756020830186615f44565b615f826040830185615f0d565b615f8f6060830184615f0d565b9594505050505056fea264697066735822122027f2b7a1624f0c5cdc585691e69d86b01557e5a49fb9521c0abe47275e680aa964736f6c63430008180033
Deployed Bytecode
0x6080604052600436106102c95760003560e01c80638403d44f11610175578063b8f7a665116100dc578063d96073cf11610095578063f0f442601161006f578063f0f4426014610b17578063f2fde38b14610b40578063f62d188814610b69578063f74d548014610b92576102c9565b8063d96073cf14610a88578063e10f8aad14610ab1578063e985e9c514610ada576102c9565b8063b8f7a66514610952578063bbce87161461097d578063c23dc68f146109a6578063c87b56dd146109e3578063c884ef8314610a20578063d5abeb0114610a5d576102c9565b8063983d95ce1161012e578063983d95ce1461085357806399a2557a1461087c5780639a21d11a146108b9578063a22cb465146108e2578063ae2ef2711461090b578063b88d4fde14610936576102c9565b80638403d44f146107415780638462151c1461076a5780638622a689146107a75780638da5cb5b146107d257806395d89b41146107fd57806397d4ccd214610828576102c9565b8063462159ff1161023457806361d027b3116101ed5780636f8b44b0116101c75780636f8b44b01461068757806370a08231146106b0578063715018a6146106ed5780637a18159714610704576102c9565b806361d027b3146105f65780636352211e14610621578063672434821461065e576102c9565b8063462159ff146104e857806353f8bb9a1461051357806355f804b31461053e57806356a1c70114610567578063598b8e71146105905780635bbb2177146105b9576102c9565b8063150b7a0211610286578063150b7a02146103e157806318160ddd1461041e57806323b872dd146104495780632a55205a1461046557806342842e0e146104a357806342966c68146104bf576102c9565b806301ffc9a7146102ce57806304634d8d1461030b57806306fdde0314610334578063081812fc1461035f578063095ea7b31461039c5780630f867751146103b8575b600080fd5b3480156102da57600080fd5b506102f560048036038101906102f09190614616565b610bbd565b604051610302919061465e565b60405180910390f35b34801561031757600080fd5b50610332600480360381019061032d919061471b565b610bdf565b005b34801561034057600080fd5b50610349610bf5565b60405161035691906147eb565b60405180910390f35b34801561036b57600080fd5b5061038660048036038101906103819190614843565b610c90565b604051610393919061487f565b60405180910390f35b6103b660048036038101906103b1919061489a565b610cf7565b005b3480156103c457600080fd5b506103df60048036038101906103da91906148da565b610d9c565b005b3480156103ed57600080fd5b506104086004803603810190610403919061497f565b610db6565b6040516104159190614a16565b60405180910390f35b34801561042a57600080fd5b50610433610dcb565b6040516104409190614a40565b60405180910390f35b610463600480360381019061045e9190614a5b565b610e33565b005b34801561047157600080fd5b5061048c600480360381019061048791906148da565b610f0e565b60405161049a929190614aae565b60405180910390f35b6104bd60048036038101906104b89190614a5b565b611109565b005b3480156104cb57600080fd5b506104e660048036038101906104e19190614843565b6111e4565b005b3480156104f457600080fd5b506104fd6111f2565b60405161050a919061465e565b60405180910390f35b34801561051f57600080fd5b50610528611205565b6040516105359190614a40565b60405180910390f35b34801561054a57600080fd5b5061056560048036038101906105609190614c07565b61120b565b005b34801561057357600080fd5b5061058e60048036038101906105899190614c50565b611226565b005b34801561059c57600080fd5b506105b760048036038101906105b29190614cd3565b611272565b005b3480156105c557600080fd5b506105e060048036038101906105db9190614cd3565b6112c5565b6040516105ed9190614e83565b60405180910390f35b34801561060257600080fd5b5061060b611325565b604051610618919061487f565b60405180910390f35b34801561062d57600080fd5b5061064860048036038101906106439190614843565b61134b565b604051610655919061487f565b60405180910390f35b34801561066a57600080fd5b5061068560048036038101906106809190614efb565b61135d565b005b34801561069357600080fd5b506106ae60048036038101906106a99190614843565b6113d1565b005b3480156106bc57600080fd5b506106d760048036038101906106d29190614c50565b6113e3565b6040516106e49190614a40565b60405180910390f35b3480156106f957600080fd5b50610702611483565b005b34801561071057600080fd5b5061072b60048036038101906107269190614843565b611497565b604051610738919061465e565b60405180910390f35b34801561074d57600080fd5b5061076860048036038101906107639190614fa8565b6114b7565b005b34801561077657600080fd5b50610791600480360381019061078c9190614c50565b6114dc565b60405161079e9190615093565b60405180910390f35b3480156107b357600080fd5b506107bc611557565b6040516107c99190614a40565b60405180910390f35b3480156107de57600080fd5b506107e761155d565b6040516107f4919061487f565b60405180910390f35b34801561080957600080fd5b50610812611595565b60405161081f91906147eb565b60405180910390f35b34801561083457600080fd5b5061083d611630565b60405161084a91906147eb565b60405180910390f35b34801561085f57600080fd5b5061087a60048036038101906108759190614cd3565b6116be565b005b34801561088857600080fd5b506108a3600480360381019061089e91906150b5565b611775565b6040516108b09190615093565b60405180910390f35b3480156108c557600080fd5b506108e060048036038101906108db9190614fa8565b61178b565b005b3480156108ee57600080fd5b5061090960048036038101906109049190615108565b6117b0565b005b34801561091757600080fd5b506109206117e5565b60405161092d919061465e565b60405180910390f35b610950600480360381019061094b91906151e9565b6117f8565b005b34801561095e57600080fd5b506109676118d5565b604051610974919061465e565b60405180910390f35b34801561098957600080fd5b506109a4600480360381019061099f919061526c565b6118f0565b005b3480156109b257600080fd5b506109cd60048036038101906109c89190614843565b611c13565b6040516109da919061537d565b60405180910390f35b3480156109ef57600080fd5b50610a0a6004803603810190610a059190614843565b611c88565b604051610a1791906147eb565b60405180910390f35b348015610a2c57600080fd5b50610a476004803603810190610a429190614c50565b611d05565b604051610a54919061465e565b60405180910390f35b348015610a6957600080fd5b50610a72611d25565b604051610a7f9190614a40565b60405180910390f35b348015610a9457600080fd5b50610aaf6004803603810190610aaa91906148da565b611d2b565b005b348015610abd57600080fd5b50610ad86004803603810190610ad39190615398565b611f36565b005b348015610ae657600080fd5b50610b016004803603810190610afc91906153f8565b611fa3565b604051610b0e919061465e565b60405180910390f35b348015610b2357600080fd5b50610b3e6004803603810190610b399190614c50565b611ff4565b005b348015610b4c57600080fd5b50610b676004803603810190610b629190614c50565b612040565b005b348015610b7557600080fd5b50610b906004803603810190610b8b9190614c07565b6120c6565b005b348015610b9e57600080fd5b50610ba7612504565b604051610bb4919061487f565b60405180910390f35b6000610bc88261252a565b80610bd85750610bd7826125bc565b5b9050919050565b610be7612636565b610bf182826126bd565b5050565b6060610bff61286e565b6002018054610c0d90615467565b80601f0160208091040260200160405190810160405280929190818152602001828054610c3990615467565b8015610c865780601f10610c5b57610100808354040283529160200191610c86565b820191906000526020600020905b815481529060010190602001808311610c6957829003601f168201915b5050505050905090565b6000610c9b8261289b565b610cb057610caf63cf4700e460e01b612962565b5b610cb861286e565b600601600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b81610d018161296c565b610d1d57610d0d612973565b15610d1c57610d1b8161297c565b5b5b600660029054906101000a900460ff168015610d5657506008600083815260200190815260200160002060009054906101000a900460ff165b15610d8d576040517fa3292bd500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d9783836129c0565b505050565b610da4612636565b81600481905550806005819055505050565b600063150b7a0260e01b905095945050505050565b6000610dd56129d0565b610ddd61286e565b60010154610de961286e565b60000154030390507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610e1a6129d9565b14610e3057610e2761286e565b60080154810190505b90565b823373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610e8d57610e703361296c565b610e8c57610e7c612973565b15610e8b57610e8a3361297c565b5b5b5b600660029054906101000a900460ff168015610ec657506008600083815260200190815260200160002060009054906101000a900460ff165b15610efd576040517fa3292bd500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f08848484612a01565b50505050565b6000806000610f1b612cf8565b905060008160010160008781526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff16036110b357816000016040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff168152505090505b60006110bd612d20565b6bffffffffffffffffffffffff1682602001516bffffffffffffffffffffffff16876110e991906154c7565b6110f39190615538565b9050816000015181945094505050509250929050565b823373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611163576111463361296c565b61116257611152612973565b15611161576111603361297c565b5b5b5b600660029054906101000a900460ff16801561119c57506008600083815260200190815260200160002060009054906101000a900460ff165b156111d3576040517fa3292bd500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111de848484612d2a565b50505050565b6111ef816001612d4a565b50565b600660029054906101000a900460ff1681565b60045481565b611213612636565b80600090816112229190615715565b5050565b61122e612636565b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61127a612636565b60005b828290508110156112c0576112b361129361155d565b308585858181106112a7576112a66157e7565b5b90506020020135611109565b808060010191505061127d565b505050565b606080600084849050905060405191508082528060051b90508060208301016040525b6000811461131a576000602082039150818601359050600061130982611c13565b9050808360208601015250506112e8565b819250505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061135682612fb1565b9050919050565b611365612636565b60005b848490508110156113ca576113bd858583818110611389576113886157e7565b5b905060200201602081019061139e9190614c50565b8484848181106113b1576113b06157e7565b5b905060200201356130e5565b8080600101915050611368565b5050505050565b6113d9612636565b8060038190555050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361142957611428638f4eb60460e01b612962565b5b67ffffffffffffffff61143a61286e565b60050160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054169050919050565b61148b612636565b6114956000613290565b565b60086020528060005260406000206000915054906101000a900460ff1681565b6114bf612636565b80600660026101000a81548160ff02191690831515021790555050565b60607fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6115076129d9565b1461151d5761151c63bdba09d760e01b612962565b5b60006115276129d0565b90506000611533613367565b9050606081831461154c5761154985848461337a565b90505b809350505050919050565b60055481565b600080611568613536565b90508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691505090565b606061159f61286e565b60030180546115ad90615467565b80601f01602080910402602001604051908101604052809291908181526020018280546115d990615467565b80156116265780601f106115fb57610100808354040283529160200191611626565b820191906000526020600020905b81548152906001019060200180831161160957829003601f168201915b5050505050905090565b6000805461163d90615467565b80601f016020809104026020016040519081016040528092919081815260200182805461166990615467565b80156116b65780601f1061168b576101008083540402835291602001916116b6565b820191906000526020600020905b81548152906001019060200180831161169957829003601f168201915b505050505081565b6116c6612636565b60005b82829050811015611770573073ffffffffffffffffffffffffffffffffffffffff166342842e0e306116f961155d565b86868681811061170c5761170b6157e7565b5b905060200201356040518463ffffffff1660e01b815260040161173193929190615816565b600060405180830381600087803b15801561174b57600080fd5b505af115801561175f573d6000803e3d6000fd5b5050505080806001019150506116c9565b505050565b606061178284848461337a565b90509392505050565b611793612636565b80600660006101000a81548160ff02191690831515021790555050565b816117ba8161296c565b6117d6576117c6612973565b156117d5576117d48161297c565b5b5b6117e0838361355e565b505050565b600660009054906101000a900460ff1681565b833373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611852576118353361296c565b61185157611841612973565b156118505761184f3361297c565b5b5b5b600660029054906101000a900460ff16801561188b57506008600084815260200190815260200160002060009054906101000a900460ff165b156118c2576040517fa3292bd500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118ce85858585613672565b5050505050565b600060045442101580156118eb57506005544211155b905090565b6118f86136c4565b6119006118d5565b611936576040517f4d39fcb200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611988878787878787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505061371b565b6119be576040517fa3402a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b84849050811015611b0357600760008686848181106119e3576119e26157e7565b5b90506020020160208101906119f89190614c50565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611a77576040517fa308b6e300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600160076000878785818110611a9057611a8f6157e7565b5b9050602002016020810190611aa59190614c50565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506119c1565b506000611b0e613367565b9050611b25888789611b20919061584d565b6130e5565b60005b86811015611b7b5760016008600083611b3f613807565b611b499190615881565b815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611b28565b508773ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f5f9e58d894248b707354c9e8bda0dcf30e32084288af8a0b27d396c2198747cb89898989878d8f8a611bdd919061584d565b611be7919061584d565b604051611bf996959493929190615969565b60405180910390a350611c0a613862565b50505050505050565b611c1b61455b565b611c236129d0565b8210611c8257611c316129d9565b821115611c4857611c418261387b565b9050611c83565b611c50613367565b821015611c81575b611c61826138af565b611c715781600190039150611c58565b611c7a8261387b565b9050611c83565b5b5b919050565b6060611c938261289b565b611ca857611ca763a14c4b5060e01b612962565b5b6000611cb26138d8565b90506000815103611cd25760405180602001604052806000815250611cfd565b80611cdc8461396a565b604051602001611ced929190615a01565b6040516020818303038152906040525b915050919050565b60076020528060005260406000206000915054906101000a900460ff1681565b60035481565b600660009054906101000a900460ff1615611d72576040517ff302244700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff16611d928261134b565b73ffffffffffffffffffffffffffffffffffffffff1614611ddf576040517ff3df485c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611de76139ba565b73ffffffffffffffffffffffffffffffffffffffff16611e068361134b565b73ffffffffffffffffffffffffffffffffffffffff1614611e53576040517f71d78b1200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e65611e5e6139ba565b3084612a01565b3073ffffffffffffffffffffffffffffffffffffffff166323b872dd30611e8a6139ba565b846040518463ffffffff1660e01b8152600401611ea993929190615816565b600060405180830381600087803b158015611ec357600080fd5b505af1158015611ed7573d6000803e3d6000fd5b50505050611ee36139ba565b73ffffffffffffffffffffffffffffffffffffffff167f82ce360ee1020ce141460af73d00dec45f239c7867e5fc3d9917f5c04e5840cc8383604051611f2a929190615a25565b60405180910390a25050565b611f3e612636565b60005b83839050811015611f9d578160086000868685818110611f6457611f636157e7565b5b90506020020135815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611f41565b50505050565b60003073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611fe15760019050611fee565b611feb83836139c2565b90505b92915050565b611ffc612636565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b612048612636565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036120ba5760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016120b1919061487f565b60405180910390fd5b6120c381613290565b50565b60006120d0613a5f565b905060008160000160089054906101000a900460ff1615905060008260000160009054906101000a900467ffffffffffffffff1690506000808267ffffffffffffffff1614801561211e5750825b9050600060018367ffffffffffffffff16148015612153575060003073ffffffffffffffffffffffffffffffffffffffff163b145b905081158015612161575080155b15612198576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018560000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555083156121e85760018560000160086101000a81548160ff0219169083151502179055505b6121f0613a87565b60000160019054906101000a900460ff166122245761220d613a87565b60000160009054906101000a900460ff161561222d565b61222c613ab4565b5b61226c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226390615ac0565b60405180910390fd5b6000612276613a87565b60000160019054906101000a900460ff1615905080156122d957600161229a613a87565b60000160016101000a81548160ff02191690831515021790555060016122be613a87565b60000160006101000a81548160ff0219169083151502179055505b61234d6040518060400160405280600781526020017f4a69726173616e000000000000000000000000000000000000000000000000008152506040518060400160405280600781526020017f4a49524153414e00000000000000000000000000000000000000000000000000815250613acb565b61235633613b31565b61235e613b45565b612366613b4f565b6001600660016101000a81548160ff02191690831515021790555061238d336101f46126bd565b866000908161239c9190615715565b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061271160038190555063669f2ac060048190555063689f69c66005819055506001600660026101000a81548160ff02191690831515021790555033600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600660006101000a81548160ff021916908315150217905550801561249f576000612484613a87565b60000160016101000a81548160ff0219169083151502179055505b5083156124fc5760008560000160086101000a81548160ff0219169083151502179055507fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d260016040516124f39190615b1b565b60405180910390a15b505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061258557506380ac58cd60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806125b55750635b5e139f60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b60007f2a55205a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061262f575061262e82613b70565b5b9050919050565b61263e613bda565b73ffffffffffffffffffffffffffffffffffffffff1661265c61155d565b73ffffffffffffffffffffffffffffffffffffffff16146126bb5761267f613bda565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016126b2919061487f565b60405180910390fd5b565b60006126c7612cf8565b905060006126d3612d20565b6bffffffffffffffffffffffff16905080836bffffffffffffffffffffffff1611156127385782816040517f6f483d0900000000000000000000000000000000000000000000000000000000815260040161272f929190615b67565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036127aa5760006040517fb6d9900a0000000000000000000000000000000000000000000000000000000081526004016127a1919061487f565b60405180910390fd5b60405180604001604052808573ffffffffffffffffffffffffffffffffffffffff168152602001846bffffffffffffffffffffffff168152508260000160008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555090505050505050565b6000807f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090508091505090565b6000816128a66129d0565b1161295c576128b36129d9565b8211156128e6576128df6128c561286e565b600401600084815260200190815260200160002054613be2565b905061295d565b6128ee61286e565b6000015482101561295b5760005b600061290661286e565b60040160008581526020019081526020016000205491508103612934578261292d90615b90565b92506128fc565b60007c01000000000000000000000000000000000000000000000000000000008216149150505b5b5b919050565b8060005260046000fd5b6000919050565b60006001905090565b69c617113400112233445560005230601a5280603a52600080604460166daaeb6d7670e522a718067333cd4e5afa6129b8573d6000803e3d6000fd5b6000603a5250565b6129cc82826001613c23565b5050565b60006001905090565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff905090565b6000612a0c82612fb1565b905073ffffffffffffffffffffffffffffffffffffffff8473ffffffffffffffffffffffffffffffffffffffff161693508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612a8157612a8063a114810060e01b612962565b5b600080612a8d84613d5b565b91509150612aa38187612a9e6139ba565b613d8b565b612ace57612ab886612ab36139ba565b611fa3565b612acd57612acc6359c896be60e01b612962565b5b5b612adb8686866001613dcf565b8015612ae657600082555b612aee61286e565b60050160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081546001900391905081905550612b4561286e565b60050160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815460010191905081905550612bc685612ba2888887613dd5565b7c020000000000000000000000000000000000000000000000000000000017613dfd565b612bce61286e565b60040160008681526020019081526020016000208190555060007c0200000000000000000000000000000000000000000000000000000000841603612c705760006001850190506000612c1f61286e565b60040160008381526020019081526020016000205403612c6e57612c4161286e565b600001548114612c6d5783612c5461286e565b6004016000838152602001908152602001600020819055505b5b505b600073ffffffffffffffffffffffffffffffffffffffff8673ffffffffffffffffffffffffffffffffffffffff161690508481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a460008103612ce257612ce163ea553b3460e01b612962565b5b612cef8787876001613e28565b50505050505050565b60007fdaedc9ab023613a7caf35e703657e986ccfad7e3eb0af93a2853f8d65dd86b00905090565b6000612710905090565b612d45838383604051806020016040528060008152506117f8565b505050565b6000612d5583612fb1565b90506000819050600080612d6886613d5b565b915091508415612db057612d848184612d7f6139ba565b613d8b565b612daf57612d9983612d946139ba565b611fa3565b612dae57612dad6359c896be60e01b612962565b5b5b5b612dbe836000886001613dcf565b8015612dc957600082555b600160806001901b03612dda61286e565b60050160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550612e7a83612e3785600088613dd5565b7c02000000000000000000000000000000000000000000000000000000007c01000000000000000000000000000000000000000000000000000000001717613dfd565b612e8261286e565b60040160008881526020019081526020016000208190555060007c0200000000000000000000000000000000000000000000000000000000851603612f245760006001870190506000612ed361286e565b60040160008381526020019081526020016000205403612f2257612ef561286e565b600001548114612f215784612f0861286e565b6004016000838152602001908152602001600020819055505b5b505b85600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612f8e836000886001613e28565b612f9661286e565b60010160008154809291906001019190505550505050505050565b600081612fbc6129d0565b116130cf57612fc961286e565b6004016000838152602001908152602001600020549050612fe86129d9565b82111561300d57612ff881613be2565b6130e05761300c63df2d9b4260e01b612962565b5b600081036130a65761301d61286e565b6000015482106130385761303763df2d9b4260e01b612962565b5b5b61304161286e565b60040160008360019003935083815260200190815260200160002054905060008103156130a15760007c0100000000000000000000000000000000000000000000000000000000821603156130e0576130a063df2d9b4260e01b612962565b5b613039565b60007c0100000000000000000000000000000000000000000000000000000000821603156130e0575b6130df63df2d9b4260e01b612962565b5b919050565b60006130ef61286e565b6000015490506000820361310e5761310d63b562e8dd60e01b612962565b5b61311b6000848385613dcf565b61313b8361312c6000866000613dd5565b61313585613e2e565b17613dfd565b61314361286e565b600401600083815260200190815260200160002081905550600160406001901b17820261316e61286e565b60050160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600073ffffffffffffffffffffffffffffffffffffffff8473ffffffffffffffffffffffffffffffffffffffff161690506000810361320557613204632e07630060e01b612962565b5b6000838301905060008390506132196129d9565b600183031115613234576132336381647e3a60e01b612962565b5b5b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4818160010191508103613235578161327461286e565b6000018190555050505061328b6000848385613e28565b505050565b600061329a613536565b905060008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050828260000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3505050565b600061337161286e565b60000154905090565b6060818310613394576133936332c1995a60e01b612962565b5b61339c6129d0565b8310156133ae576133ab6129d0565b92505b60006133b8613367565b905060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6133e56129d9565b036133f057816133f2565b835b90508084106133ff578093505b600061340a876113e3565b905084861061341857600090505b6000811461352c57808686031161342f5785850390505b600060405194506001820160051b8501905080604052600061345088611c13565b90506000816040015161346557816000015190505b60005b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6134916129d9565b146134c057868a036134ab5760016134a76129d9565b0199505b6134b36129d9565b8a11156134bf57600091505b5b6134c98a61387b565b92506040830151600081146134e15760009250613507565b8351156134ed57835192505b8b831860601b613506576001820191508a8260051b8a01525b5b5060018a01995083604052888a148061351f57508481145b1561346857808852505050505b5050509392505050565b60007f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300905090565b8061356761286e565b60070160006135746139ba565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff166136216139ba565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051613666919061465e565b60405180910390a35050565b61367d848484610e33565b60008373ffffffffffffffffffffffffffffffffffffffff163b146136be576136a884848484613e3e565b6136bd576136bc63d1a57ed660e01b612962565b5b5b50505050565b60006136ce613f6d565b9050600281600001540361370e576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002816000018190555050565b6000808787878787604051602001613734929190615bb9565b6040516020818303038152906040526040516020016137569493929190615c8d565b6040516020818303038152906040528051906020012090506000816040516020016137819190615d4e565b60405160208183030381529060405280519060200120905060006137a58286613f95565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161493505050509695505050505050565b60006138116129d0565b61381961286e565b600001540390507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6138496129d9565b1461385f5761385661286e565b60080154810190505b90565b600061386c613f6d565b90506001816000018190555050565b61388361455b565b6138a861388e61286e565b600401600084815260200190815260200160002054613fc1565b9050919050565b6000806138ba61286e565b60040160008481526020019081526020016000205414159050919050565b6060600080546138e790615467565b80601f016020809104026020016040519081016040528092919081815260200182805461391390615467565b80156139605780601f1061393557610100808354040283529160200191613960565b820191906000526020600020905b81548152906001019060200180831161394357829003601f168201915b5050505050905090565b606060a060405101806040526020810391506000825281835b6001156139a557600184039350600a81066030018453600a8104905080613983575b50828103602084039350808452505050919050565b600033905090565b60006139cc61286e565b60070160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60007ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00905090565b6000807fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f90508091505090565b6000803090506000813b9050600081149250505090565b613ad3613a87565b60000160019054906101000a900460ff16613b23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613b1a90615de6565b60405180910390fd5b613b2d8282614077565b5050565b613b39614143565b613b4281614183565b50565b613b4d614143565b565b613b6e733cc6cdda760b79bafa08df41ecfa224f810dceb66001614209565b565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600033905090565b60007c0100000000000000000000000000000000000000000000000000000000821673ffffffffffffffffffffffffffffffffffffffff8316119050919050565b6000613c2e8361134b565b9050818015613c7057508073ffffffffffffffffffffffffffffffffffffffff16613c576139ba565b73ffffffffffffffffffffffffffffffffffffffff1614155b15613c9c57613c8681613c816139ba565b611fa3565b613c9b57613c9a63cfb3b94260e01b612962565b5b5b83613ca561286e565b600601600085815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a450505050565b6000806000613d6861286e565b600601600085815260200190815260200160002090508092508254915050915091565b600073ffffffffffffffffffffffffffffffffffffffff8316925073ffffffffffffffffffffffffffffffffffffffff821691508382148383141790509392505050565b50505050565b60008060e883901c905060e8613dec86868461427e565b62ffffff16901b9150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff83169250814260a01b178317905092915050565b50505050565b60006001821460e11b9050919050565b60008373ffffffffffffffffffffffffffffffffffffffff1663150b7a02613e646139ba565b8786866040518563ffffffff1660e01b8152600401613e869493929190615e50565b6020604051808303816000875af1925050508015613ec257506040513d601f19601f82011682018060405250810190613ebf9190615eb1565b60015b613f1a573d8060008114613ef2576040519150601f19603f3d011682016040523d82523d6000602084013e613ef7565b606091505b506000815103613f1257613f1163d1a57ed660e01b612962565b5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b60007f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00905090565b600080600080613fa58686614287565b925092509250613fb582826142e3565b82935050505092915050565b613fc961455b565b81816000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060a082901c816020019067ffffffffffffffff16908167ffffffffffffffff168152505060007c01000000000000000000000000000000000000000000000000000000008316141581604001901515908115158152505060e882901c816060019062ffffff16908162ffffff1681525050919050565b61407f613a87565b60000160019054906101000a900460ff166140cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016140c690615de6565b60405180910390fd5b816140d861286e565b60020190816140e79190615715565b50806140f161286e565b60030190816141009190615715565b506141096129d0565b61411161286e565b600001819055506141206129d0565b6141286129d9565b101561413f5761413e63fed8210f60e01b612962565b5b5050565b61414b614447565b614181576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b61418b614143565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036141fd5760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016141f4919061487f565b60405180910390fd5b61420681613290565b50565b637d3e3dbe8260601b60601c925081614235578261422d57634420e4869050614235565b63a0af290390505b8060e01b60005230600452826024526004600060446000806daaeb6d7670e522a718067333cd4e5af1614274578060005160e01c0361427357600080fd5b5b6000602452505050565b60009392505050565b600080600060418451036142cc5760008060006020870151925060408701519150606087015160001a90506142be88828585614467565b9550955095505050506142dc565b60006002855160001b9250925092505b9250925092565b600060038111156142f7576142f6615ede565b5b82600381111561430a57614309615ede565b5b0315614443576001600381111561432457614323615ede565b5b82600381111561433757614336615ede565b5b0361436e576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600381111561438257614381615ede565b5b82600381111561439557614394615ede565b5b036143da578060001c6040517ffce698f70000000000000000000000000000000000000000000000000000000081526004016143d19190614a40565b60405180910390fd5b6003808111156143ed576143ec615ede565b5b826003811115614400576143ff615ede565b5b0361444257806040517fd78bce0c0000000000000000000000000000000000000000000000000000000081526004016144399190615f1c565b60405180910390fd5b5b5050565b6000614451613a5f565b60000160089054906101000a900460ff16905090565b60008060007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08460001c11156144a7576000600385925092509250614551565b6000600188888888604051600081526020016040526040516144cc9493929190615f53565b6020604051602081039080840390855afa1580156144ee573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361454257600060016000801b93509350935050614551565b8060008060001b935093509350505b9450945094915050565b6040518060800160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600067ffffffffffffffff168152602001600015158152602001600062ffffff1681525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6145f3816145be565b81146145fe57600080fd5b50565b600081359050614610816145ea565b92915050565b60006020828403121561462c5761462b6145b4565b5b600061463a84828501614601565b91505092915050565b60008115159050919050565b61465881614643565b82525050565b6000602082019050614673600083018461464f565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006146a482614679565b9050919050565b6146b481614699565b81146146bf57600080fd5b50565b6000813590506146d1816146ab565b92915050565b60006bffffffffffffffffffffffff82169050919050565b6146f8816146d7565b811461470357600080fd5b50565b600081359050614715816146ef565b92915050565b60008060408385031215614732576147316145b4565b5b6000614740858286016146c2565b925050602061475185828601614706565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561479557808201518184015260208101905061477a565b60008484015250505050565b6000601f19601f8301169050919050565b60006147bd8261475b565b6147c78185614766565b93506147d7818560208601614777565b6147e0816147a1565b840191505092915050565b6000602082019050818103600083015261480581846147b2565b905092915050565b6000819050919050565b6148208161480d565b811461482b57600080fd5b50565b60008135905061483d81614817565b92915050565b600060208284031215614859576148586145b4565b5b60006148678482850161482e565b91505092915050565b61487981614699565b82525050565b60006020820190506148946000830184614870565b92915050565b600080604083850312156148b1576148b06145b4565b5b60006148bf858286016146c2565b92505060206148d08582860161482e565b9150509250929050565b600080604083850312156148f1576148f06145b4565b5b60006148ff8582860161482e565b92505060206149108582860161482e565b9150509250929050565b600080fd5b600080fd5b600080fd5b60008083601f84011261493f5761493e61491a565b5b8235905067ffffffffffffffff81111561495c5761495b61491f565b5b60208301915083600182028301111561497857614977614924565b5b9250929050565b60008060008060006080868803121561499b5761499a6145b4565b5b60006149a9888289016146c2565b95505060206149ba888289016146c2565b94505060406149cb8882890161482e565b935050606086013567ffffffffffffffff8111156149ec576149eb6145b9565b5b6149f888828901614929565b92509250509295509295909350565b614a10816145be565b82525050565b6000602082019050614a2b6000830184614a07565b92915050565b614a3a8161480d565b82525050565b6000602082019050614a556000830184614a31565b92915050565b600080600060608486031215614a7457614a736145b4565b5b6000614a82868287016146c2565b9350506020614a93868287016146c2565b9250506040614aa48682870161482e565b9150509250925092565b6000604082019050614ac36000830185614870565b614ad06020830184614a31565b9392505050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b614b14826147a1565b810181811067ffffffffffffffff82111715614b3357614b32614adc565b5b80604052505050565b6000614b466145aa565b9050614b528282614b0b565b919050565b600067ffffffffffffffff821115614b7257614b71614adc565b5b614b7b826147a1565b9050602081019050919050565b82818337600083830152505050565b6000614baa614ba584614b57565b614b3c565b905082815260208101848484011115614bc657614bc5614ad7565b5b614bd1848285614b88565b509392505050565b600082601f830112614bee57614bed61491a565b5b8135614bfe848260208601614b97565b91505092915050565b600060208284031215614c1d57614c1c6145b4565b5b600082013567ffffffffffffffff811115614c3b57614c3a6145b9565b5b614c4784828501614bd9565b91505092915050565b600060208284031215614c6657614c656145b4565b5b6000614c74848285016146c2565b91505092915050565b60008083601f840112614c9357614c9261491a565b5b8235905067ffffffffffffffff811115614cb057614caf61491f565b5b602083019150836020820283011115614ccc57614ccb614924565b5b9250929050565b60008060208385031215614cea57614ce96145b4565b5b600083013567ffffffffffffffff811115614d0857614d076145b9565b5b614d1485828601614c7d565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b614d5581614699565b82525050565b600067ffffffffffffffff82169050919050565b614d7881614d5b565b82525050565b614d8781614643565b82525050565b600062ffffff82169050919050565b614da581614d8d565b82525050565b608082016000820151614dc16000850182614d4c565b506020820151614dd46020850182614d6f565b506040820151614de76040850182614d7e565b506060820151614dfa6060850182614d9c565b50505050565b6000614e0c8383614dab565b60808301905092915050565b6000602082019050919050565b6000614e3082614d20565b614e3a8185614d2b565b9350614e4583614d3c565b8060005b83811015614e76578151614e5d8882614e00565b9750614e6883614e18565b925050600181019050614e49565b5085935050505092915050565b60006020820190508181036000830152614e9d8184614e25565b905092915050565b60008083601f840112614ebb57614eba61491a565b5b8235905067ffffffffffffffff811115614ed857614ed761491f565b5b602083019150836020820283011115614ef457614ef3614924565b5b9250929050565b60008060008060408587031215614f1557614f146145b4565b5b600085013567ffffffffffffffff811115614f3357614f326145b9565b5b614f3f87828801614ea5565b9450945050602085013567ffffffffffffffff811115614f6257614f616145b9565b5b614f6e87828801614c7d565b925092505092959194509250565b614f8581614643565b8114614f9057600080fd5b50565b600081359050614fa281614f7c565b92915050565b600060208284031215614fbe57614fbd6145b4565b5b6000614fcc84828501614f93565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61500a8161480d565b82525050565b600061501c8383615001565b60208301905092915050565b6000602082019050919050565b600061504082614fd5565b61504a8185614fe0565b935061505583614ff1565b8060005b8381101561508657815161506d8882615010565b975061507883615028565b925050600181019050615059565b5085935050505092915050565b600060208201905081810360008301526150ad8184615035565b905092915050565b6000806000606084860312156150ce576150cd6145b4565b5b60006150dc868287016146c2565b93505060206150ed8682870161482e565b92505060406150fe8682870161482e565b9150509250925092565b6000806040838503121561511f5761511e6145b4565b5b600061512d858286016146c2565b925050602061513e85828601614f93565b9150509250929050565b600067ffffffffffffffff82111561516357615162614adc565b5b61516c826147a1565b9050602081019050919050565b600061518c61518784615148565b614b3c565b9050828152602081018484840111156151a8576151a7614ad7565b5b6151b3848285614b88565b509392505050565b600082601f8301126151d0576151cf61491a565b5b81356151e0848260208601615179565b91505092915050565b60008060008060808587031215615203576152026145b4565b5b6000615211878288016146c2565b9450506020615222878288016146c2565b93505060406152338782880161482e565b925050606085013567ffffffffffffffff811115615254576152536145b9565b5b615260878288016151bb565b91505092959194509250565b600080600080600080600060a0888a03121561528b5761528a6145b4565b5b60006152998a828b016146c2565b97505060206152aa8a828b0161482e565b96505060406152bb8a828b0161482e565b955050606088013567ffffffffffffffff8111156152dc576152db6145b9565b5b6152e88a828b01614ea5565b9450945050608088013567ffffffffffffffff81111561530b5761530a6145b9565b5b6153178a828b01614929565b925092505092959891949750929550565b60808201600082015161533e6000850182614d4c565b5060208201516153516020850182614d6f565b5060408201516153646040850182614d7e565b5060608201516153776060850182614d9c565b50505050565b60006080820190506153926000830184615328565b92915050565b6000806000604084860312156153b1576153b06145b4565b5b600084013567ffffffffffffffff8111156153cf576153ce6145b9565b5b6153db86828701614c7d565b935093505060206153ee86828701614f93565b9150509250925092565b6000806040838503121561540f5761540e6145b4565b5b600061541d858286016146c2565b925050602061542e858286016146c2565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061547f57607f821691505b60208210810361549257615491615438565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006154d28261480d565b91506154dd8361480d565b92508282026154eb8161480d565b9150828204841483151761550257615501615498565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006155438261480d565b915061554e8361480d565b92508261555e5761555d615509565b5b828204905092915050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026155cb7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8261558e565b6155d5868361558e565b95508019841693508086168417925050509392505050565b6000819050919050565b600061561261560d6156088461480d565b6155ed565b61480d565b9050919050565b6000819050919050565b61562c836155f7565b61564061563882615619565b84845461559b565b825550505050565b600090565b615655615648565b615660818484615623565b505050565b5b818110156156845761567960008261564d565b600181019050615666565b5050565b601f8211156156c95761569a81615569565b6156a38461557e565b810160208510156156b2578190505b6156c66156be8561557e565b830182615665565b50505b505050565b600082821c905092915050565b60006156ec600019846008026156ce565b1980831691505092915050565b600061570583836156db565b9150826002028217905092915050565b61571e8261475b565b67ffffffffffffffff81111561573757615736614adc565b5b6157418254615467565b61574c828285615688565b600060209050601f83116001811461577f576000841561576d578287015190505b61577785826156f9565b8655506157df565b601f19841661578d86615569565b60005b828110156157b557848901518255600182019150602085019450602081019050615790565b868310156157d257848901516157ce601f8916826156db565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060608201905061582b6000830186614870565b6158386020830185614870565b6158456040830184614a31565b949350505050565b60006158588261480d565b91506158638361480d565b925082820190508082111561587b5761587a615498565b5b92915050565b600061588c8261480d565b91506158978361480d565b92508282039050818111156158af576158ae615498565b5b92915050565b600082825260208201905092915050565b6000819050919050565b60006158dc8383614d4c565b60208301905092915050565b60006158f760208401846146c2565b905092915050565b6000602082019050919050565b600061591883856158b5565b9350615923826158c6565b8060005b8581101561595c5761593982846158e8565b61594388826158d0565b975061594e836158ff565b925050600181019050615927565b5085925050509392505050565b600060a08201905061597e6000830189614a31565b61598b6020830188614a31565b818103604083015261599e81868861590c565b90506159ad6060830185614a31565b6159ba6080830184614a31565b979650505050505050565b600081905092915050565b60006159db8261475b565b6159e581856159c5565b93506159f5818560208601614777565b80840191505092915050565b6000615a0d82856159d0565b9150615a1982846159d0565b91508190509392505050565b6000604082019050615a3a6000830185614a31565b615a476020830184614a31565b9392505050565b7f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460008201527f20697320616c726561647920696e697469616c697a6564000000000000000000602082015250565b6000615aaa603783614766565b9150615ab582615a4e565b604082019050919050565b60006020820190508181036000830152615ad981615a9d565b9050919050565b6000819050919050565b6000615b05615b00615afb84615ae0565b6155ed565b614d5b565b9050919050565b615b1581615aea565b82525050565b6000602082019050615b306000830184615b0c565b92915050565b6000615b51615b4c615b47846146d7565b6155ed565b61480d565b9050919050565b615b6181615b36565b82525050565b6000604082019050615b7c6000830185615b58565b615b896020830184614a31565b9392505050565b6000615b9b8261480d565b915060008203615bae57615bad615498565b5b600182039050919050565b60006020820190508181036000830152615bd481848661590c565b90509392505050565b60008160601b9050919050565b6000615bf582615bdd565b9050919050565b6000615c0782615bea565b9050919050565b615c1f615c1a82614699565b615bfc565b82525050565b6000819050919050565b615c40615c3b8261480d565b615c25565b82525050565b600081519050919050565b600081905092915050565b6000615c6782615c46565b615c718185615c51565b9350615c81818560208601614777565b80840191505092915050565b6000615c998287615c0e565b601482019150615ca98286615c2f565b602082019150615cb98285615c2f565b602082019150615cc98284615c5c565b915081905095945050505050565b7f19457468657265756d205369676e6564204d6573736167653a0a333200000000600082015250565b6000615d0d601c836159c5565b9150615d1882615cd7565b601c82019050919050565b6000819050919050565b6000819050919050565b615d48615d4382615d23565b615d2d565b82525050565b6000615d5982615d00565b9150615d658284615d37565b60208201915081905092915050565b7f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460008201527f206973206e6f7420696e697469616c697a696e67000000000000000000000000602082015250565b6000615dd0603483614766565b9150615ddb82615d74565b604082019050919050565b60006020820190508181036000830152615dff81615dc3565b9050919050565b600082825260208201905092915050565b6000615e2282615c46565b615e2c8185615e06565b9350615e3c818560208601614777565b615e45816147a1565b840191505092915050565b6000608082019050615e656000830187614870565b615e726020830186614870565b615e7f6040830185614a31565b8181036060830152615e918184615e17565b905095945050505050565b600081519050615eab816145ea565b92915050565b600060208284031215615ec757615ec66145b4565b5b6000615ed584828501615e9c565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b615f1681615d23565b82525050565b6000602082019050615f316000830184615f0d565b92915050565b600060ff82169050919050565b615f4d81615f37565b82525050565b6000608082019050615f686000830187615f0d565b615f756020830186615f44565b615f826040830185615f0d565b615f8f6060830184615f0d565b9594505050505056fea264697066735822122027f2b7a1624f0c5cdc585691e69d86b01557e5a49fb9521c0abe47275e680aa964736f6c63430008180033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.