Feature Tip: Add private address tag to any address under My Name Tag !
ERC-721
Overview
Max Total Supply
333 MKDZ
Holders
313
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 MKDZLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
Moonkidz
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
No with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.20; import {ERC721, ERC721Enumerable} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Pausable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract Moonkidz is ERC721, ERC721Enumerable, Ownable, Pausable, ReentrancyGuard { // Constant variables // ------------------------------------------------------------------------ uint256 public constant MAX_SUPPLY = 12345; uint256 public constant MAX_WHITELIST_SUPPLY = 2057; uint256 public constant MAX_PUBLIC_SUPPLY = 4115; // State variables // ------------------------------------------------------------------------ uint256 public currentPhase = 1; uint256 private _nextTokenId = 1; string private _baseUri; mapping(uint256 => bytes32) merkleRoots; mapping(address => bool) private mintedAddress; mapping(uint256 => bool) private whitelistSwitches; mapping(uint256 => bool) private publicSwitches; mapping(uint256 => uint256) private mintedWhitelistCount; // Modifier to ensure that the call is coming from an externally owned account, not a contract modifier onlyEOA() { require( tx.origin == msg.sender, "Contract caller must be externally owned account" ); _; } modifier onlySale() { require( whitelistSwitches[currentPhase] || publicSwitches[currentPhase], "Sale is not active" ); _; } constructor( string memory _name, string memory _symbol, address _owner ) ERC721(_name, _symbol) Ownable(_owner) {} function setBaseURI(string memory _uri) public onlyOwner { _baseUri = _uri; } // Merkle root functions // ------------------------------------------------------------------------ function setMerkleRoot( uint256 _phase, bytes32 _rootHash ) external onlyOwner { merkleRoots[_phase] = _rootHash; } function verifyProof( uint256 _phase, bytes32[] memory _merkleProof ) internal view returns (bool) { bytes32 _merkleRoot = merkleRoots[_phase]; bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); return MerkleProof.verify(_merkleProof, _merkleRoot, leaf); } function isAllowed(bytes32[] memory _proof) public view returns (bool) { return verifyProof(currentPhase, _proof); } // Sale switch functions // ------------------------------------------------------------------------ function setPhase(uint256 _phase) public onlyOwner { currentPhase = _phase; } function flipWhitelistSale() public onlyOwner { whitelistSwitches[currentPhase] = !whitelistSwitches[currentPhase]; } function flipPublicSale() public onlyOwner { publicSwitches[currentPhase] = !publicSwitches[currentPhase]; } function isWhitelistOn() public view returns (bool) { return whitelistSwitches[currentPhase]; } function isPublicOn() public view returns (bool) { return publicSwitches[currentPhase]; } // Mint functions // ------------------------------------------------------------------------ function mint( bytes32[] calldata _proof ) public nonReentrant whenNotPaused onlyEOA onlySale { if (isPublicOn()) { require(mintedAddress[msg.sender] == false, "Already minted"); require( totalSupply() + 1 <= (MAX_PUBLIC_SUPPLY) * currentPhase, "Exceed max supply" ); require(totalSupply() + 1 <= MAX_SUPPLY, "Exceed max supply"); mintedAddress[msg.sender] = true; uint256 tokenId = _nextTokenId++; _safeMint(msg.sender, tokenId); } if (isWhitelistOn()) { require(verifyProof(currentPhase, _proof), "Not in the whitelist"); require(mintedAddress[msg.sender] == false, "Already minted"); require( mintedWhitelistCount[currentPhase] + 1 <= MAX_WHITELIST_SUPPLY, "Exceed max whitelist supply" ); mintedWhitelistCount[currentPhase] += 1; mintedAddress[msg.sender] = true; uint256 tokenId = _nextTokenId++; _safeMint(msg.sender, tokenId); } } function _baseURI() internal view virtual override returns (string memory) { return _baseUri; } function tokenURI( uint256 tokenId ) public view virtual override returns (string memory) { _requireOwned(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string.concat(baseURI, Strings.toString(tokenId), ".json") : ""; } function tokensOfOwner( address _owner ) public view returns (uint256[] memory) { uint256 tokenCount = balanceOf(_owner); if (tokenCount == 0) { return new uint256[](0); } uint256[] memory tokens = new uint256[](tokenCount); for (uint256 i; i < tokenCount; i++) { tokens[i] = tokenOfOwnerByIndex(_owner, i); } return tokens; } function _update( address to, uint256 tokenId, address auth ) internal override(ERC721, ERC721Enumerable) returns (address) { return super._update(to, tokenId, auth); } function _increaseBalance( address account, uint128 value ) internal override(ERC721, ERC721Enumerable) { super._increaseBalance(account, value); } function supportsInterface( bytes4 interfaceId ) public view override(ERC721, ERC721Enumerable) returns (bool) { return super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.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 Ownable is Context { address private _owner; /** * @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. */ constructor(address initialOwner) { 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) { 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 { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "./IERC20.sol"; import {IERC20Metadata} from "./extensions/IERC20Metadata.sol"; import {Context} from "../../utils/Context.sol"; import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. */ abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors { mapping(address account => uint256) private _balances; mapping(address account => mapping(address spender => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the default value returned by this function, unless * it's overridden. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `value`. */ function transfer(address to, uint256 value) public virtual returns (bool) { address owner = _msgSender(); _transfer(owner, to, value); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, value); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `value`. * - the caller must have allowance for ``from``'s tokens of at least * `value`. */ function transferFrom(address from, address to, uint256 value) public virtual returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, value); _transfer(from, to, value); return true; } /** * @dev Moves a `value` amount of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _transfer(address from, address to, uint256 value) internal { if (from == address(0)) { revert ERC20InvalidSender(address(0)); } if (to == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(from, to, value); } /** * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from` * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding * this function. * * Emits a {Transfer} event. */ function _update(address from, address to, uint256 value) internal virtual { if (from == address(0)) { // Overflow check required: The rest of the code assumes that totalSupply never overflows _totalSupply += value; } else { uint256 fromBalance = _balances[from]; if (fromBalance < value) { revert ERC20InsufficientBalance(from, fromBalance, value); } unchecked { // Overflow not possible: value <= fromBalance <= totalSupply. _balances[from] = fromBalance - value; } } if (to == address(0)) { unchecked { // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply. _totalSupply -= value; } } else { unchecked { // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256. _balances[to] += value; } } emit Transfer(from, to, value); } /** * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0). * Relies on the `_update` mechanism * * Emits a {Transfer} event with `from` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _mint(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(address(0), account, value); } /** * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply. * Relies on the `_update` mechanism. * * Emits a {Transfer} event with `to` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead */ function _burn(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidSender(address(0)); } _update(account, address(0), value); } /** * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address owner, address spender, uint256 value) internal { _approve(owner, spender, value, true); } /** * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event. * * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any * `Approval` event during `transferFrom` operations. * * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to * true using the following override: * ``` * function _approve(address owner, address spender, uint256 value, bool) internal virtual override { * super._approve(owner, spender, value, true); * } * ``` * * Requirements are the same as {_approve}. */ function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual { if (owner == address(0)) { revert ERC20InvalidApprover(address(0)); } if (spender == address(0)) { revert ERC20InvalidSpender(address(0)); } _allowances[owner][spender] = value; if (emitEvent) { emit Approval(owner, spender, value); } } /** * @dev Updates `owner` s allowance for `spender` based on spent `value`. * * Does not update the allowance value in case of infinite allowance. * Revert if not enough allowance is available. * * Does not emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 value) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { if (currentAllowance < value) { revert ERC20InsufficientAllowance(spender, currentAllowance, value); } unchecked { _approve(owner, spender, currentAllowance - value, false); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/ERC20Pausable.sol) pragma solidity ^0.8.20; import {ERC20} from "../ERC20.sol"; import {Pausable} from "../../../utils/Pausable.sol"; /** * @dev ERC20 token with pausable token transfers, minting and burning. * * Useful for scenarios such as preventing trades until the end of an evaluation * period, or having an emergency switch for freezing all token transfers in the * event of a large bug. * * IMPORTANT: This contract does not include public pause and unpause functions. In * addition to inheriting this contract, you must define both functions, invoking the * {Pausable-_pause} and {Pausable-_unpause} internal functions, with appropriate * access control, e.g. using {AccessControl} or {Ownable}. Not doing so will * make the contract pause mechanism of the contract unreachable, and thus unusable. */ abstract contract ERC20Pausable is ERC20, Pausable { /** * @dev See {ERC20-_update}. * * Requirements: * * - the contract must not be paused. */ function _update(address from, address to, uint256 value) internal virtual override whenNotPaused { super._update(from, to, value); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.20; import {IERC721} from "./IERC721.sol"; import {IERC721Receiver} from "./IERC721Receiver.sol"; import {IERC721Metadata} from "./extensions/IERC721Metadata.sol"; import {Context} from "../../utils/Context.sol"; import {Strings} from "../../utils/Strings.sol"; import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol"; import {IERC721Errors} from "../../interfaces/draft-IERC6093.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors { using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; mapping(uint256 tokenId => address) private _owners; mapping(address owner => uint256) private _balances; mapping(uint256 tokenId => address) private _tokenApprovals; mapping(address owner => mapping(address operator => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual returns (uint256) { if (owner == address(0)) { revert ERC721InvalidOwner(address(0)); } return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual returns (address) { return _requireOwned(tokenId); } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual returns (string memory) { _requireOwned(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual { _approve(to, tokenId, _msgSender()); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual returns (address) { _requireOwned(tokenId); return _getApproved(tokenId); } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here. address previousOwner = _update(to, tokenId, _msgSender()); if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual { transferFrom(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist * * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the * core ERC721 logic MUST be matched with the use of {_increaseBalance} to keep balances * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`. */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted. */ function _getApproved(uint256 tokenId) internal view virtual returns (address) { return _tokenApprovals[tokenId]; } /** * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in * particular (ignoring whether it is owned by `owner`). * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) { return spender != address(0) && (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender); } /** * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner. * Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets * the `spender` for the specific `tokenId`. * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual { if (!_isAuthorized(owner, spender, tokenId)) { if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } else { revert ERC721InsufficientApproval(spender, tokenId); } } } /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that * a uint256 would ever overflow from increments when these increments are bounded to uint128 values. * * WARNING: Increasing an account's balance using this function tends to be paired with an override of the * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership * remain consistent with one another. */ function _increaseBalance(address account, uint128 value) internal virtual { unchecked { _balances[account] += value; } } /** * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update. * * The `auth` argument is optional. If the value passed is non 0, then this function will check that * `auth` is either the owner of the token, or approved to operate on the token (by the owner). * * Emits a {Transfer} event. * * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}. */ function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) { address from = _ownerOf(tokenId); // Perform (optional) operator check if (auth != address(0)) { _checkAuthorized(from, auth, tokenId); } // Execute the update if (from != address(0)) { // Clear approval. No need to re-authorize or emit the Approval event _approve(address(0), tokenId, address(0), false); unchecked { _balances[from] -= 1; } } if (to != address(0)) { unchecked { _balances[to] += 1; } } _owners[tokenId] = to; emit Transfer(from, to, tokenId); return from; } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner != address(0)) { revert ERC721InvalidSender(address(0)); } } /** * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual { _mint(to, tokenId); _checkOnERC721Received(address(0), to, tokenId, data); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal { address previousOwner = _update(address(0), tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } else if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients * are aware of the ERC721 standard to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is like {safeTransferFrom} in the sense that it invokes * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `tokenId` token must exist and be owned by `from`. * - `to` cannot be the zero address. * - `from` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer(address from, address to, uint256 tokenId) internal { _safeTransfer(from, to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual { _transfer(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Approve `to` to operate on `tokenId` * * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is * either the owner of the token, or approved to operate on all tokens held by this owner. * * Emits an {Approval} event. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address to, uint256 tokenId, address auth) internal { _approve(to, tokenId, auth, true); } /** * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not * emitted in the context of transfers. */ function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual { // Avoid reading the owner unless necessary if (emitEvent || auth != address(0)) { address owner = _requireOwned(tokenId); // We do not use _isAuthorized because single-token approvals should not be able to call approve if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) { revert ERC721InvalidApprover(auth); } if (emitEvent) { emit Approval(owner, to, tokenId); } } _tokenApprovals[tokenId] = to; } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Requirements: * - operator can't be the address zero. * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { if (operator == address(0)) { revert ERC721InvalidOperator(operator); } _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned). * Returns the owner. * * Overrides to ownership logic should be done to {_ownerOf}. */ function _requireOwned(uint256 tokenId) internal view returns (address) { address owner = _ownerOf(tokenId); if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } return owner; } /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the * recipient doesn't accept the token transfer. The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call */ function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private { if (to.code.length > 0) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { if (retval != IERC721Receiver.onERC721Received.selector) { revert ERC721InvalidReceiver(to); } } catch (bytes memory reason) { if (reason.length == 0) { revert ERC721InvalidReceiver(to); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.20; import {ERC721} from "../ERC721.sol"; import {IERC721Enumerable} from "./IERC721Enumerable.sol"; import {IERC165} from "../../../utils/introspection/ERC165.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds enumerability * of all the token ids in the contract as well as all token ids owned by each account. * * CAUTION: `ERC721` extensions that implement custom `balanceOf` logic, such as `ERC721Consecutive`, * interfere with enumerability and should not be used together with `ERC721Enumerable`. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens; mapping(uint256 tokenId => uint256) private _ownedTokensIndex; uint256[] private _allTokens; mapping(uint256 tokenId => uint256) private _allTokensIndex; /** * @dev An `owner`'s token query was out of bounds for `index`. * * NOTE: The owner being `address(0)` indicates a global out of bounds index. */ error ERC721OutOfBoundsIndex(address owner, uint256 index); /** * @dev Batch mint is not allowed. */ error ERC721EnumerableForbiddenBatchMint(); /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) { if (index >= balanceOf(owner)) { revert ERC721OutOfBoundsIndex(owner, index); } return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual returns (uint256) { if (index >= totalSupply()) { revert ERC721OutOfBoundsIndex(address(0), index); } return _allTokens[index]; } /** * @dev See {ERC721-_update}. */ function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) { address previousOwner = super._update(to, tokenId, auth); if (previousOwner == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (previousOwner != to) { _removeTokenFromOwnerEnumeration(previousOwner, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (previousOwner != to) { _addTokenToOwnerEnumeration(to, tokenId); } return previousOwner; } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = balanceOf(to) - 1; _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = balanceOf(from); uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } /** * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch */ function _increaseBalance(address account, uint128 amount) internal virtual override { if (amount > 0) { revert ERC721EnumerableForbiddenBatchMint(); } super._increaseBalance(account, amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.20; import {IERC721} from "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.20; import {IERC721} from "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or * {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the address zero. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated 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.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @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 Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.20; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the Merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates Merkle trees that are safe * against this attack out of the box. */ library MerkleProof { /** *@dev The multiproof provided is not valid. */ error MerkleProofInvalidMultiproof(); /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} */ function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the Merkle tree. uint256 leavesLen = leaves.length; uint256 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. if (leavesLen + proofLen != totalHashes + 1) { revert MerkleProofInvalidMultiproof(); } // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { if (proofPos != proofLen) { revert MerkleProofInvalidMultiproof(); } unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the Merkle tree. uint256 leavesLen = leaves.length; uint256 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. if (leavesLen + proofLen != totalHashes + 1) { revert MerkleProofInvalidMultiproof(); } // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { if (proofPos != proofLen) { revert MerkleProofInvalidMultiproof(); } unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Sorts the pair (a, b) and hashes the result. */ function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } /** * @dev Implementation of keccak256(abi.encode(a, b)) that doesn't allocate or expand memory. */ function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.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 ERC165 is IERC165 { /** * @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/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 // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { bool private _paused; /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); /** * @dev The operation failed because the contract is paused. */ error EnforcedPause(); /** * @dev The operation failed because the contract is not paused. */ error ExpectedPause(); /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { if (paused()) { revert EnforcedPause(); } } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { if (!paused()) { revert ExpectedPause(); } } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @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 ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private _status; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); constructor() { _status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be NOT_ENTERED if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; import {Math} from "./math/Math.sol"; import {SignedMath} from "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { uint256 localValue = value; bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal * representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } }
{ "evmVersion": "paris", "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ERC721EnumerableForbiddenBatchMint","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721IncorrectOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721InsufficientApproval","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC721InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC721InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC721InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC721InvalidSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721NonexistentToken","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"ERC721OutOfBoundsIndex","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","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":"ReentrancyGuardReentrantCall","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":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"MAX_PUBLIC_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_WHITELIST_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentPhase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"flipPublicSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flipWhitelistSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"}],"name":"isAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":"isPublicOn","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isWhitelistOn","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_phase","type":"uint256"},{"internalType":"bytes32","name":"_rootHash","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_phase","type":"uint256"}],"name":"setPhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040526001600c556001600d553480156200001b57600080fd5b506040516200466b3803806200466b8339818101604052810190620000419190620003db565b8083838160009081620000559190620006c0565b508060019081620000679190620006c0565b505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603620000df5760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401620000d69190620007b8565b60405180910390fd5b620000f0816200011d60201b60201c565b506000600a60146101000a81548160ff0219169083151502179055506001600b81905550505050620007d5565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200024c8262000201565b810181811067ffffffffffffffff821117156200026e576200026d62000212565b5b80604052505050565b600062000283620001e3565b905062000291828262000241565b919050565b600067ffffffffffffffff821115620002b457620002b362000212565b5b620002bf8262000201565b9050602081019050919050565b60005b83811015620002ec578082015181840152602081019050620002cf565b60008484015250505050565b60006200030f620003098462000296565b62000277565b9050828152602081018484840111156200032e576200032d620001fc565b5b6200033b848285620002cc565b509392505050565b600082601f8301126200035b576200035a620001f7565b5b81516200036d848260208601620002f8565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620003a38262000376565b9050919050565b620003b58162000396565b8114620003c157600080fd5b50565b600081519050620003d581620003aa565b92915050565b600080600060608486031215620003f757620003f6620001ed565b5b600084015167ffffffffffffffff811115620004185762000417620001f2565b5b620004268682870162000343565b935050602084015167ffffffffffffffff8111156200044a5762000449620001f2565b5b620004588682870162000343565b92505060406200046b86828701620003c4565b9150509250925092565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620004c857607f821691505b602082108103620004de57620004dd62000480565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620005487fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000509565b62000554868362000509565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620005a16200059b62000595846200056c565b62000576565b6200056c565b9050919050565b6000819050919050565b620005bd8362000580565b620005d5620005cc82620005a8565b84845462000516565b825550505050565b600090565b620005ec620005dd565b620005f9818484620005b2565b505050565b5b81811015620006215762000615600082620005e2565b600181019050620005ff565b5050565b601f82111562000670576200063a81620004e4565b6200064584620004f9565b8101602085101562000655578190505b6200066d6200066485620004f9565b830182620005fe565b50505b505050565b600082821c905092915050565b6000620006956000198460080262000675565b1980831691505092915050565b6000620006b0838362000682565b9150826002028217905092915050565b620006cb8262000475565b67ffffffffffffffff811115620006e757620006e662000212565b5b620006f38254620004af565b6200070082828562000625565b600060209050601f83116001811462000738576000841562000723578287015190505b6200072f8582620006a2565b8655506200079f565b601f1984166200074886620004e4565b60005b8281101562000772578489015182556001820191506020850194506020810190506200074b565b868310156200079257848901516200078e601f89168262000682565b8355505b6001600288020188555050505b505050505050565b620007b28162000396565b82525050565b6000602082019050620007cf6000830184620007a7565b92915050565b613e8680620007e56000396000f3fe608060405234801561001057600080fd5b50600436106102065760003560e01c80636352211e1161011a57806395d89b41116100ad578063b88d4fde1161007c578063b88d4fde146105a3578063c87b56dd146105bf578063cf7cd8fa146105ef578063e985e9c51461061f578063f2fde38b1461064f57610206565b806395d89b411461052f578063a22cb4651461054d578063af2d4f1414610569578063b77a147b1461058757610206565b80638462151c116100e95780638462151c146104b957806388084605146104e95780638da5cb5b146104f3578063943274c61461051157610206565b80636352211e1461043157806370a0823114610461578063715018a614610491578063716f10bf1461049b57610206565b806323b872dd1161019d57806332cb6b0c1161016c57806332cb6b0c1461038d57806342842e0e146103ab5780634f6ccce7146103c757806355f804b3146103f75780635c975abb1461041357610206565b806323b872dd146103075780632a47f799146103235780632cc82655146103415780632f745c591461035d57610206565b8063095ea7b3116101d9578063095ea7b3146102a75780630f5d66ad146102c357806318160ddd146102cd57806318712c21146102eb57610206565b806301ffc9a71461020b578063055ad42e1461023b57806306fdde0314610259578063081812fc14610277575b600080fd5b61022560048036038101906102209190612b94565b61066b565b6040516102329190612bdc565b60405180910390f35b61024361067d565b6040516102509190612c10565b60405180910390f35b610261610683565b60405161026e9190612cbb565b60405180910390f35b610291600480360381019061028c9190612d09565b610715565b60405161029e9190612d77565b60405180910390f35b6102c160048036038101906102bc9190612dbe565b610731565b005b6102cb610747565b005b6102d56107a1565b6040516102e29190612c10565b60405180910390f35b61030560048036038101906103009190612e34565b6107ae565b005b610321600480360381019061031c9190612e74565b6107d2565b005b61032b6108d4565b6040516103389190612c10565b60405180910390f35b61035b60048036038101906103569190612d09565b6108da565b005b61037760048036038101906103729190612dbe565b6108ec565b6040516103849190612c10565b60405180910390f35b610395610995565b6040516103a29190612c10565b60405180910390f35b6103c560048036038101906103c09190612e74565b61099b565b005b6103e160048036038101906103dc9190612d09565b6109bb565b6040516103ee9190612c10565b60405180910390f35b610411600480360381019061040c9190612ffc565b610a31565b005b61041b610a4c565b6040516104289190612bdc565b60405180910390f35b61044b60048036038101906104469190612d09565b610a63565b6040516104589190612d77565b60405180910390f35b61047b60048036038101906104769190613045565b610a75565b6040516104889190612c10565b60405180910390f35b610499610b2f565b005b6104a3610b43565b6040516104b09190612bdc565b60405180910390f35b6104d360048036038101906104ce9190613045565b610b6d565b6040516104e09190613130565b60405180910390f35b6104f1610c76565b005b6104fb610cd0565b6040516105089190612d77565b60405180910390f35b610519610cfa565b6040516105269190612bdc565b60405180910390f35b610537610d24565b6040516105449190612cbb565b60405180910390f35b6105676004803603810190610562919061317e565b610db6565b005b610571610dcc565b60405161057e9190612c10565b60405180910390f35b6105a1600480360381019061059c919061321e565b610dd2565b005b6105bd60048036038101906105b8919061330c565b611302565b005b6105d960048036038101906105d49190612d09565b61131f565b6040516105e69190612cbb565b60405180910390f35b61060960048036038101906106049190613452565b611388565b6040516106169190612bdc565b60405180910390f35b6106396004803603810190610634919061349b565b61139d565b6040516106469190612bdc565b60405180910390f35b61066960048036038101906106649190613045565b611431565b005b6000610676826114b7565b9050919050565b600c5481565b6060600080546106929061350a565b80601f01602080910402602001604051908101604052809291908181526020018280546106be9061350a565b801561070b5780601f106106e05761010080835404028352916020019161070b565b820191906000526020600020905b8154815290600101906020018083116106ee57829003601f168201915b5050505050905090565b600061072082611531565b5061072a826115b9565b9050919050565b610743828261073e6115f6565b6115fe565b5050565b61074f611610565b60116000600c54815260200190815260200160002060009054906101000a900460ff161560116000600c54815260200190815260200160002060006101000a81548160ff021916908315150217905550565b6000600880549050905090565b6107b6611610565b80600f6000848152602001908152602001600020819055505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036108445760006040517f64a0ae9200000000000000000000000000000000000000000000000000000000815260040161083b9190612d77565b60405180910390fd5b600061085883836108536115f6565b611697565b90508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146108ce578382826040517f64283d7b0000000000000000000000000000000000000000000000000000000081526004016108c59392919061353b565b60405180910390fd5b50505050565b61101381565b6108e2611610565b80600c8190555050565b60006108f783610a75565b821061093c5782826040517fa57d13dc000000000000000000000000000000000000000000000000000000008152600401610933929190613572565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b61303981565b6109b683838360405180602001604052806000815250611302565b505050565b60006109c56107a1565b8210610a0b576000826040517fa57d13dc000000000000000000000000000000000000000000000000000000008152600401610a02929190613572565b60405180910390fd5b60088281548110610a1f57610a1e61359b565b5b90600052602060002001549050919050565b610a39611610565b80600e9081610a489190613776565b5050565b6000600a60149054906101000a900460ff16905090565b6000610a6e82611531565b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610ae85760006040517f89c62b64000000000000000000000000000000000000000000000000000000008152600401610adf9190612d77565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610b37611610565b610b4160006116ad565b565b600060116000600c54815260200190815260200160002060009054906101000a900460ff16905090565b60606000610b7a83610a75565b905060008103610bd657600067ffffffffffffffff811115610b9f57610b9e612ed1565b5b604051908082528060200260200182016040528015610bcd5781602001602082028036833780820191505090505b50915050610c71565b60008167ffffffffffffffff811115610bf257610bf1612ed1565b5b604051908082528060200260200182016040528015610c205781602001602082028036833780820191505090505b50905060005b82811015610c6a57610c3885826108ec565b828281518110610c4b57610c4a61359b565b5b6020026020010181815250508080610c6290613877565b915050610c26565b5080925050505b919050565b610c7e611610565b60126000600c54815260200190815260200160002060009054906101000a900460ff161560126000600c54815260200190815260200160002060006101000a81548160ff021916908315150217905550565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600060126000600c54815260200190815260200160002060009054906101000a900460ff16905090565b606060018054610d339061350a565b80601f0160208091040260200160405190810160405280929190818152602001828054610d5f9061350a565b8015610dac5780601f10610d8157610100808354040283529160200191610dac565b820191906000526020600020905b815481529060010190602001808311610d8f57829003601f168201915b5050505050905090565b610dc8610dc16115f6565b8383611773565b5050565b61080981565b610dda6118e2565b610de2611928565b3373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4790613931565b60405180910390fd5b60116000600c54815260200190815260200160002060009054906101000a900460ff1680610e9d575060126000600c54815260200190815260200160002060009054906101000a900460ff165b610edc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed39061399d565b60405180910390fd5b610ee4610cfa565b156110b85760001515601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610f7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7390613a09565b60405180910390fd5b600c54611013610f8c9190613a29565b6001610f966107a1565b610fa09190613a6b565b1115610fe1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd890613aeb565b60405180910390fd5b6130396001610fee6107a1565b610ff89190613a6b565b1115611039576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161103090613aeb565b60405180910390fd5b6001601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600d60008154809291906110a690613877565b9190505590506110b63382611969565b505b6110c0610b43565b156112f657611112600c54838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050611987565b611151576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114890613b57565b60405180910390fd5b60001515601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146111e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111db90613a09565b60405180910390fd5b610809600160136000600c548152602001908152602001600020546112099190613a6b565b111561124a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124190613bc3565b60405180910390fd5b600160136000600c54815260200190815260200160002060008282546112709190613a6b565b925050819055506001601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600d60008154809291906112e490613877565b9190505590506112f43382611969565b505b6112fe6119e0565b5050565b61130d8484846107d2565b611319848484846119ea565b50505050565b606061132a82611531565b506000611335611ba1565b905060008151116113555760405180602001604052806000815250611380565b8061135f84611c33565b604051602001611370929190613c45565b6040516020818303038152906040525b915050919050565b6000611396600c5483611987565b9050919050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611439611610565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036114ab5760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016114a29190612d77565b60405180910390fd5b6114b4816116ad565b50565b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061152a575061152982611d01565b5b9050919050565b60008061153d83611de3565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036115b057826040517f7e2732890000000000000000000000000000000000000000000000000000000081526004016115a79190612c10565b60405180910390fd5b80915050919050565b60006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600033905090565b61160b8383836001611e20565b505050565b6116186115f6565b73ffffffffffffffffffffffffffffffffffffffff16611636610cd0565b73ffffffffffffffffffffffffffffffffffffffff1614611695576116596115f6565b6040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040161168c9190612d77565b60405180910390fd5b565b60006116a4848484611fe5565b90509392505050565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036117e457816040517f5b08ba180000000000000000000000000000000000000000000000000000000081526004016117db9190612d77565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516118d59190612bdc565b60405180910390a3505050565b6002600b540361191e576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600b81905550565b611930610a4c565b15611967576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b611983828260405180602001604052806000815250612102565b5050565b600080600f60008581526020019081526020016000205490506000336040516020016119b39190613cc0565b6040516020818303038152906040528051906020012090506119d684838361211e565b9250505092915050565b6001600b81905550565b60008373ffffffffffffffffffffffffffffffffffffffff163b1115611b9b578273ffffffffffffffffffffffffffffffffffffffff1663150b7a02611a2e6115f6565b8685856040518563ffffffff1660e01b8152600401611a509493929190613d30565b6020604051808303816000875af1925050508015611a8c57506040513d601f19601f82011682018060405250810190611a899190613d91565b60015b611b10573d8060008114611abc576040519150601f19603f3d011682016040523d82523d6000602084013e611ac1565b606091505b506000815103611b0857836040517f64a0ae92000000000000000000000000000000000000000000000000000000008152600401611aff9190612d77565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614611b9957836040517f64a0ae92000000000000000000000000000000000000000000000000000000008152600401611b909190612d77565b60405180910390fd5b505b50505050565b6060600e8054611bb09061350a565b80601f0160208091040260200160405190810160405280929190818152602001828054611bdc9061350a565b8015611c295780601f10611bfe57610100808354040283529160200191611c29565b820191906000526020600020905b815481529060010190602001808311611c0c57829003601f168201915b5050505050905090565b606060006001611c4284612135565b01905060008167ffffffffffffffff811115611c6157611c60612ed1565b5b6040519080825280601f01601f191660200182016040528015611c935781602001600182028036833780820191505090505b509050600082602001820190505b600115611cf6578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581611cea57611ce9613dbe565b5b04945060008503611ca1575b819350505050919050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611dcc57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80611ddc5750611ddb82612288565b5b9050919050565b60006002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b8080611e595750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f8d576000611e6984611531565b9050600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ed457508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b8015611ee75750611ee5818461139d565b155b15611f2957826040517fa9fbf51f000000000000000000000000000000000000000000000000000000008152600401611f209190612d77565b60405180910390fd5b8115611f8b57838573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b836004600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050565b600080611ff38585856122f2565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612037576120328461250c565b612076565b8473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612075576120748185612555565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16036120b8576120b3846126b6565b6120f7565b8473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146120f6576120f58585612787565b5b5b809150509392505050565b61210c8383612812565b61211960008484846119ea565b505050565b60008261212b858461290b565b1490509392505050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612193577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161218957612188613dbe565b5b0492506040810190505b6d04ee2d6d415b85acef810000000083106121d0576d04ee2d6d415b85acef810000000083816121c6576121c5613dbe565b5b0492506020810190505b662386f26fc1000083106121ff57662386f26fc1000083816121f5576121f4613dbe565b5b0492506010810190505b6305f5e1008310612228576305f5e100838161221e5761221d613dbe565b5b0492506008810190505b612710831061224d57612710838161224357612242613dbe565b5b0492506004810190505b60648310612270576064838161226657612265613dbe565b5b0492506002810190505b600a831061227f576001810190505b80915050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6000806122fe84611de3565b9050600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146123405761233f818486612961565b5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146123d157612382600085600080611e20565b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614612454576001600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b846002600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550838573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4809150509392505050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b600061256083610a75565b9050600060076000848152602001908152602001600020549050818114612645576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b600060016008805490506126ca9190613ded565b90506000600960008481526020019081526020016000205490506000600883815481106126fa576126f961359b565b5b90600052602060002001549050806008838154811061271c5761271b61359b565b5b90600052602060002001819055508160096000838152602001908152602001600020819055506009600085815260200190815260200160002060009055600880548061276b5761276a613e21565b5b6001900381819060005260206000200160009055905550505050565b6000600161279484610a75565b61279e9190613ded565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036128845760006040517f64a0ae9200000000000000000000000000000000000000000000000000000000815260040161287b9190612d77565b60405180910390fd5b600061289283836000611697565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146129065760006040517f73c6ac6e0000000000000000000000000000000000000000000000000000000081526004016128fd9190612d77565b60405180910390fd5b505050565b60008082905060005b845181101561295657612941828683815181106129345761293361359b565b5b6020026020010151612a25565b9150808061294e90613877565b915050612914565b508091505092915050565b61296c838383612a50565b612a2057600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036129e157806040517f7e2732890000000000000000000000000000000000000000000000000000000081526004016129d89190612c10565b60405180910390fd5b81816040517f177e802f000000000000000000000000000000000000000000000000000000008152600401612a17929190613572565b60405180910390fd5b505050565b6000818310612a3d57612a388284612b11565b612a48565b612a478383612b11565b5b905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015612b0857508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480612ac95750612ac8848461139d565b5b80612b0757508273ffffffffffffffffffffffffffffffffffffffff16612aef836115b9565b73ffffffffffffffffffffffffffffffffffffffff16145b5b90509392505050565b600082600052816020526040600020905092915050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b612b7181612b3c565b8114612b7c57600080fd5b50565b600081359050612b8e81612b68565b92915050565b600060208284031215612baa57612ba9612b32565b5b6000612bb884828501612b7f565b91505092915050565b60008115159050919050565b612bd681612bc1565b82525050565b6000602082019050612bf16000830184612bcd565b92915050565b6000819050919050565b612c0a81612bf7565b82525050565b6000602082019050612c256000830184612c01565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612c65578082015181840152602081019050612c4a565b60008484015250505050565b6000601f19601f8301169050919050565b6000612c8d82612c2b565b612c978185612c36565b9350612ca7818560208601612c47565b612cb081612c71565b840191505092915050565b60006020820190508181036000830152612cd58184612c82565b905092915050565b612ce681612bf7565b8114612cf157600080fd5b50565b600081359050612d0381612cdd565b92915050565b600060208284031215612d1f57612d1e612b32565b5b6000612d2d84828501612cf4565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612d6182612d36565b9050919050565b612d7181612d56565b82525050565b6000602082019050612d8c6000830184612d68565b92915050565b612d9b81612d56565b8114612da657600080fd5b50565b600081359050612db881612d92565b92915050565b60008060408385031215612dd557612dd4612b32565b5b6000612de385828601612da9565b9250506020612df485828601612cf4565b9150509250929050565b6000819050919050565b612e1181612dfe565b8114612e1c57600080fd5b50565b600081359050612e2e81612e08565b92915050565b60008060408385031215612e4b57612e4a612b32565b5b6000612e5985828601612cf4565b9250506020612e6a85828601612e1f565b9150509250929050565b600080600060608486031215612e8d57612e8c612b32565b5b6000612e9b86828701612da9565b9350506020612eac86828701612da9565b9250506040612ebd86828701612cf4565b9150509250925092565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612f0982612c71565b810181811067ffffffffffffffff82111715612f2857612f27612ed1565b5b80604052505050565b6000612f3b612b28565b9050612f478282612f00565b919050565b600067ffffffffffffffff821115612f6757612f66612ed1565b5b612f7082612c71565b9050602081019050919050565b82818337600083830152505050565b6000612f9f612f9a84612f4c565b612f31565b905082815260208101848484011115612fbb57612fba612ecc565b5b612fc6848285612f7d565b509392505050565b600082601f830112612fe357612fe2612ec7565b5b8135612ff3848260208601612f8c565b91505092915050565b60006020828403121561301257613011612b32565b5b600082013567ffffffffffffffff8111156130305761302f612b37565b5b61303c84828501612fce565b91505092915050565b60006020828403121561305b5761305a612b32565b5b600061306984828501612da9565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6130a781612bf7565b82525050565b60006130b9838361309e565b60208301905092915050565b6000602082019050919050565b60006130dd82613072565b6130e7818561307d565b93506130f28361308e565b8060005b8381101561312357815161310a88826130ad565b9750613115836130c5565b9250506001810190506130f6565b5085935050505092915050565b6000602082019050818103600083015261314a81846130d2565b905092915050565b61315b81612bc1565b811461316657600080fd5b50565b60008135905061317881613152565b92915050565b6000806040838503121561319557613194612b32565b5b60006131a385828601612da9565b92505060206131b485828601613169565b9150509250929050565b600080fd5b600080fd5b60008083601f8401126131de576131dd612ec7565b5b8235905067ffffffffffffffff8111156131fb576131fa6131be565b5b602083019150836020820283011115613217576132166131c3565b5b9250929050565b6000806020838503121561323557613234612b32565b5b600083013567ffffffffffffffff81111561325357613252612b37565b5b61325f858286016131c8565b92509250509250929050565b600067ffffffffffffffff82111561328657613285612ed1565b5b61328f82612c71565b9050602081019050919050565b60006132af6132aa8461326b565b612f31565b9050828152602081018484840111156132cb576132ca612ecc565b5b6132d6848285612f7d565b509392505050565b600082601f8301126132f3576132f2612ec7565b5b813561330384826020860161329c565b91505092915050565b6000806000806080858703121561332657613325612b32565b5b600061333487828801612da9565b945050602061334587828801612da9565b935050604061335687828801612cf4565b925050606085013567ffffffffffffffff81111561337757613376612b37565b5b613383878288016132de565b91505092959194509250565b600067ffffffffffffffff8211156133aa576133a9612ed1565b5b602082029050602081019050919050565b60006133ce6133c98461338f565b612f31565b905080838252602082019050602084028301858111156133f1576133f06131c3565b5b835b8181101561341a57806134068882612e1f565b8452602084019350506020810190506133f3565b5050509392505050565b600082601f83011261343957613438612ec7565b5b81356134498482602086016133bb565b91505092915050565b60006020828403121561346857613467612b32565b5b600082013567ffffffffffffffff81111561348657613485612b37565b5b61349284828501613424565b91505092915050565b600080604083850312156134b2576134b1612b32565b5b60006134c085828601612da9565b92505060206134d185828601612da9565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061352257607f821691505b602082108103613535576135346134db565b5b50919050565b60006060820190506135506000830186612d68565b61355d6020830185612c01565b61356a6040830184612d68565b949350505050565b60006040820190506135876000830185612d68565b6135946020830184612c01565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b60006008830261362c7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826135ef565b61363686836135ef565b95508019841693508086168417925050509392505050565b6000819050919050565b600061367361366e61366984612bf7565b61364e565b612bf7565b9050919050565b6000819050919050565b61368d83613658565b6136a16136998261367a565b8484546135fc565b825550505050565b600090565b6136b66136a9565b6136c1818484613684565b505050565b5b818110156136e5576136da6000826136ae565b6001810190506136c7565b5050565b601f82111561372a576136fb816135ca565b613704846135df565b81016020851015613713578190505b61372761371f856135df565b8301826136c6565b50505b505050565b600082821c905092915050565b600061374d6000198460080261372f565b1980831691505092915050565b6000613766838361373c565b9150826002028217905092915050565b61377f82612c2b565b67ffffffffffffffff81111561379857613797612ed1565b5b6137a2825461350a565b6137ad8282856136e9565b600060209050601f8311600181146137e057600084156137ce578287015190505b6137d8858261375a565b865550613840565b601f1984166137ee866135ca565b60005b82811015613816578489015182556001820191506020850194506020810190506137f1565b86831015613833578489015161382f601f89168261373c565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061388282612bf7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036138b4576138b3613848565b5b600182019050919050565b7f436f6e74726163742063616c6c6572206d7573742062652065787465726e616c60008201527f6c79206f776e6564206163636f756e7400000000000000000000000000000000602082015250565b600061391b603083612c36565b9150613926826138bf565b604082019050919050565b6000602082019050818103600083015261394a8161390e565b9050919050565b7f53616c65206973206e6f74206163746976650000000000000000000000000000600082015250565b6000613987601283612c36565b915061399282613951565b602082019050919050565b600060208201905081810360008301526139b68161397a565b9050919050565b7f416c7265616479206d696e746564000000000000000000000000000000000000600082015250565b60006139f3600e83612c36565b91506139fe826139bd565b602082019050919050565b60006020820190508181036000830152613a22816139e6565b9050919050565b6000613a3482612bf7565b9150613a3f83612bf7565b9250828202613a4d81612bf7565b91508282048414831517613a6457613a63613848565b5b5092915050565b6000613a7682612bf7565b9150613a8183612bf7565b9250828201905080821115613a9957613a98613848565b5b92915050565b7f457863656564206d617820737570706c79000000000000000000000000000000600082015250565b6000613ad5601183612c36565b9150613ae082613a9f565b602082019050919050565b60006020820190508181036000830152613b0481613ac8565b9050919050565b7f4e6f7420696e207468652077686974656c697374000000000000000000000000600082015250565b6000613b41601483612c36565b9150613b4c82613b0b565b602082019050919050565b60006020820190508181036000830152613b7081613b34565b9050919050565b7f457863656564206d61782077686974656c69737420737570706c790000000000600082015250565b6000613bad601b83612c36565b9150613bb882613b77565b602082019050919050565b60006020820190508181036000830152613bdc81613ba0565b9050919050565b600081905092915050565b6000613bf982612c2b565b613c038185613be3565b9350613c13818560208601612c47565b80840191505092915050565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000815250565b6000613c518285613bee565b9150613c5d8284613bee565b9150613c6882613c1f565b6005820191508190509392505050565b60008160601b9050919050565b6000613c9082613c78565b9050919050565b6000613ca282613c85565b9050919050565b613cba613cb582612d56565b613c97565b82525050565b6000613ccc8284613ca9565b60148201915081905092915050565b600081519050919050565b600082825260208201905092915050565b6000613d0282613cdb565b613d0c8185613ce6565b9350613d1c818560208601612c47565b613d2581612c71565b840191505092915050565b6000608082019050613d456000830187612d68565b613d526020830186612d68565b613d5f6040830185612c01565b8181036060830152613d718184613cf7565b905095945050505050565b600081519050613d8b81612b68565b92915050565b600060208284031215613da757613da6612b32565b5b6000613db584828501613d7c565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613df882612bf7565b9150613e0383612bf7565b9250828203905081811115613e1b57613e1a613848565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea264697066735822122099c878bbc308b11fcccfdcd4828909894923a9958727f24091495d654ff8228164736f6c63430008140033000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000003cedb46b7c059158fe39e2f15961a6b054b2cae900000000000000000000000000000000000000000000000000000000000000084d6f6f6e6b69647a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044d4b445a00000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102065760003560e01c80636352211e1161011a57806395d89b41116100ad578063b88d4fde1161007c578063b88d4fde146105a3578063c87b56dd146105bf578063cf7cd8fa146105ef578063e985e9c51461061f578063f2fde38b1461064f57610206565b806395d89b411461052f578063a22cb4651461054d578063af2d4f1414610569578063b77a147b1461058757610206565b80638462151c116100e95780638462151c146104b957806388084605146104e95780638da5cb5b146104f3578063943274c61461051157610206565b80636352211e1461043157806370a0823114610461578063715018a614610491578063716f10bf1461049b57610206565b806323b872dd1161019d57806332cb6b0c1161016c57806332cb6b0c1461038d57806342842e0e146103ab5780634f6ccce7146103c757806355f804b3146103f75780635c975abb1461041357610206565b806323b872dd146103075780632a47f799146103235780632cc82655146103415780632f745c591461035d57610206565b8063095ea7b3116101d9578063095ea7b3146102a75780630f5d66ad146102c357806318160ddd146102cd57806318712c21146102eb57610206565b806301ffc9a71461020b578063055ad42e1461023b57806306fdde0314610259578063081812fc14610277575b600080fd5b61022560048036038101906102209190612b94565b61066b565b6040516102329190612bdc565b60405180910390f35b61024361067d565b6040516102509190612c10565b60405180910390f35b610261610683565b60405161026e9190612cbb565b60405180910390f35b610291600480360381019061028c9190612d09565b610715565b60405161029e9190612d77565b60405180910390f35b6102c160048036038101906102bc9190612dbe565b610731565b005b6102cb610747565b005b6102d56107a1565b6040516102e29190612c10565b60405180910390f35b61030560048036038101906103009190612e34565b6107ae565b005b610321600480360381019061031c9190612e74565b6107d2565b005b61032b6108d4565b6040516103389190612c10565b60405180910390f35b61035b60048036038101906103569190612d09565b6108da565b005b61037760048036038101906103729190612dbe565b6108ec565b6040516103849190612c10565b60405180910390f35b610395610995565b6040516103a29190612c10565b60405180910390f35b6103c560048036038101906103c09190612e74565b61099b565b005b6103e160048036038101906103dc9190612d09565b6109bb565b6040516103ee9190612c10565b60405180910390f35b610411600480360381019061040c9190612ffc565b610a31565b005b61041b610a4c565b6040516104289190612bdc565b60405180910390f35b61044b60048036038101906104469190612d09565b610a63565b6040516104589190612d77565b60405180910390f35b61047b60048036038101906104769190613045565b610a75565b6040516104889190612c10565b60405180910390f35b610499610b2f565b005b6104a3610b43565b6040516104b09190612bdc565b60405180910390f35b6104d360048036038101906104ce9190613045565b610b6d565b6040516104e09190613130565b60405180910390f35b6104f1610c76565b005b6104fb610cd0565b6040516105089190612d77565b60405180910390f35b610519610cfa565b6040516105269190612bdc565b60405180910390f35b610537610d24565b6040516105449190612cbb565b60405180910390f35b6105676004803603810190610562919061317e565b610db6565b005b610571610dcc565b60405161057e9190612c10565b60405180910390f35b6105a1600480360381019061059c919061321e565b610dd2565b005b6105bd60048036038101906105b8919061330c565b611302565b005b6105d960048036038101906105d49190612d09565b61131f565b6040516105e69190612cbb565b60405180910390f35b61060960048036038101906106049190613452565b611388565b6040516106169190612bdc565b60405180910390f35b6106396004803603810190610634919061349b565b61139d565b6040516106469190612bdc565b60405180910390f35b61066960048036038101906106649190613045565b611431565b005b6000610676826114b7565b9050919050565b600c5481565b6060600080546106929061350a565b80601f01602080910402602001604051908101604052809291908181526020018280546106be9061350a565b801561070b5780601f106106e05761010080835404028352916020019161070b565b820191906000526020600020905b8154815290600101906020018083116106ee57829003601f168201915b5050505050905090565b600061072082611531565b5061072a826115b9565b9050919050565b610743828261073e6115f6565b6115fe565b5050565b61074f611610565b60116000600c54815260200190815260200160002060009054906101000a900460ff161560116000600c54815260200190815260200160002060006101000a81548160ff021916908315150217905550565b6000600880549050905090565b6107b6611610565b80600f6000848152602001908152602001600020819055505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036108445760006040517f64a0ae9200000000000000000000000000000000000000000000000000000000815260040161083b9190612d77565b60405180910390fd5b600061085883836108536115f6565b611697565b90508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146108ce578382826040517f64283d7b0000000000000000000000000000000000000000000000000000000081526004016108c59392919061353b565b60405180910390fd5b50505050565b61101381565b6108e2611610565b80600c8190555050565b60006108f783610a75565b821061093c5782826040517fa57d13dc000000000000000000000000000000000000000000000000000000008152600401610933929190613572565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b61303981565b6109b683838360405180602001604052806000815250611302565b505050565b60006109c56107a1565b8210610a0b576000826040517fa57d13dc000000000000000000000000000000000000000000000000000000008152600401610a02929190613572565b60405180910390fd5b60088281548110610a1f57610a1e61359b565b5b90600052602060002001549050919050565b610a39611610565b80600e9081610a489190613776565b5050565b6000600a60149054906101000a900460ff16905090565b6000610a6e82611531565b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610ae85760006040517f89c62b64000000000000000000000000000000000000000000000000000000008152600401610adf9190612d77565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610b37611610565b610b4160006116ad565b565b600060116000600c54815260200190815260200160002060009054906101000a900460ff16905090565b60606000610b7a83610a75565b905060008103610bd657600067ffffffffffffffff811115610b9f57610b9e612ed1565b5b604051908082528060200260200182016040528015610bcd5781602001602082028036833780820191505090505b50915050610c71565b60008167ffffffffffffffff811115610bf257610bf1612ed1565b5b604051908082528060200260200182016040528015610c205781602001602082028036833780820191505090505b50905060005b82811015610c6a57610c3885826108ec565b828281518110610c4b57610c4a61359b565b5b6020026020010181815250508080610c6290613877565b915050610c26565b5080925050505b919050565b610c7e611610565b60126000600c54815260200190815260200160002060009054906101000a900460ff161560126000600c54815260200190815260200160002060006101000a81548160ff021916908315150217905550565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600060126000600c54815260200190815260200160002060009054906101000a900460ff16905090565b606060018054610d339061350a565b80601f0160208091040260200160405190810160405280929190818152602001828054610d5f9061350a565b8015610dac5780601f10610d8157610100808354040283529160200191610dac565b820191906000526020600020905b815481529060010190602001808311610d8f57829003601f168201915b5050505050905090565b610dc8610dc16115f6565b8383611773565b5050565b61080981565b610dda6118e2565b610de2611928565b3373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4790613931565b60405180910390fd5b60116000600c54815260200190815260200160002060009054906101000a900460ff1680610e9d575060126000600c54815260200190815260200160002060009054906101000a900460ff165b610edc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed39061399d565b60405180910390fd5b610ee4610cfa565b156110b85760001515601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610f7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7390613a09565b60405180910390fd5b600c54611013610f8c9190613a29565b6001610f966107a1565b610fa09190613a6b565b1115610fe1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd890613aeb565b60405180910390fd5b6130396001610fee6107a1565b610ff89190613a6b565b1115611039576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161103090613aeb565b60405180910390fd5b6001601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600d60008154809291906110a690613877565b9190505590506110b63382611969565b505b6110c0610b43565b156112f657611112600c54838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050611987565b611151576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114890613b57565b60405180910390fd5b60001515601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146111e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111db90613a09565b60405180910390fd5b610809600160136000600c548152602001908152602001600020546112099190613a6b565b111561124a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124190613bc3565b60405180910390fd5b600160136000600c54815260200190815260200160002060008282546112709190613a6b565b925050819055506001601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600d60008154809291906112e490613877565b9190505590506112f43382611969565b505b6112fe6119e0565b5050565b61130d8484846107d2565b611319848484846119ea565b50505050565b606061132a82611531565b506000611335611ba1565b905060008151116113555760405180602001604052806000815250611380565b8061135f84611c33565b604051602001611370929190613c45565b6040516020818303038152906040525b915050919050565b6000611396600c5483611987565b9050919050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611439611610565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036114ab5760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016114a29190612d77565b60405180910390fd5b6114b4816116ad565b50565b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061152a575061152982611d01565b5b9050919050565b60008061153d83611de3565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036115b057826040517f7e2732890000000000000000000000000000000000000000000000000000000081526004016115a79190612c10565b60405180910390fd5b80915050919050565b60006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600033905090565b61160b8383836001611e20565b505050565b6116186115f6565b73ffffffffffffffffffffffffffffffffffffffff16611636610cd0565b73ffffffffffffffffffffffffffffffffffffffff1614611695576116596115f6565b6040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040161168c9190612d77565b60405180910390fd5b565b60006116a4848484611fe5565b90509392505050565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036117e457816040517f5b08ba180000000000000000000000000000000000000000000000000000000081526004016117db9190612d77565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516118d59190612bdc565b60405180910390a3505050565b6002600b540361191e576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600b81905550565b611930610a4c565b15611967576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b611983828260405180602001604052806000815250612102565b5050565b600080600f60008581526020019081526020016000205490506000336040516020016119b39190613cc0565b6040516020818303038152906040528051906020012090506119d684838361211e565b9250505092915050565b6001600b81905550565b60008373ffffffffffffffffffffffffffffffffffffffff163b1115611b9b578273ffffffffffffffffffffffffffffffffffffffff1663150b7a02611a2e6115f6565b8685856040518563ffffffff1660e01b8152600401611a509493929190613d30565b6020604051808303816000875af1925050508015611a8c57506040513d601f19601f82011682018060405250810190611a899190613d91565b60015b611b10573d8060008114611abc576040519150601f19603f3d011682016040523d82523d6000602084013e611ac1565b606091505b506000815103611b0857836040517f64a0ae92000000000000000000000000000000000000000000000000000000008152600401611aff9190612d77565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614611b9957836040517f64a0ae92000000000000000000000000000000000000000000000000000000008152600401611b909190612d77565b60405180910390fd5b505b50505050565b6060600e8054611bb09061350a565b80601f0160208091040260200160405190810160405280929190818152602001828054611bdc9061350a565b8015611c295780601f10611bfe57610100808354040283529160200191611c29565b820191906000526020600020905b815481529060010190602001808311611c0c57829003601f168201915b5050505050905090565b606060006001611c4284612135565b01905060008167ffffffffffffffff811115611c6157611c60612ed1565b5b6040519080825280601f01601f191660200182016040528015611c935781602001600182028036833780820191505090505b509050600082602001820190505b600115611cf6578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581611cea57611ce9613dbe565b5b04945060008503611ca1575b819350505050919050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611dcc57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80611ddc5750611ddb82612288565b5b9050919050565b60006002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b8080611e595750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f8d576000611e6984611531565b9050600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ed457508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b8015611ee75750611ee5818461139d565b155b15611f2957826040517fa9fbf51f000000000000000000000000000000000000000000000000000000008152600401611f209190612d77565b60405180910390fd5b8115611f8b57838573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b836004600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050565b600080611ff38585856122f2565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612037576120328461250c565b612076565b8473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612075576120748185612555565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16036120b8576120b3846126b6565b6120f7565b8473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146120f6576120f58585612787565b5b5b809150509392505050565b61210c8383612812565b61211960008484846119ea565b505050565b60008261212b858461290b565b1490509392505050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612193577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161218957612188613dbe565b5b0492506040810190505b6d04ee2d6d415b85acef810000000083106121d0576d04ee2d6d415b85acef810000000083816121c6576121c5613dbe565b5b0492506020810190505b662386f26fc1000083106121ff57662386f26fc1000083816121f5576121f4613dbe565b5b0492506010810190505b6305f5e1008310612228576305f5e100838161221e5761221d613dbe565b5b0492506008810190505b612710831061224d57612710838161224357612242613dbe565b5b0492506004810190505b60648310612270576064838161226657612265613dbe565b5b0492506002810190505b600a831061227f576001810190505b80915050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6000806122fe84611de3565b9050600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146123405761233f818486612961565b5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146123d157612382600085600080611e20565b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614612454576001600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b846002600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550838573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4809150509392505050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b600061256083610a75565b9050600060076000848152602001908152602001600020549050818114612645576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b600060016008805490506126ca9190613ded565b90506000600960008481526020019081526020016000205490506000600883815481106126fa576126f961359b565b5b90600052602060002001549050806008838154811061271c5761271b61359b565b5b90600052602060002001819055508160096000838152602001908152602001600020819055506009600085815260200190815260200160002060009055600880548061276b5761276a613e21565b5b6001900381819060005260206000200160009055905550505050565b6000600161279484610a75565b61279e9190613ded565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036128845760006040517f64a0ae9200000000000000000000000000000000000000000000000000000000815260040161287b9190612d77565b60405180910390fd5b600061289283836000611697565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146129065760006040517f73c6ac6e0000000000000000000000000000000000000000000000000000000081526004016128fd9190612d77565b60405180910390fd5b505050565b60008082905060005b845181101561295657612941828683815181106129345761293361359b565b5b6020026020010151612a25565b9150808061294e90613877565b915050612914565b508091505092915050565b61296c838383612a50565b612a2057600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036129e157806040517f7e2732890000000000000000000000000000000000000000000000000000000081526004016129d89190612c10565b60405180910390fd5b81816040517f177e802f000000000000000000000000000000000000000000000000000000008152600401612a17929190613572565b60405180910390fd5b505050565b6000818310612a3d57612a388284612b11565b612a48565b612a478383612b11565b5b905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015612b0857508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480612ac95750612ac8848461139d565b5b80612b0757508273ffffffffffffffffffffffffffffffffffffffff16612aef836115b9565b73ffffffffffffffffffffffffffffffffffffffff16145b5b90509392505050565b600082600052816020526040600020905092915050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b612b7181612b3c565b8114612b7c57600080fd5b50565b600081359050612b8e81612b68565b92915050565b600060208284031215612baa57612ba9612b32565b5b6000612bb884828501612b7f565b91505092915050565b60008115159050919050565b612bd681612bc1565b82525050565b6000602082019050612bf16000830184612bcd565b92915050565b6000819050919050565b612c0a81612bf7565b82525050565b6000602082019050612c256000830184612c01565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612c65578082015181840152602081019050612c4a565b60008484015250505050565b6000601f19601f8301169050919050565b6000612c8d82612c2b565b612c978185612c36565b9350612ca7818560208601612c47565b612cb081612c71565b840191505092915050565b60006020820190508181036000830152612cd58184612c82565b905092915050565b612ce681612bf7565b8114612cf157600080fd5b50565b600081359050612d0381612cdd565b92915050565b600060208284031215612d1f57612d1e612b32565b5b6000612d2d84828501612cf4565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612d6182612d36565b9050919050565b612d7181612d56565b82525050565b6000602082019050612d8c6000830184612d68565b92915050565b612d9b81612d56565b8114612da657600080fd5b50565b600081359050612db881612d92565b92915050565b60008060408385031215612dd557612dd4612b32565b5b6000612de385828601612da9565b9250506020612df485828601612cf4565b9150509250929050565b6000819050919050565b612e1181612dfe565b8114612e1c57600080fd5b50565b600081359050612e2e81612e08565b92915050565b60008060408385031215612e4b57612e4a612b32565b5b6000612e5985828601612cf4565b9250506020612e6a85828601612e1f565b9150509250929050565b600080600060608486031215612e8d57612e8c612b32565b5b6000612e9b86828701612da9565b9350506020612eac86828701612da9565b9250506040612ebd86828701612cf4565b9150509250925092565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612f0982612c71565b810181811067ffffffffffffffff82111715612f2857612f27612ed1565b5b80604052505050565b6000612f3b612b28565b9050612f478282612f00565b919050565b600067ffffffffffffffff821115612f6757612f66612ed1565b5b612f7082612c71565b9050602081019050919050565b82818337600083830152505050565b6000612f9f612f9a84612f4c565b612f31565b905082815260208101848484011115612fbb57612fba612ecc565b5b612fc6848285612f7d565b509392505050565b600082601f830112612fe357612fe2612ec7565b5b8135612ff3848260208601612f8c565b91505092915050565b60006020828403121561301257613011612b32565b5b600082013567ffffffffffffffff8111156130305761302f612b37565b5b61303c84828501612fce565b91505092915050565b60006020828403121561305b5761305a612b32565b5b600061306984828501612da9565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6130a781612bf7565b82525050565b60006130b9838361309e565b60208301905092915050565b6000602082019050919050565b60006130dd82613072565b6130e7818561307d565b93506130f28361308e565b8060005b8381101561312357815161310a88826130ad565b9750613115836130c5565b9250506001810190506130f6565b5085935050505092915050565b6000602082019050818103600083015261314a81846130d2565b905092915050565b61315b81612bc1565b811461316657600080fd5b50565b60008135905061317881613152565b92915050565b6000806040838503121561319557613194612b32565b5b60006131a385828601612da9565b92505060206131b485828601613169565b9150509250929050565b600080fd5b600080fd5b60008083601f8401126131de576131dd612ec7565b5b8235905067ffffffffffffffff8111156131fb576131fa6131be565b5b602083019150836020820283011115613217576132166131c3565b5b9250929050565b6000806020838503121561323557613234612b32565b5b600083013567ffffffffffffffff81111561325357613252612b37565b5b61325f858286016131c8565b92509250509250929050565b600067ffffffffffffffff82111561328657613285612ed1565b5b61328f82612c71565b9050602081019050919050565b60006132af6132aa8461326b565b612f31565b9050828152602081018484840111156132cb576132ca612ecc565b5b6132d6848285612f7d565b509392505050565b600082601f8301126132f3576132f2612ec7565b5b813561330384826020860161329c565b91505092915050565b6000806000806080858703121561332657613325612b32565b5b600061333487828801612da9565b945050602061334587828801612da9565b935050604061335687828801612cf4565b925050606085013567ffffffffffffffff81111561337757613376612b37565b5b613383878288016132de565b91505092959194509250565b600067ffffffffffffffff8211156133aa576133a9612ed1565b5b602082029050602081019050919050565b60006133ce6133c98461338f565b612f31565b905080838252602082019050602084028301858111156133f1576133f06131c3565b5b835b8181101561341a57806134068882612e1f565b8452602084019350506020810190506133f3565b5050509392505050565b600082601f83011261343957613438612ec7565b5b81356134498482602086016133bb565b91505092915050565b60006020828403121561346857613467612b32565b5b600082013567ffffffffffffffff81111561348657613485612b37565b5b61349284828501613424565b91505092915050565b600080604083850312156134b2576134b1612b32565b5b60006134c085828601612da9565b92505060206134d185828601612da9565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061352257607f821691505b602082108103613535576135346134db565b5b50919050565b60006060820190506135506000830186612d68565b61355d6020830185612c01565b61356a6040830184612d68565b949350505050565b60006040820190506135876000830185612d68565b6135946020830184612c01565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b60006008830261362c7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826135ef565b61363686836135ef565b95508019841693508086168417925050509392505050565b6000819050919050565b600061367361366e61366984612bf7565b61364e565b612bf7565b9050919050565b6000819050919050565b61368d83613658565b6136a16136998261367a565b8484546135fc565b825550505050565b600090565b6136b66136a9565b6136c1818484613684565b505050565b5b818110156136e5576136da6000826136ae565b6001810190506136c7565b5050565b601f82111561372a576136fb816135ca565b613704846135df565b81016020851015613713578190505b61372761371f856135df565b8301826136c6565b50505b505050565b600082821c905092915050565b600061374d6000198460080261372f565b1980831691505092915050565b6000613766838361373c565b9150826002028217905092915050565b61377f82612c2b565b67ffffffffffffffff81111561379857613797612ed1565b5b6137a2825461350a565b6137ad8282856136e9565b600060209050601f8311600181146137e057600084156137ce578287015190505b6137d8858261375a565b865550613840565b601f1984166137ee866135ca565b60005b82811015613816578489015182556001820191506020850194506020810190506137f1565b86831015613833578489015161382f601f89168261373c565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061388282612bf7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036138b4576138b3613848565b5b600182019050919050565b7f436f6e74726163742063616c6c6572206d7573742062652065787465726e616c60008201527f6c79206f776e6564206163636f756e7400000000000000000000000000000000602082015250565b600061391b603083612c36565b9150613926826138bf565b604082019050919050565b6000602082019050818103600083015261394a8161390e565b9050919050565b7f53616c65206973206e6f74206163746976650000000000000000000000000000600082015250565b6000613987601283612c36565b915061399282613951565b602082019050919050565b600060208201905081810360008301526139b68161397a565b9050919050565b7f416c7265616479206d696e746564000000000000000000000000000000000000600082015250565b60006139f3600e83612c36565b91506139fe826139bd565b602082019050919050565b60006020820190508181036000830152613a22816139e6565b9050919050565b6000613a3482612bf7565b9150613a3f83612bf7565b9250828202613a4d81612bf7565b91508282048414831517613a6457613a63613848565b5b5092915050565b6000613a7682612bf7565b9150613a8183612bf7565b9250828201905080821115613a9957613a98613848565b5b92915050565b7f457863656564206d617820737570706c79000000000000000000000000000000600082015250565b6000613ad5601183612c36565b9150613ae082613a9f565b602082019050919050565b60006020820190508181036000830152613b0481613ac8565b9050919050565b7f4e6f7420696e207468652077686974656c697374000000000000000000000000600082015250565b6000613b41601483612c36565b9150613b4c82613b0b565b602082019050919050565b60006020820190508181036000830152613b7081613b34565b9050919050565b7f457863656564206d61782077686974656c69737420737570706c790000000000600082015250565b6000613bad601b83612c36565b9150613bb882613b77565b602082019050919050565b60006020820190508181036000830152613bdc81613ba0565b9050919050565b600081905092915050565b6000613bf982612c2b565b613c038185613be3565b9350613c13818560208601612c47565b80840191505092915050565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000815250565b6000613c518285613bee565b9150613c5d8284613bee565b9150613c6882613c1f565b6005820191508190509392505050565b60008160601b9050919050565b6000613c9082613c78565b9050919050565b6000613ca282613c85565b9050919050565b613cba613cb582612d56565b613c97565b82525050565b6000613ccc8284613ca9565b60148201915081905092915050565b600081519050919050565b600082825260208201905092915050565b6000613d0282613cdb565b613d0c8185613ce6565b9350613d1c818560208601612c47565b613d2581612c71565b840191505092915050565b6000608082019050613d456000830187612d68565b613d526020830186612d68565b613d5f6040830185612c01565b8181036060830152613d718184613cf7565b905095945050505050565b600081519050613d8b81612b68565b92915050565b600060208284031215613da757613da6612b32565b5b6000613db584828501613d7c565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613df882612bf7565b9150613e0383612bf7565b9250828203905081811115613e1b57613e1a613848565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea264697066735822122099c878bbc308b11fcccfdcd4828909894923a9958727f24091495d654ff8228164736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000003cedb46b7c059158fe39e2f15961a6b054b2cae900000000000000000000000000000000000000000000000000000000000000084d6f6f6e6b69647a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044d4b445a00000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _name (string): Moonkidz
Arg [1] : _symbol (string): MKDZ
Arg [2] : _owner (address): 0x3ceDb46B7c059158FE39E2F15961A6B054b2cae9
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [2] : 0000000000000000000000003cedb46b7c059158fe39e2f15961a6b054b2cae9
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [4] : 4d6f6f6e6b69647a000000000000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [6] : 4d4b445a00000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.