Source Code
More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 555 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Set Approval For... | 24632633 | 18 hrs ago | IN | 0 ETH | 0.00000349 | ||||
| Safe Transfer Fr... | 24628561 | 31 hrs ago | IN | 0 ETH | 0.00009953 | ||||
| Safe Transfer Fr... | 24628516 | 31 hrs ago | IN | 0 ETH | 0.00010095 | ||||
| Set Approval For... | 24627615 | 35 hrs ago | IN | 0 ETH | 0.00011329 | ||||
| Safe Transfer Fr... | 24567012 | 9 days ago | IN | 0 ETH | 0.00000515 | ||||
| Safe Transfer Fr... | 24567004 | 9 days ago | IN | 0 ETH | 0.0000032 | ||||
| Safe Transfer Fr... | 24567001 | 9 days ago | IN | 0 ETH | 0.00000312 | ||||
| Safe Transfer Fr... | 24566993 | 9 days ago | IN | 0 ETH | 0.00000293 | ||||
| Safe Transfer Fr... | 24566989 | 9 days ago | IN | 0 ETH | 0.00000331 | ||||
| Safe Transfer Fr... | 24566987 | 9 days ago | IN | 0 ETH | 0.00000331 | ||||
| Safe Transfer Fr... | 24566976 | 9 days ago | IN | 0 ETH | 0.00000288 | ||||
| Safe Transfer Fr... | 24566965 | 9 days ago | IN | 0 ETH | 0.0000027 | ||||
| Safe Transfer Fr... | 24563569 | 10 days ago | IN | 0 ETH | 0.00000236 | ||||
| Safe Transfer Fr... | 24563545 | 10 days ago | IN | 0 ETH | 0.00000356 | ||||
| Safe Transfer Fr... | 24544620 | 13 days ago | IN | 0 ETH | 0.0000944 | ||||
| Set Approval For... | 24542585 | 13 days ago | IN | 0 ETH | 0.00010622 | ||||
| Set Approval For... | 24522495 | 16 days ago | IN | 0 ETH | 0.00009962 | ||||
| Set Approval For... | 24510377 | 17 days ago | IN | 0 ETH | 0.0000493 | ||||
| Set Approval For... | 24442855 | 27 days ago | IN | 0 ETH | 0.00005526 | ||||
| Set Approval For... | 24442841 | 27 days ago | IN | 0 ETH | 0.00005119 | ||||
| Set Approval For... | 24442839 | 27 days ago | IN | 0 ETH | 0.00005138 | ||||
| Set Approval For... | 24363737 | 38 days ago | IN | 0 ETH | 0.0000203 | ||||
| Transfer From | 24165941 | 65 days ago | IN | 0 ETH | 0.00007761 | ||||
| Transfer From | 24165939 | 65 days ago | IN | 0 ETH | 0.0000874 | ||||
| Transfer From | 24165927 | 65 days ago | IN | 0 ETH | 0.00008697 |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
AtamaChibi
Compiler Version
v0.8.28+commit.7893614a
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2025-02-28
*/
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.28;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* 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[ERC 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);
}
// File: @openzeppelin/contracts/token/ERC721/IERC721.sol
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.28;
/**
* @dev Required interface of an ERC-721 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 ERC-721 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 ERC-721
* 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);
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.28;
/**
* @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);
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.28;
/**
* @title ERC-721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC-721 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);
}
// File: @openzeppelin/contracts/interfaces/draft-IERC6093.sol
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.28;
/**
* @dev Standard ERC-20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 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 ERC-721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-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 ERC-1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 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);
}
// File: @openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/utils/ERC721Utils.sol)
pragma solidity ^0.8.28;
/**
* @dev Library that provide common ERC-721 utility functions.
*
* See https://eips.ethereum.org/EIPS/eip-721[ERC-721].
*
* _Available since v5.1._
*/
library ERC721Utils {
/**
* @dev Performs an acceptance check for the provided `operator` by calling {IERC721-onERC721Received}
* on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).
*
* The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).
* Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept
* the transfer.
*/
function checkOnERC721Received(
address operator,
address from,
address to,
uint256 tokenId,
bytes memory data
) internal {
if (to.code.length > 0) {
try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) {
if (retval != IERC721Receiver.onERC721Received.selector) {
// Token rejected
revert IERC721Errors.ERC721InvalidReceiver(to);
}
} catch (bytes memory reason) {
if (reason.length == 0) {
// non-IERC721Receiver implementer
revert IERC721Errors.ERC721InvalidReceiver(to);
} else {
assembly ("memory-safe") {
revert(add(32, reason), mload(reason))
}
}
}
}
}
}
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.28;
/**
* @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;
}
}
// File: @openzeppelin/contracts/utils/Panic.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)
pragma solidity ^0.8.28;
/**
* @dev Helper library for emitting standardized panic codes.
*
* ```solidity
* contract Example {
* using Panic for uint256;
*
* // Use any of the declared internal constants
* function foo() { Panic.GENERIC.panic(); }
*
* // Alternatively
* function foo() { Panic.panic(Panic.GENERIC); }
* }
* ```
*
* Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].
*
* _Available since v5.1._
*/
// slither-disable-next-line unused-state
library Panic {
/// @dev generic / unspecified error
uint256 internal constant GENERIC = 0x00;
/// @dev used by the assert() builtin
uint256 internal constant ASSERT = 0x01;
/// @dev arithmetic underflow or overflow
uint256 internal constant UNDER_OVERFLOW = 0x11;
/// @dev division or modulo by zero
uint256 internal constant DIVISION_BY_ZERO = 0x12;
/// @dev enum conversion error
uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;
/// @dev invalid encoding in storage
uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;
/// @dev empty array pop
uint256 internal constant EMPTY_ARRAY_POP = 0x31;
/// @dev array out of bounds access
uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;
/// @dev resource error (too large allocation or too large array)
uint256 internal constant RESOURCE_ERROR = 0x41;
/// @dev calling invalid internal function
uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;
/// @dev Reverts with a panic code. Recommended to use with
/// the internal constants with predefined codes.
function panic(uint256 code) internal pure {
assembly ("memory-safe") {
mstore(0x00, 0x4e487b71)
mstore(0x20, code)
revert(0x1c, 0x24)
}
}
}
// File: @openzeppelin/contracts/utils/math/SafeCast.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.
pragma solidity ^0.8.28;
/**
* @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow
* checks.
*
* Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
* easily result in undesired exploitation or bugs, since developers usually
* assume that overflows raise errors. `SafeCast` restores this intuition by
* reverting the transaction when such an operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeCast {
/**
* @dev Value doesn't fit in an uint of `bits` size.
*/
error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);
/**
* @dev An int value doesn't fit in an uint of `bits` size.
*/
error SafeCastOverflowedIntToUint(int256 value);
/**
* @dev Value doesn't fit in an int of `bits` size.
*/
error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);
/**
* @dev An uint value doesn't fit in an int of `bits` size.
*/
error SafeCastOverflowedUintToInt(uint256 value);
/**
* @dev Returns the downcasted uint248 from uint256, reverting on
* overflow (when the input is greater than largest uint248).
*
* Counterpart to Solidity's `uint248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*/
function toUint248(uint256 value) internal pure returns (uint248) {
if (value > type(uint248).max) {
revert SafeCastOverflowedUintDowncast(248, value);
}
return uint248(value);
}
/**
* @dev Returns the downcasted uint240 from uint256, reverting on
* overflow (when the input is greater than largest uint240).
*
* Counterpart to Solidity's `uint240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*/
function toUint240(uint256 value) internal pure returns (uint240) {
if (value > type(uint240).max) {
revert SafeCastOverflowedUintDowncast(240, value);
}
return uint240(value);
}
/**
* @dev Returns the downcasted uint232 from uint256, reverting on
* overflow (when the input is greater than largest uint232).
*
* Counterpart to Solidity's `uint232` operator.
*
* Requirements:
*
* - input must fit into 232 bits
*/
function toUint232(uint256 value) internal pure returns (uint232) {
if (value > type(uint232).max) {
revert SafeCastOverflowedUintDowncast(232, value);
}
return uint232(value);
}
/**
* @dev Returns the downcasted uint224 from uint256, reverting on
* overflow (when the input is greater than largest uint224).
*
* Counterpart to Solidity's `uint224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*/
function toUint224(uint256 value) internal pure returns (uint224) {
if (value > type(uint224).max) {
revert SafeCastOverflowedUintDowncast(224, value);
}
return uint224(value);
}
/**
* @dev Returns the downcasted uint216 from uint256, reverting on
* overflow (when the input is greater than largest uint216).
*
* Counterpart to Solidity's `uint216` operator.
*
* Requirements:
*
* - input must fit into 216 bits
*/
function toUint216(uint256 value) internal pure returns (uint216) {
if (value > type(uint216).max) {
revert SafeCastOverflowedUintDowncast(216, value);
}
return uint216(value);
}
/**
* @dev Returns the downcasted uint208 from uint256, reverting on
* overflow (when the input is greater than largest uint208).
*
* Counterpart to Solidity's `uint208` operator.
*
* Requirements:
*
* - input must fit into 208 bits
*/
function toUint208(uint256 value) internal pure returns (uint208) {
if (value > type(uint208).max) {
revert SafeCastOverflowedUintDowncast(208, value);
}
return uint208(value);
}
/**
* @dev Returns the downcasted uint200 from uint256, reverting on
* overflow (when the input is greater than largest uint200).
*
* Counterpart to Solidity's `uint200` operator.
*
* Requirements:
*
* - input must fit into 200 bits
*/
function toUint200(uint256 value) internal pure returns (uint200) {
if (value > type(uint200).max) {
revert SafeCastOverflowedUintDowncast(200, value);
}
return uint200(value);
}
/**
* @dev Returns the downcasted uint192 from uint256, reverting on
* overflow (when the input is greater than largest uint192).
*
* Counterpart to Solidity's `uint192` operator.
*
* Requirements:
*
* - input must fit into 192 bits
*/
function toUint192(uint256 value) internal pure returns (uint192) {
if (value > type(uint192).max) {
revert SafeCastOverflowedUintDowncast(192, value);
}
return uint192(value);
}
/**
* @dev Returns the downcasted uint184 from uint256, reverting on
* overflow (when the input is greater than largest uint184).
*
* Counterpart to Solidity's `uint184` operator.
*
* Requirements:
*
* - input must fit into 184 bits
*/
function toUint184(uint256 value) internal pure returns (uint184) {
if (value > type(uint184).max) {
revert SafeCastOverflowedUintDowncast(184, value);
}
return uint184(value);
}
/**
* @dev Returns the downcasted uint176 from uint256, reverting on
* overflow (when the input is greater than largest uint176).
*
* Counterpart to Solidity's `uint176` operator.
*
* Requirements:
*
* - input must fit into 176 bits
*/
function toUint176(uint256 value) internal pure returns (uint176) {
if (value > type(uint176).max) {
revert SafeCastOverflowedUintDowncast(176, value);
}
return uint176(value);
}
/**
* @dev Returns the downcasted uint168 from uint256, reverting on
* overflow (when the input is greater than largest uint168).
*
* Counterpart to Solidity's `uint168` operator.
*
* Requirements:
*
* - input must fit into 168 bits
*/
function toUint168(uint256 value) internal pure returns (uint168) {
if (value > type(uint168).max) {
revert SafeCastOverflowedUintDowncast(168, value);
}
return uint168(value);
}
/**
* @dev Returns the downcasted uint160 from uint256, reverting on
* overflow (when the input is greater than largest uint160).
*
* Counterpart to Solidity's `uint160` operator.
*
* Requirements:
*
* - input must fit into 160 bits
*/
function toUint160(uint256 value) internal pure returns (uint160) {
if (value > type(uint160).max) {
revert SafeCastOverflowedUintDowncast(160, value);
}
return uint160(value);
}
/**
* @dev Returns the downcasted uint152 from uint256, reverting on
* overflow (when the input is greater than largest uint152).
*
* Counterpart to Solidity's `uint152` operator.
*
* Requirements:
*
* - input must fit into 152 bits
*/
function toUint152(uint256 value) internal pure returns (uint152) {
if (value > type(uint152).max) {
revert SafeCastOverflowedUintDowncast(152, value);
}
return uint152(value);
}
/**
* @dev Returns the downcasted uint144 from uint256, reverting on
* overflow (when the input is greater than largest uint144).
*
* Counterpart to Solidity's `uint144` operator.
*
* Requirements:
*
* - input must fit into 144 bits
*/
function toUint144(uint256 value) internal pure returns (uint144) {
if (value > type(uint144).max) {
revert SafeCastOverflowedUintDowncast(144, value);
}
return uint144(value);
}
/**
* @dev Returns the downcasted uint136 from uint256, reverting on
* overflow (when the input is greater than largest uint136).
*
* Counterpart to Solidity's `uint136` operator.
*
* Requirements:
*
* - input must fit into 136 bits
*/
function toUint136(uint256 value) internal pure returns (uint136) {
if (value > type(uint136).max) {
revert SafeCastOverflowedUintDowncast(136, value);
}
return uint136(value);
}
/**
* @dev Returns the downcasted uint128 from uint256, reverting on
* overflow (when the input is greater than largest uint128).
*
* Counterpart to Solidity's `uint128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toUint128(uint256 value) internal pure returns (uint128) {
if (value > type(uint128).max) {
revert SafeCastOverflowedUintDowncast(128, value);
}
return uint128(value);
}
/**
* @dev Returns the downcasted uint120 from uint256, reverting on
* overflow (when the input is greater than largest uint120).
*
* Counterpart to Solidity's `uint120` operator.
*
* Requirements:
*
* - input must fit into 120 bits
*/
function toUint120(uint256 value) internal pure returns (uint120) {
if (value > type(uint120).max) {
revert SafeCastOverflowedUintDowncast(120, value);
}
return uint120(value);
}
/**
* @dev Returns the downcasted uint112 from uint256, reverting on
* overflow (when the input is greater than largest uint112).
*
* Counterpart to Solidity's `uint112` operator.
*
* Requirements:
*
* - input must fit into 112 bits
*/
function toUint112(uint256 value) internal pure returns (uint112) {
if (value > type(uint112).max) {
revert SafeCastOverflowedUintDowncast(112, value);
}
return uint112(value);
}
/**
* @dev Returns the downcasted uint104 from uint256, reverting on
* overflow (when the input is greater than largest uint104).
*
* Counterpart to Solidity's `uint104` operator.
*
* Requirements:
*
* - input must fit into 104 bits
*/
function toUint104(uint256 value) internal pure returns (uint104) {
if (value > type(uint104).max) {
revert SafeCastOverflowedUintDowncast(104, value);
}
return uint104(value);
}
/**
* @dev Returns the downcasted uint96 from uint256, reverting on
* overflow (when the input is greater than largest uint96).
*
* Counterpart to Solidity's `uint96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*/
function toUint96(uint256 value) internal pure returns (uint96) {
if (value > type(uint96).max) {
revert SafeCastOverflowedUintDowncast(96, value);
}
return uint96(value);
}
/**
* @dev Returns the downcasted uint88 from uint256, reverting on
* overflow (when the input is greater than largest uint88).
*
* Counterpart to Solidity's `uint88` operator.
*
* Requirements:
*
* - input must fit into 88 bits
*/
function toUint88(uint256 value) internal pure returns (uint88) {
if (value > type(uint88).max) {
revert SafeCastOverflowedUintDowncast(88, value);
}
return uint88(value);
}
/**
* @dev Returns the downcasted uint80 from uint256, reverting on
* overflow (when the input is greater than largest uint80).
*
* Counterpart to Solidity's `uint80` operator.
*
* Requirements:
*
* - input must fit into 80 bits
*/
function toUint80(uint256 value) internal pure returns (uint80) {
if (value > type(uint80).max) {
revert SafeCastOverflowedUintDowncast(80, value);
}
return uint80(value);
}
/**
* @dev Returns the downcasted uint72 from uint256, reverting on
* overflow (when the input is greater than largest uint72).
*
* Counterpart to Solidity's `uint72` operator.
*
* Requirements:
*
* - input must fit into 72 bits
*/
function toUint72(uint256 value) internal pure returns (uint72) {
if (value > type(uint72).max) {
revert SafeCastOverflowedUintDowncast(72, value);
}
return uint72(value);
}
/**
* @dev Returns the downcasted uint64 from uint256, reverting on
* overflow (when the input is greater than largest uint64).
*
* Counterpart to Solidity's `uint64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toUint64(uint256 value) internal pure returns (uint64) {
if (value > type(uint64).max) {
revert SafeCastOverflowedUintDowncast(64, value);
}
return uint64(value);
}
/**
* @dev Returns the downcasted uint56 from uint256, reverting on
* overflow (when the input is greater than largest uint56).
*
* Counterpart to Solidity's `uint56` operator.
*
* Requirements:
*
* - input must fit into 56 bits
*/
function toUint56(uint256 value) internal pure returns (uint56) {
if (value > type(uint56).max) {
revert SafeCastOverflowedUintDowncast(56, value);
}
return uint56(value);
}
/**
* @dev Returns the downcasted uint48 from uint256, reverting on
* overflow (when the input is greater than largest uint48).
*
* Counterpart to Solidity's `uint48` operator.
*
* Requirements:
*
* - input must fit into 48 bits
*/
function toUint48(uint256 value) internal pure returns (uint48) {
if (value > type(uint48).max) {
revert SafeCastOverflowedUintDowncast(48, value);
}
return uint48(value);
}
/**
* @dev Returns the downcasted uint40 from uint256, reverting on
* overflow (when the input is greater than largest uint40).
*
* Counterpart to Solidity's `uint40` operator.
*
* Requirements:
*
* - input must fit into 40 bits
*/
function toUint40(uint256 value) internal pure returns (uint40) {
if (value > type(uint40).max) {
revert SafeCastOverflowedUintDowncast(40, value);
}
return uint40(value);
}
/**
* @dev Returns the downcasted uint32 from uint256, reverting on
* overflow (when the input is greater than largest uint32).
*
* Counterpart to Solidity's `uint32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toUint32(uint256 value) internal pure returns (uint32) {
if (value > type(uint32).max) {
revert SafeCastOverflowedUintDowncast(32, value);
}
return uint32(value);
}
/**
* @dev Returns the downcasted uint24 from uint256, reverting on
* overflow (when the input is greater than largest uint24).
*
* Counterpart to Solidity's `uint24` operator.
*
* Requirements:
*
* - input must fit into 24 bits
*/
function toUint24(uint256 value) internal pure returns (uint24) {
if (value > type(uint24).max) {
revert SafeCastOverflowedUintDowncast(24, value);
}
return uint24(value);
}
/**
* @dev Returns the downcasted uint16 from uint256, reverting on
* overflow (when the input is greater than largest uint16).
*
* Counterpart to Solidity's `uint16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toUint16(uint256 value) internal pure returns (uint16) {
if (value > type(uint16).max) {
revert SafeCastOverflowedUintDowncast(16, value);
}
return uint16(value);
}
/**
* @dev Returns the downcasted uint8 from uint256, reverting on
* overflow (when the input is greater than largest uint8).
*
* Counterpart to Solidity's `uint8` operator.
*
* Requirements:
*
* - input must fit into 8 bits
*/
function toUint8(uint256 value) internal pure returns (uint8) {
if (value > type(uint8).max) {
revert SafeCastOverflowedUintDowncast(8, value);
}
return uint8(value);
}
/**
* @dev Converts a signed int256 into an unsigned uint256.
*
* Requirements:
*
* - input must be greater than or equal to 0.
*/
function toUint256(int256 value) internal pure returns (uint256) {
if (value < 0) {
revert SafeCastOverflowedIntToUint(value);
}
return uint256(value);
}
/**
* @dev Returns the downcasted int248 from int256, reverting on
* overflow (when the input is less than smallest int248 or
* greater than largest int248).
*
* Counterpart to Solidity's `int248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*/
function toInt248(int256 value) internal pure returns (int248 downcasted) {
downcasted = int248(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(248, value);
}
}
/**
* @dev Returns the downcasted int240 from int256, reverting on
* overflow (when the input is less than smallest int240 or
* greater than largest int240).
*
* Counterpart to Solidity's `int240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*/
function toInt240(int256 value) internal pure returns (int240 downcasted) {
downcasted = int240(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(240, value);
}
}
/**
* @dev Returns the downcasted int232 from int256, reverting on
* overflow (when the input is less than smallest int232 or
* greater than largest int232).
*
* Counterpart to Solidity's `int232` operator.
*
* Requirements:
*
* - input must fit into 232 bits
*/
function toInt232(int256 value) internal pure returns (int232 downcasted) {
downcasted = int232(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(232, value);
}
}
/**
* @dev Returns the downcasted int224 from int256, reverting on
* overflow (when the input is less than smallest int224 or
* greater than largest int224).
*
* Counterpart to Solidity's `int224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*/
function toInt224(int256 value) internal pure returns (int224 downcasted) {
downcasted = int224(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(224, value);
}
}
/**
* @dev Returns the downcasted int216 from int256, reverting on
* overflow (when the input is less than smallest int216 or
* greater than largest int216).
*
* Counterpart to Solidity's `int216` operator.
*
* Requirements:
*
* - input must fit into 216 bits
*/
function toInt216(int256 value) internal pure returns (int216 downcasted) {
downcasted = int216(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(216, value);
}
}
/**
* @dev Returns the downcasted int208 from int256, reverting on
* overflow (when the input is less than smallest int208 or
* greater than largest int208).
*
* Counterpart to Solidity's `int208` operator.
*
* Requirements:
*
* - input must fit into 208 bits
*/
function toInt208(int256 value) internal pure returns (int208 downcasted) {
downcasted = int208(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(208, value);
}
}
/**
* @dev Returns the downcasted int200 from int256, reverting on
* overflow (when the input is less than smallest int200 or
* greater than largest int200).
*
* Counterpart to Solidity's `int200` operator.
*
* Requirements:
*
* - input must fit into 200 bits
*/
function toInt200(int256 value) internal pure returns (int200 downcasted) {
downcasted = int200(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(200, value);
}
}
/**
* @dev Returns the downcasted int192 from int256, reverting on
* overflow (when the input is less than smallest int192 or
* greater than largest int192).
*
* Counterpart to Solidity's `int192` operator.
*
* Requirements:
*
* - input must fit into 192 bits
*/
function toInt192(int256 value) internal pure returns (int192 downcasted) {
downcasted = int192(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(192, value);
}
}
/**
* @dev Returns the downcasted int184 from int256, reverting on
* overflow (when the input is less than smallest int184 or
* greater than largest int184).
*
* Counterpart to Solidity's `int184` operator.
*
* Requirements:
*
* - input must fit into 184 bits
*/
function toInt184(int256 value) internal pure returns (int184 downcasted) {
downcasted = int184(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(184, value);
}
}
/**
* @dev Returns the downcasted int176 from int256, reverting on
* overflow (when the input is less than smallest int176 or
* greater than largest int176).
*
* Counterpart to Solidity's `int176` operator.
*
* Requirements:
*
* - input must fit into 176 bits
*/
function toInt176(int256 value) internal pure returns (int176 downcasted) {
downcasted = int176(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(176, value);
}
}
/**
* @dev Returns the downcasted int168 from int256, reverting on
* overflow (when the input is less than smallest int168 or
* greater than largest int168).
*
* Counterpart to Solidity's `int168` operator.
*
* Requirements:
*
* - input must fit into 168 bits
*/
function toInt168(int256 value) internal pure returns (int168 downcasted) {
downcasted = int168(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(168, value);
}
}
/**
* @dev Returns the downcasted int160 from int256, reverting on
* overflow (when the input is less than smallest int160 or
* greater than largest int160).
*
* Counterpart to Solidity's `int160` operator.
*
* Requirements:
*
* - input must fit into 160 bits
*/
function toInt160(int256 value) internal pure returns (int160 downcasted) {
downcasted = int160(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(160, value);
}
}
/**
* @dev Returns the downcasted int152 from int256, reverting on
* overflow (when the input is less than smallest int152 or
* greater than largest int152).
*
* Counterpart to Solidity's `int152` operator.
*
* Requirements:
*
* - input must fit into 152 bits
*/
function toInt152(int256 value) internal pure returns (int152 downcasted) {
downcasted = int152(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(152, value);
}
}
/**
* @dev Returns the downcasted int144 from int256, reverting on
* overflow (when the input is less than smallest int144 or
* greater than largest int144).
*
* Counterpart to Solidity's `int144` operator.
*
* Requirements:
*
* - input must fit into 144 bits
*/
function toInt144(int256 value) internal pure returns (int144 downcasted) {
downcasted = int144(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(144, value);
}
}
/**
* @dev Returns the downcasted int136 from int256, reverting on
* overflow (when the input is less than smallest int136 or
* greater than largest int136).
*
* Counterpart to Solidity's `int136` operator.
*
* Requirements:
*
* - input must fit into 136 bits
*/
function toInt136(int256 value) internal pure returns (int136 downcasted) {
downcasted = int136(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(136, value);
}
}
/**
* @dev Returns the downcasted int128 from int256, reverting on
* overflow (when the input is less than smallest int128 or
* greater than largest int128).
*
* Counterpart to Solidity's `int128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toInt128(int256 value) internal pure returns (int128 downcasted) {
downcasted = int128(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(128, value);
}
}
/**
* @dev Returns the downcasted int120 from int256, reverting on
* overflow (when the input is less than smallest int120 or
* greater than largest int120).
*
* Counterpart to Solidity's `int120` operator.
*
* Requirements:
*
* - input must fit into 120 bits
*/
function toInt120(int256 value) internal pure returns (int120 downcasted) {
downcasted = int120(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(120, value);
}
}
/**
* @dev Returns the downcasted int112 from int256, reverting on
* overflow (when the input is less than smallest int112 or
* greater than largest int112).
*
* Counterpart to Solidity's `int112` operator.
*
* Requirements:
*
* - input must fit into 112 bits
*/
function toInt112(int256 value) internal pure returns (int112 downcasted) {
downcasted = int112(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(112, value);
}
}
/**
* @dev Returns the downcasted int104 from int256, reverting on
* overflow (when the input is less than smallest int104 or
* greater than largest int104).
*
* Counterpart to Solidity's `int104` operator.
*
* Requirements:
*
* - input must fit into 104 bits
*/
function toInt104(int256 value) internal pure returns (int104 downcasted) {
downcasted = int104(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(104, value);
}
}
/**
* @dev Returns the downcasted int96 from int256, reverting on
* overflow (when the input is less than smallest int96 or
* greater than largest int96).
*
* Counterpart to Solidity's `int96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*/
function toInt96(int256 value) internal pure returns (int96 downcasted) {
downcasted = int96(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(96, value);
}
}
/**
* @dev Returns the downcasted int88 from int256, reverting on
* overflow (when the input is less than smallest int88 or
* greater than largest int88).
*
* Counterpart to Solidity's `int88` operator.
*
* Requirements:
*
* - input must fit into 88 bits
*/
function toInt88(int256 value) internal pure returns (int88 downcasted) {
downcasted = int88(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(88, value);
}
}
/**
* @dev Returns the downcasted int80 from int256, reverting on
* overflow (when the input is less than smallest int80 or
* greater than largest int80).
*
* Counterpart to Solidity's `int80` operator.
*
* Requirements:
*
* - input must fit into 80 bits
*/
function toInt80(int256 value) internal pure returns (int80 downcasted) {
downcasted = int80(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(80, value);
}
}
/**
* @dev Returns the downcasted int72 from int256, reverting on
* overflow (when the input is less than smallest int72 or
* greater than largest int72).
*
* Counterpart to Solidity's `int72` operator.
*
* Requirements:
*
* - input must fit into 72 bits
*/
function toInt72(int256 value) internal pure returns (int72 downcasted) {
downcasted = int72(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(72, value);
}
}
/**
* @dev Returns the downcasted int64 from int256, reverting on
* overflow (when the input is less than smallest int64 or
* greater than largest int64).
*
* Counterpart to Solidity's `int64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toInt64(int256 value) internal pure returns (int64 downcasted) {
downcasted = int64(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(64, value);
}
}
/**
* @dev Returns the downcasted int56 from int256, reverting on
* overflow (when the input is less than smallest int56 or
* greater than largest int56).
*
* Counterpart to Solidity's `int56` operator.
*
* Requirements:
*
* - input must fit into 56 bits
*/
function toInt56(int256 value) internal pure returns (int56 downcasted) {
downcasted = int56(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(56, value);
}
}
/**
* @dev Returns the downcasted int48 from int256, reverting on
* overflow (when the input is less than smallest int48 or
* greater than largest int48).
*
* Counterpart to Solidity's `int48` operator.
*
* Requirements:
*
* - input must fit into 48 bits
*/
function toInt48(int256 value) internal pure returns (int48 downcasted) {
downcasted = int48(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(48, value);
}
}
/**
* @dev Returns the downcasted int40 from int256, reverting on
* overflow (when the input is less than smallest int40 or
* greater than largest int40).
*
* Counterpart to Solidity's `int40` operator.
*
* Requirements:
*
* - input must fit into 40 bits
*/
function toInt40(int256 value) internal pure returns (int40 downcasted) {
downcasted = int40(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(40, value);
}
}
/**
* @dev Returns the downcasted int32 from int256, reverting on
* overflow (when the input is less than smallest int32 or
* greater than largest int32).
*
* Counterpart to Solidity's `int32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toInt32(int256 value) internal pure returns (int32 downcasted) {
downcasted = int32(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(32, value);
}
}
/**
* @dev Returns the downcasted int24 from int256, reverting on
* overflow (when the input is less than smallest int24 or
* greater than largest int24).
*
* Counterpart to Solidity's `int24` operator.
*
* Requirements:
*
* - input must fit into 24 bits
*/
function toInt24(int256 value) internal pure returns (int24 downcasted) {
downcasted = int24(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(24, value);
}
}
/**
* @dev Returns the downcasted int16 from int256, reverting on
* overflow (when the input is less than smallest int16 or
* greater than largest int16).
*
* Counterpart to Solidity's `int16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toInt16(int256 value) internal pure returns (int16 downcasted) {
downcasted = int16(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(16, value);
}
}
/**
* @dev Returns the downcasted int8 from int256, reverting on
* overflow (when the input is less than smallest int8 or
* greater than largest int8).
*
* Counterpart to Solidity's `int8` operator.
*
* Requirements:
*
* - input must fit into 8 bits
*/
function toInt8(int256 value) internal pure returns (int8 downcasted) {
downcasted = int8(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(8, value);
}
}
/**
* @dev Converts an unsigned uint256 into a signed int256.
*
* Requirements:
*
* - input must be less than or equal to maxInt256.
*/
function toInt256(uint256 value) internal pure returns (int256) {
// Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
if (value > uint256(type(int256).max)) {
revert SafeCastOverflowedUintToInt(value);
}
return int256(value);
}
/**
* @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.
*/
function toUint(bool b) internal pure returns (uint256 u) {
assembly ("memory-safe") {
u := iszero(iszero(b))
}
}
}
// File: @openzeppelin/contracts/utils/math/Math.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)
pragma solidity ^0.8.28;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
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 success flag (no overflow).
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
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 success flag (no division by zero).
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.
*
* IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.
* However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute
* one branch when needed, making this function more expensive.
*/
function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {
unchecked {
// branchless ternary works because:
// b ^ (a ^ b) == a
// b ^ 0 == b
return b ^ ((a ^ b) * SafeCast.toUint(condition));
}
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return ternary(a > b, a, b);
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return ternary(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.
Panic.panic(Panic.DIVISION_BY_ZERO);
}
// The following calculation ensures accurate ceiling division without overflow.
// Since a is non-zero, (a - 1) / b will not overflow.
// The largest possible result occurs when (a - 1) / b is type(uint256).max,
// but the largest value we can obtain is type(uint256).max - 1, which happens
// when a = type(uint256).max and b = 1.
unchecked {
return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);
}
}
/**
* @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
*
* 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²⁵⁶ and mod 2²⁵⁶ - 1, then use
// the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2²⁵⁶ + 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²⁵⁶. Also prevents denominator == 0.
if (denominator <= prod1) {
Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));
}
///////////////////////////////////////////////
// 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²⁵⁶ / 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²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such
// that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv ≡ 1 mod 2⁴.
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⁸
inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶
inverse *= 2 - denominator * inverse; // inverse mod 2³²
inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴
inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸
inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶
// 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²⁵⁶. Since the preconditions guarantee that the outcome is
// less than 2²⁵⁶, 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;
}
}
/**
* @dev 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) {
return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);
}
/**
* @dev Calculate the modular multiplicative inverse of a number in Z/nZ.
*
* If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.
* If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.
*
* If the input value is not inversible, 0 is returned.
*
* NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the
* inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.
*/
function invMod(uint256 a, uint256 n) internal pure returns (uint256) {
unchecked {
if (n == 0) return 0;
// The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)
// Used to compute integers x and y such that: ax + ny = gcd(a, n).
// When the gcd is 1, then the inverse of a modulo n exists and it's x.
// ax + ny = 1
// ax = 1 + (-y)n
// ax ≡ 1 (mod n) # x is the inverse of a modulo n
// If the remainder is 0 the gcd is n right away.
uint256 remainder = a % n;
uint256 gcd = n;
// Therefore the initial coefficients are:
// ax + ny = gcd(a, n) = n
// 0a + 1n = n
int256 x = 0;
int256 y = 1;
while (remainder != 0) {
uint256 quotient = gcd / remainder;
(gcd, remainder) = (
// The old remainder is the next gcd to try.
remainder,
// Compute the next remainder.
// Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd
// where gcd is at most n (capped to type(uint256).max)
gcd - remainder * quotient
);
(x, y) = (
// Increment the coefficient of a.
y,
// Decrement the coefficient of n.
// Can overflow, but the result is casted to uint256 so that the
// next value of y is "wrapped around" to a value between 0 and n - 1.
x - y * int256(quotient)
);
}
if (gcd != 1) return 0; // No inverse exists.
return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.
}
}
/**
* @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.
*
* From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is
* prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that
* `a**(p-2)` is the modular multiplicative inverse of a in Fp.
*
* NOTE: this function does NOT check that `p` is a prime greater than `2`.
*/
function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {
unchecked {
return Math.modExp(a, p - 2, p);
}
}
/**
* @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)
*
* Requirements:
* - modulus can't be zero
* - underlying staticcall to precompile must succeed
*
* IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make
* sure the chain you're using it on supports the precompiled contract for modular exponentiation
* at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,
* the underlying function will succeed given the lack of a revert, but the result may be incorrectly
* interpreted as 0.
*/
function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {
(bool success, uint256 result) = tryModExp(b, e, m);
if (!success) {
Panic.panic(Panic.DIVISION_BY_ZERO);
}
return result;
}
/**
* @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).
* It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying
* to operate modulo 0 or if the underlying precompile reverted.
*
* IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain
* you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in
* https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack
* of a revert, but the result may be incorrectly interpreted as 0.
*/
function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {
if (m == 0) return (false, 0);
assembly ("memory-safe") {
let ptr := mload(0x40)
// | Offset | Content | Content (Hex) |
// |-----------|------------|--------------------------------------------------------------------|
// | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |
// | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |
// | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |
// | 0x60:0x7f | value of b | 0x<.............................................................b> |
// | 0x80:0x9f | value of e | 0x<.............................................................e> |
// | 0xa0:0xbf | value of m | 0x<.............................................................m> |
mstore(ptr, 0x20)
mstore(add(ptr, 0x20), 0x20)
mstore(add(ptr, 0x40), 0x20)
mstore(add(ptr, 0x60), b)
mstore(add(ptr, 0x80), e)
mstore(add(ptr, 0xa0), m)
// Given the result < m, it's guaranteed to fit in 32 bytes,
// so we can use the memory scratch space located at offset 0.
success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)
result := mload(0x00)
}
}
/**
* @dev Variant of {modExp} that supports inputs of arbitrary length.
*/
function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {
(bool success, bytes memory result) = tryModExp(b, e, m);
if (!success) {
Panic.panic(Panic.DIVISION_BY_ZERO);
}
return result;
}
/**
* @dev Variant of {tryModExp} that supports inputs of arbitrary length.
*/
function tryModExp(
bytes memory b,
bytes memory e,
bytes memory m
) internal view returns (bool success, bytes memory result) {
if (_zeroBytes(m)) return (false, new bytes(0));
uint256 mLen = m.length;
// Encode call args in result and move the free memory pointer
result = abi.encodePacked(b.length, e.length, mLen, b, e, m);
assembly ("memory-safe") {
let dataPtr := add(result, 0x20)
// Write result on top of args to avoid allocating extra memory.
success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)
// Overwrite the length.
// result.length > returndatasize() is guaranteed because returndatasize() == m.length
mstore(result, mLen)
// Set the memory pointer after the returned data.
mstore(0x40, add(dataPtr, mLen))
}
}
/**
* @dev Returns whether the provided byte array is zero.
*/
function _zeroBytes(bytes memory byteArray) private pure returns (bool) {
for (uint256 i = 0; i < byteArray.length; ++i) {
if (byteArray[i] != 0) {
return false;
}
}
return true;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* This method is based on Newton's method for computing square roots; the algorithm is restricted to only
* using integer operations.
*/
function sqrt(uint256 a) internal pure returns (uint256) {
unchecked {
// Take care of easy edge cases when a == 0 or a == 1
if (a <= 1) {
return a;
}
// In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a
// sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between
// the current value as `ε_n = | x_n - sqrt(a) |`.
//
// For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root
// of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is
// bigger than any uint256.
//
// By noticing that
// `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`
// we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar
// to the msb function.
uint256 aa = a;
uint256 xn = 1;
if (aa >= (1 << 128)) {
aa >>= 128;
xn <<= 64;
}
if (aa >= (1 << 64)) {
aa >>= 64;
xn <<= 32;
}
if (aa >= (1 << 32)) {
aa >>= 32;
xn <<= 16;
}
if (aa >= (1 << 16)) {
aa >>= 16;
xn <<= 8;
}
if (aa >= (1 << 8)) {
aa >>= 8;
xn <<= 4;
}
if (aa >= (1 << 4)) {
aa >>= 4;
xn <<= 2;
}
if (aa >= (1 << 2)) {
xn <<= 1;
}
// We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).
//
// We can refine our estimation by noticing that the middle of that interval minimizes the error.
// If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).
// This is going to be our x_0 (and ε_0)
xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)
// From here, Newton's method give us:
// x_{n+1} = (x_n + a / x_n) / 2
//
// One should note that:
// x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a
// = ((x_n² + a) / (2 * x_n))² - a
// = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a
// = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)
// = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)
// = (x_n² - a)² / (2 * x_n)²
// = ((x_n² - a) / (2 * x_n))²
// ≥ 0
// Which proves that for all n ≥ 1, sqrt(a) ≤ x_n
//
// This gives us the proof of quadratic convergence of the sequence:
// ε_{n+1} = | x_{n+1} - sqrt(a) |
// = | (x_n + a / x_n) / 2 - sqrt(a) |
// = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |
// = | (x_n - sqrt(a))² / (2 * x_n) |
// = | ε_n² / (2 * x_n) |
// = ε_n² / | (2 * x_n) |
//
// For the first iteration, we have a special case where x_0 is known:
// ε_1 = ε_0² / | (2 * x_0) |
// ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))
// ≤ 2**(2*e-4) / (3 * 2**(e-1))
// ≤ 2**(e-3) / 3
// ≤ 2**(e-3-log2(3))
// ≤ 2**(e-4.5)
//
// For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:
// ε_{n+1} = ε_n² / | (2 * x_n) |
// ≤ (2**(e-k))² / (2 * 2**(e-1))
// ≤ 2**(2*e-2*k) / 2**e
// ≤ 2**(e-2*k)
xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above
xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5
xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9
xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18
xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36
xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72
// Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision
// ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either
// sqrt(a) or sqrt(a) + 1.
return xn - SafeCast.toUint(xn > a / xn);
}
}
/**
* @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);
}
}
/**
* @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;
uint256 exp;
unchecked {
exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);
value >>= exp;
result += exp;
exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);
value >>= exp;
result += exp;
exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);
value >>= exp;
result += exp;
exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);
value >>= exp;
result += exp;
exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);
value >>= exp;
result += exp;
exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);
value >>= exp;
result += exp;
exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);
value >>= exp;
result += exp;
result += SafeCast.toUint(value > 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);
}
}
/**
* @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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);
}
}
/**
* @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;
uint256 isGt;
unchecked {
isGt = SafeCast.toUint(value > (1 << 128) - 1);
value >>= isGt * 128;
result += isGt * 16;
isGt = SafeCast.toUint(value > (1 << 64) - 1);
value >>= isGt * 64;
result += isGt * 8;
isGt = SafeCast.toUint(value > (1 << 32) - 1);
value >>= isGt * 32;
result += isGt * 4;
isGt = SafeCast.toUint(value > (1 << 16) - 1);
value >>= isGt * 16;
result += isGt * 2;
result += SafeCast.toUint(value > (1 << 8) - 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);
}
}
/**
* @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;
}
}
// File: @openzeppelin/contracts/utils/math/SignedMath.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.28;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.
*
* IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.
* However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute
* one branch when needed, making this function more expensive.
*/
function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {
unchecked {
// branchless ternary works because:
// b ^ (a ^ b) == a
// b ^ 0 == b
return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));
}
}
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return ternary(a > b, a, b);
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return ternary(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 {
// Formula from the "Bit Twiddling Hacks" by Sean Eron Anderson.
// Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,
// taking advantage of the most significant (or "sign" bit) in two's complement representation.
// This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,
// the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).
int256 mask = n >> 255;
// A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.
return uint256((n + mask) ^ mask);
}
}
}
// File: @openzeppelin/contracts/utils/Strings.sol
// OpenZeppelin Contracts (last updated v5.2.0) (utils/Strings.sol)
pragma solidity ^0.8.28;
/**
* @dev String operations.
*/
library Strings {
using SafeCast for *;
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 The string being parsed contains characters that are not in scope of the given base.
*/
error StringsInvalidChar();
/**
* @dev The string being parsed is not a properly formatted address.
*/
error StringsInvalidAddressFormat();
/**
* @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;
assembly ("memory-safe") {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
assembly ("memory-safe") {
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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal
* representation, according to EIP-55.
*/
function toChecksumHexString(address addr) internal pure returns (string memory) {
bytes memory buffer = bytes(toHexString(addr));
// hash the hex part of buffer (skip length + 2 bytes, length 40)
uint256 hashValue;
assembly ("memory-safe") {
hashValue := shr(96, keccak256(add(buffer, 0x22), 40))
}
for (uint256 i = 41; i > 1; --i) {
// possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)
if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {
// case shift by xoring with 0x20
buffer[i] ^= 0x20;
}
hashValue >>= 4;
}
return string(buffer);
}
/**
* @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));
}
/**
* @dev Parse a decimal string and returns the value as a `uint256`.
*
* Requirements:
* - The string must be formatted as `[0-9]*`
* - The result must fit into an `uint256` type
*/
function parseUint(string memory input) internal pure returns (uint256) {
return parseUint(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseUint} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `[0-9]*`
* - The result must fit into an `uint256` type
*/
function parseUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {
(bool success, uint256 value) = tryParseUint(input, begin, end);
if (!success) revert StringsInvalidChar();
return value;
}
/**
* @dev Variant of {parseUint-string} that returns false if the parsing fails because of an invalid character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseUint(string memory input) internal pure returns (bool success, uint256 value) {
return _tryParseUintUncheckedBounds(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseUint-string-uint256-uint256} that returns false if the parsing fails because of an invalid
* character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseUint(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, uint256 value) {
if (end > bytes(input).length || begin > end) return (false, 0);
return _tryParseUintUncheckedBounds(input, begin, end);
}
/**
* @dev Implementation of {tryParseUint} that does not check bounds. Caller should make sure that
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
*/
function _tryParseUintUncheckedBounds(
string memory input,
uint256 begin,
uint256 end
) private pure returns (bool success, uint256 value) {
bytes memory buffer = bytes(input);
uint256 result = 0;
for (uint256 i = begin; i < end; ++i) {
uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));
if (chr > 9) return (false, 0);
result *= 10;
result += chr;
}
return (true, result);
}
/**
* @dev Parse a decimal string and returns the value as a `int256`.
*
* Requirements:
* - The string must be formatted as `[-+]?[0-9]*`
* - The result must fit in an `int256` type.
*/
function parseInt(string memory input) internal pure returns (int256) {
return parseInt(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseInt-string} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `[-+]?[0-9]*`
* - The result must fit in an `int256` type.
*/
function parseInt(string memory input, uint256 begin, uint256 end) internal pure returns (int256) {
(bool success, int256 value) = tryParseInt(input, begin, end);
if (!success) revert StringsInvalidChar();
return value;
}
/**
* @dev Variant of {parseInt-string} that returns false if the parsing fails because of an invalid character or if
* the result does not fit in a `int256`.
*
* NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.
*/
function tryParseInt(string memory input) internal pure returns (bool success, int256 value) {
return _tryParseIntUncheckedBounds(input, 0, bytes(input).length);
}
uint256 private constant ABS_MIN_INT256 = 2 ** 255;
/**
* @dev Variant of {parseInt-string-uint256-uint256} that returns false if the parsing fails because of an invalid
* character or if the result does not fit in a `int256`.
*
* NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.
*/
function tryParseInt(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, int256 value) {
if (end > bytes(input).length || begin > end) return (false, 0);
return _tryParseIntUncheckedBounds(input, begin, end);
}
/**
* @dev Implementation of {tryParseInt} that does not check bounds. Caller should make sure that
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
*/
function _tryParseIntUncheckedBounds(
string memory input,
uint256 begin,
uint256 end
) private pure returns (bool success, int256 value) {
bytes memory buffer = bytes(input);
// Check presence of a negative sign.
bytes1 sign = begin == end ? bytes1(0) : bytes1(_unsafeReadBytesOffset(buffer, begin)); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
bool positiveSign = sign == bytes1("+");
bool negativeSign = sign == bytes1("-");
uint256 offset = (positiveSign || negativeSign).toUint();
(bool absSuccess, uint256 absValue) = tryParseUint(input, begin + offset, end);
if (absSuccess && absValue < ABS_MIN_INT256) {
return (true, negativeSign ? -int256(absValue) : int256(absValue));
} else if (absSuccess && negativeSign && absValue == ABS_MIN_INT256) {
return (true, type(int256).min);
} else return (false, 0);
}
/**
* @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as a `uint256`.
*
* Requirements:
* - The string must be formatted as `(0x)?[0-9a-fA-F]*`
* - The result must fit in an `uint256` type.
*/
function parseHexUint(string memory input) internal pure returns (uint256) {
return parseHexUint(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseHexUint} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `(0x)?[0-9a-fA-F]*`
* - The result must fit in an `uint256` type.
*/
function parseHexUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {
(bool success, uint256 value) = tryParseHexUint(input, begin, end);
if (!success) revert StringsInvalidChar();
return value;
}
/**
* @dev Variant of {parseHexUint-string} that returns false if the parsing fails because of an invalid character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseHexUint(string memory input) internal pure returns (bool success, uint256 value) {
return _tryParseHexUintUncheckedBounds(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseHexUint-string-uint256-uint256} that returns false if the parsing fails because of an
* invalid character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseHexUint(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, uint256 value) {
if (end > bytes(input).length || begin > end) return (false, 0);
return _tryParseHexUintUncheckedBounds(input, begin, end);
}
/**
* @dev Implementation of {tryParseHexUint} that does not check bounds. Caller should make sure that
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
*/
function _tryParseHexUintUncheckedBounds(
string memory input,
uint256 begin,
uint256 end
) private pure returns (bool success, uint256 value) {
bytes memory buffer = bytes(input);
// skip 0x prefix if present
bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(buffer, begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
uint256 offset = hasPrefix.toUint() * 2;
uint256 result = 0;
for (uint256 i = begin + offset; i < end; ++i) {
uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));
if (chr > 15) return (false, 0);
result *= 16;
unchecked {
// Multiplying by 16 is equivalent to a shift of 4 bits (with additional overflow check).
// This guaratees that adding a value < 16 will not cause an overflow, hence the unchecked.
result += chr;
}
}
return (true, result);
}
/**
* @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as an `address`.
*
* Requirements:
* - The string must be formatted as `(0x)?[0-9a-fA-F]{40}`
*/
function parseAddress(string memory input) internal pure returns (address) {
return parseAddress(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseAddress} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `(0x)?[0-9a-fA-F]{40}`
*/
function parseAddress(string memory input, uint256 begin, uint256 end) internal pure returns (address) {
(bool success, address value) = tryParseAddress(input, begin, end);
if (!success) revert StringsInvalidAddressFormat();
return value;
}
/**
* @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly
* formatted address. See {parseAddress} requirements.
*/
function tryParseAddress(string memory input) internal pure returns (bool success, address value) {
return tryParseAddress(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly
* formatted address. See {parseAddress} requirements.
*/
function tryParseAddress(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, address value) {
if (end > bytes(input).length || begin > end) return (false, address(0));
bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(bytes(input), begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
uint256 expectedLength = 40 + hasPrefix.toUint() * 2;
// check that input is the correct length
if (end - begin == expectedLength) {
// length guarantees that this does not overflow, and value is at most type(uint160).max
(bool s, uint256 v) = _tryParseHexUintUncheckedBounds(input, begin, end);
return (s, address(uint160(v)));
} else {
return (false, address(0));
}
}
function _tryParseChr(bytes1 chr) private pure returns (uint8) {
uint8 value = uint8(chr);
// Try to parse `chr`:
// - Case 1: [0-9]
// - Case 2: [a-f]
// - Case 3: [A-F]
// - otherwise not supported
unchecked {
if (value > 47 && value < 58) value -= 48;
else if (value > 96 && value < 103) value -= 87;
else if (value > 64 && value < 71) value -= 55;
else return type(uint8).max;
}
return value;
}
/**
* @dev Reads a bytes32 from a bytes array without bounds checking.
*
* NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the
* assembly block as such would prevent some optimizations.
*/
function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {
// This is not memory safe in the general case, but all calls to this private function are within bounds.
assembly ("memory-safe") {
value := mload(add(buffer, add(0x20, offset)))
}
}
}
// File: @openzeppelin/contracts/utils/introspection/ERC165.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.28;
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC-165 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;
}
}
// File: @openzeppelin/contracts/token/ERC721/ERC721.sol
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.28;
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] 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);
ERC721Utils.checkOnERC721Received(_msgSender(), 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 ERC-721 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 `owner` for `tokenId`.
* - `spender` does not have approval to manage all of `owner`'s assets.
*
* 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);
ERC721Utils.checkOnERC721Received(_msgSender(), 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 ERC-721 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);
ERC721Utils.checkOnERC721Received(_msgSender(), 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;
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.28;
/**
* @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);
}
}
// File: @openzeppelin/contracts/utils/Counters.sol
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library Counters {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}
// File: @openzeppelin/contracts/security/ReentrancyGuard.sol
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @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;
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
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}
// File: Chibi.sol
pragma solidity ^0.8.28;
contract AtamaChibi is ERC721, Ownable, ReentrancyGuard {
using Counters for Counters.Counter;
using Strings for uint256;
// Token ID counter for sequential minting.
Counters.Counter private _tokenIdCounter;
// Tiered mint prices.
uint256 public whitelistMintPrice;
uint256 public publicMintPrice;
// Maximum supply.
uint256 public maxSupply;
// Maximum mints allowed per wallet for public minting.
uint256 public maxMintPerWallet;
// Tracks how many tokens each address has minted (public mint only).
mapping(address => uint256) public mintedCount;
// Mint pause control.
bool public mintPaused;
// Whitelist functionality.
bool public whitelistEnabled;
mapping(address => bool) public whitelist;
// Base URI for token metadata; tokenURI = baseTokenURI + tokenId.
string private baseTokenURI;
// Marketplace listing control.
// When false, token holders cannot grant approvals.
bool public marketplaceListingEnabled;
// ========== Events ==========
event NFTMinted(address indexed to, uint256 indexed tokenId);
event WhitelistMintPriceUpdated(uint256 newPrice);
event PublicMintPriceUpdated(uint256 newPrice);
event BaseURIUpdated(string newBaseURI);
event MintPaused();
event MintUnpaused();
event WhitelistStatusChanged(bool whitelistEnabled);
event AddressWhitelisted(address indexed addr);
event AddressRemovedFromWhitelist(address indexed addr);
event MaxSupplyUpdated(uint256 newMaxSupply);
event MarketplaceListingStatusChanged(bool enabled);
event MaxMintPerWalletUpdated(uint256 newMaxMintPerWallet);
constructor(
string memory _initBaseURI,
uint256 _initWhitelistMintPrice,
uint256 _initPublicMintPrice,
uint256 _maxSupply,
uint256 _maxMintPerWallet
) ERC721("Atama Chibi", "CHIBI") Ownable(msg.sender) {
baseTokenURI = _initBaseURI;
whitelistMintPrice = _initWhitelistMintPrice;
publicMintPrice = _initPublicMintPrice;
maxSupply = _maxSupply;
maxMintPerWallet = _maxMintPerWallet;
// By default, minting is paused, whitelist enforcement is enabled (for tiered pricing),
// and marketplace listing is disabled.
mintPaused = true;
whitelistEnabled = true;
marketplaceListingEnabled = false;
}
// ========== Whitelist Functions ==========
function addToWhitelist(address _addr) external onlyOwner {
whitelist[_addr] = true;
emit AddressWhitelisted(_addr);
}
function removeFromWhitelist(address _addr) external onlyOwner {
whitelist[_addr] = false;
emit AddressRemovedFromWhitelist(_addr);
}
function setWhitelistEnabled(bool _enabled) external onlyOwner {
whitelistEnabled = _enabled;
emit WhitelistStatusChanged(_enabled);
}
// ========== Pause/Unpause Mint Functions ==========
function pauseMint() external onlyOwner {
mintPaused = true;
emit MintPaused();
}
function unpauseMint() external onlyOwner {
mintPaused = false;
emit MintUnpaused();
}
// ========== Administrative Functions ==========
function setWhitelistMintPrice(uint256 newPrice) external onlyOwner {
whitelistMintPrice = newPrice;
emit WhitelistMintPriceUpdated(newPrice);
}
function setPublicMintPrice(uint256 newPrice) external onlyOwner {
publicMintPrice = newPrice;
emit PublicMintPriceUpdated(newPrice);
}
function setBaseURI(string memory newBaseURI) external onlyOwner {
baseTokenURI = newBaseURI;
emit BaseURIUpdated(newBaseURI);
}
function setMaxSupply(uint256 newMaxSupply) external onlyOwner {
require(newMaxSupply >= _tokenIdCounter.current(), "New max supply is less than minted count");
maxSupply = newMaxSupply;
emit MaxSupplyUpdated(newMaxSupply);
}
function setMaxMintPerWallet(uint256 _maxMintPerWallet) external onlyOwner {
maxMintPerWallet = _maxMintPerWallet;
emit MaxMintPerWalletUpdated(_maxMintPerWallet);
}
function setMarketplaceListingEnabled(bool enabled) external onlyOwner {
marketplaceListingEnabled = enabled;
emit MarketplaceListingStatusChanged(enabled);
}
// Note: transferOwnership is inherited from Ownable.
// ========== Public Mint Function ==========
/**
* @notice Mints a new NFT to the caller.
* Requirements:
* - Minting must not be paused.
* - If whitelist is enabled, caller must be whitelisted.
* - Caller must not have minted maxMintPerWallet tokens (for public minting).
* - Caller must send at least the appropriate mint price in ETH.
* - Total minted tokens must be less than maxSupply.
*/
function mint() external payable nonReentrant {
require(!mintPaused, "Minting is paused");
uint256 price = publicMintPrice;
if (whitelistEnabled && whitelist[msg.sender]) {
price = whitelistMintPrice;
}
require(msg.value >= price, "Insufficient payment");
require(_tokenIdCounter.current() < maxSupply, "Max supply reached");
require(mintedCount[msg.sender] < maxMintPerWallet, "Max mint per wallet reached");
_tokenIdCounter.increment();
uint256 tokenId = _tokenIdCounter.current();
_safeMint(msg.sender, tokenId);
mintedCount[msg.sender] += 1;
emit NFTMinted(msg.sender, tokenId);
}
// ========== Batch Mint Functions ==========
/**
* @notice Batch mints one NFT to each address in the recipients array (owner-only).
* Note: This function is not subject to the per-wallet mint limit.
* @param recipients An array of addresses to receive one NFT each.
*/
function batchMint(address[] calldata recipients) external onlyOwner nonReentrant {
uint256 numRecipients = recipients.length;
require(_tokenIdCounter.current() + numRecipients <= maxSupply, "Max supply exceeded");
for (uint256 i = 0; i < numRecipients; i++) {
_tokenIdCounter.increment();
uint256 tokenId = _tokenIdCounter.current();
_safeMint(recipients[i], tokenId);
emit NFTMinted(recipients[i], tokenId);
}
}
/**
* @notice Batch mints a specified quantity of NFTs to each address in the recipients array (owner-only).
* @param recipients An array of addresses.
* @param quantity The number of NFTs to mint per address.
*/
function batchMintMultiple(address[] calldata recipients, uint256 quantity) external onlyOwner nonReentrant {
uint256 numRecipients = recipients.length;
require(_tokenIdCounter.current() + (numRecipients * quantity) <= maxSupply, "Max supply exceeded");
for (uint256 i = 0; i < numRecipients; i++) {
for (uint256 j = 0; j < quantity; j++) {
_tokenIdCounter.increment();
uint256 tokenId = _tokenIdCounter.current();
_safeMint(recipients[i], tokenId);
emit NFTMinted(recipients[i], tokenId);
}
}
}
// ========== Withdraw Function ==========
function withdraw() external onlyOwner nonReentrant {
uint256 balance = address(this).balance;
require(balance > 0, "No balance to withdraw");
(bool success, ) = payable(owner()).call{value: balance}("");
require(success, "Withdrawal failed");
}
// ========== View Functions ==========
function totalSupply() external view returns (uint256) {
return _tokenIdCounter.current();
}
// ========== Overridden Functions ==========
function _baseURI() internal view override returns (string memory) {
return baseTokenURI;
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
require(tokenId > 0 && tokenId <= _tokenIdCounter.current(), "ERC721Metadata: URI query for nonexistent token");
return string(abi.encodePacked(baseTokenURI, tokenId.toString()));
}
// Override approve to restrict approvals when marketplace listing is disabled.
function approve(address to, uint256 tokenId) public override {
if (to != address(0)) {
require(marketplaceListingEnabled, "Marketplace listing is disabled");
}
super.approve(to, tokenId);
}
// Override setApprovalForAll similarly.
function setApprovalForAll(address operator, bool approved) public override {
if (approved) {
require(marketplaceListingEnabled, "Marketplace listing is disabled");
}
super.setApprovalForAll(operator, approved);
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"string","name":"_initBaseURI","type":"string"},{"internalType":"uint256","name":"_initWhitelistMintPrice","type":"uint256"},{"internalType":"uint256","name":"_initPublicMintPrice","type":"uint256"},{"internalType":"uint256","name":"_maxSupply","type":"uint256"},{"internalType":"uint256","name":"_maxMintPerWallet","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"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"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"}],"name":"AddressRemovedFromWhitelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"}],"name":"AddressWhitelisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"newBaseURI","type":"string"}],"name":"BaseURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"MarketplaceListingStatusChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMaxMintPerWallet","type":"uint256"}],"name":"MaxMintPerWalletUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMaxSupply","type":"uint256"}],"name":"MaxSupplyUpdated","type":"event"},{"anonymous":false,"inputs":[],"name":"MintPaused","type":"event"},{"anonymous":false,"inputs":[],"name":"MintUnpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"NFTMinted","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":"uint256","name":"newPrice","type":"uint256"}],"name":"PublicMintPriceUpdated","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":"uint256","name":"newPrice","type":"uint256"}],"name":"WhitelistMintPriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"whitelistEnabled","type":"bool"}],"name":"WhitelistStatusChanged","type":"event"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"addToWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"}],"name":"batchMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"batchMintMultiple","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":"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":"marketplaceListingEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintPerWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"mintedCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pauseMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"publicMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"removeFromWhitelist","outputs":[],"stateMutability":"nonpayable","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":"newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setMarketplaceListingEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxMintPerWallet","type":"uint256"}],"name":"setMaxMintPerWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxSupply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setPublicMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_enabled","type":"bool"}],"name":"setWhitelistEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setWhitelistMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpauseMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405234801561000f575f5ffd5b5060405161257038038061257083398101604081905261002e9161016e565b336040518060400160405280600b81526020016a4174616d6120436869626960a81b81525060405180604001604052806005815260200164434849424960d81b815250815f908161007f91906102c2565b50600161008c82826102c2565b5050506001600160a01b0381166100bc57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6100c581610109565b50600160075560106100d786826102c2565b50600993909355600a91909155600b55600c5550600e805461ffff19166101011790556011805460ff1916905561037c565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b634e487b7160e01b5f52604160045260245ffd5b5f5f5f5f5f60a08688031215610182575f5ffd5b85516001600160401b03811115610197575f5ffd5b8601601f810188136101a7575f5ffd5b80516001600160401b038111156101c0576101c061015a565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101ee576101ee61015a565b6040528181528282016020018a1015610205575f5ffd5b8160208401602083015e5f602092820183015290880151604089015160608a01516080909a0151929b919a509897509095509350505050565b600181811c9082168061025257607f821691505b60208210810361027057634e487b7160e01b5f52602260045260245ffd5b50919050565b601f8211156102bd57805f5260205f20601f840160051c8101602085101561029b5750805b601f840160051c820191505b818110156102ba575f81556001016102a7565b50505b505050565b81516001600160401b038111156102db576102db61015a565b6102ef816102e9845461023e565b84610276565b6020601f821160018114610321575f831561030a5750848201515b5f19600385901b1c1916600184901b1784556102ba565b5f84815260208120601f198516915b828110156103505787850151825560209485019460019092019101610330565b508482101561036d57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b6121e7806103895f395ff3fe60806040526004361061023e575f3560e01c806375fb6a2311610134578063b5cfe31b116100b3578063d67b06c111610078578063d67b06c114610647578063dc53fd9214610666578063e43252d71461067b578063e985e9c51461069a578063f2fde38b146106b9578063fddcb5ea146106d8575f5ffd5b8063b5cfe31b146105c1578063b88d4fde146105e0578063c87b56dd146105ff578063cd85cdb51461061e578063d5abeb0114610632575f5ffd5b80639b19251a116100f95780639b19251a14610521578063a22cb4651461054f578063a611708e1461056e578063afdf61341461058d578063b228d925146105ac575f5ffd5b806375fb6a231461049f5780637e4831d3146104b85780638ab1d681146104d15780638da5cb5b146104f057806395d89b411461050d575f5ffd5b806339b7ec29116101c05780635d82cf6e116101855780635d82cf6e1461040f5780636352211e1461042e5780636f8b44b01461044d57806370a082311461046c578063715018a61461048b575f5ffd5b806339b7ec29146103805780633ccfd60b1461039f57806342842e0e146103b357806351fb012d146103d257806355f804b3146103f0575f5ffd5b80631249c58b116102065780631249c58b1461030e57806318160ddd146103165780631a8bd2da1461033857806323b872dd1461034c57806335c6aaf81461036b575f5ffd5b806301ffc9a714610242578063052d9e7e1461027657806306fdde0314610297578063081812fc146102b8578063095ea7b3146102ef575b5f5ffd5b34801561024d575f5ffd5b5061026161025c366004611bab565b610703565b60405190151581526020015b60405180910390f35b348015610281575f5ffd5b50610295610290366004611be1565b610754565b005b3480156102a2575f5ffd5b506102ab6107b0565b60405161026d9190611c28565b3480156102c3575f5ffd5b506102d76102d2366004611c3a565b61083f565b6040516001600160a01b03909116815260200161026d565b3480156102fa575f5ffd5b50610295610309366004611c67565b610866565b6102956108da565b348015610321575f5ffd5b5061032a610acb565b60405190815260200161026d565b348015610343575f5ffd5b50610295610ada565b348015610357575f5ffd5b50610295610366366004611c8f565b610b16565b348015610376575f5ffd5b5061032a60095481565b34801561038b575f5ffd5b5061029561039a366004611d11565b610b9f565b3480156103aa575f5ffd5b50610295610ced565b3480156103be575f5ffd5b506102956103cd366004611c8f565b610df4565b3480156103dd575f5ffd5b50600e5461026190610100900460ff1681565b3480156103fb575f5ffd5b5061029561040a366004611de4565b610e0e565b34801561041a575f5ffd5b50610295610429366004611c3a565b610e52565b348015610439575f5ffd5b506102d7610448366004611c3a565b610e8f565b348015610458575f5ffd5b50610295610467366004611c3a565b610e99565b348015610477575f5ffd5b5061032a610486366004611e29565b610f39565b348015610496575f5ffd5b50610295610f7e565b3480156104aa575f5ffd5b506011546102619060ff1681565b3480156104c3575f5ffd5b50600e546102619060ff1681565b3480156104dc575f5ffd5b506102956104eb366004611e29565b610f8f565b3480156104fb575f5ffd5b506006546001600160a01b03166102d7565b348015610518575f5ffd5b506102ab610fdf565b34801561052c575f5ffd5b5061026161053b366004611e29565b600f6020525f908152604090205460ff1681565b34801561055a575f5ffd5b50610295610569366004611e42565b610fee565b348015610579575f5ffd5b50610295610588366004611c3a565b611050565b348015610598575f5ffd5b506102956105a7366004611c3a565b61108d565b3480156105b7575f5ffd5b5061032a600c5481565b3480156105cc575f5ffd5b506102956105db366004611be1565b6110ca565b3480156105eb575f5ffd5b506102956105fa366004611e73565b611113565b34801561060a575f5ffd5b506102ab610619366004611c3a565b61112b565b348015610629575f5ffd5b506102956111d4565b34801561063d575f5ffd5b5061032a600b5481565b348015610652575f5ffd5b50610295610661366004611eea565b611213565b348015610671575f5ffd5b5061032a600a5481565b348015610686575f5ffd5b50610295610695366004611e29565b61132b565b3480156106a5575f5ffd5b506102616106b4366004611f29565b61137e565b3480156106c4575f5ffd5b506102956106d3366004611e29565b6113ab565b3480156106e3575f5ffd5b5061032a6106f2366004611e29565b600d6020525f908152604090205481565b5f6001600160e01b031982166380ac58cd60e01b148061073357506001600160e01b03198216635b5e139f60e01b145b8061074e57506301ffc9a760e01b6001600160e01b03198316145b92915050565b61075c6113e8565b600e80548215156101000261ff00199091161790556040517f1cf28b997975c7be355bcef74f2f5019aa48253bc1e54b3c8b002471865fdba8906107a590831515815260200190565b60405180910390a150565b60605f80546107be90611f51565b80601f01602080910402602001604051908101604052809291908181526020018280546107ea90611f51565b80156108355780601f1061080c57610100808354040283529160200191610835565b820191905f5260205f20905b81548152906001019060200180831161081857829003601f168201915b5050505050905090565b5f61084982611415565b505f828152600460205260409020546001600160a01b031661074e565b6001600160a01b038216156108cc5760115460ff166108cc5760405162461bcd60e51b815260206004820152601f60248201527f4d61726b6574706c616365206c697374696e672069732064697361626c65640060448201526064015b60405180910390fd5b6108d6828261144d565b5050565b6108e2611458565b600e5460ff16156109295760405162461bcd60e51b8152602060048201526011602482015270135a5b9d1a5b99c81a5cc81c185d5cd959607a1b60448201526064016108c3565b600a54600e54610100900460ff1680156109515750335f908152600f602052604090205460ff165b1561095b57506009545b803410156109a25760405162461bcd60e51b8152602060048201526014602482015273125b9cdd59999a58da595b9d081c185e5b595b9d60621b60448201526064016108c3565b600b54600854106109ea5760405162461bcd60e51b815260206004820152601260248201527113585e081cdd5c1c1b1e481c995858da195960721b60448201526064016108c3565b600c54335f908152600d602052604090205410610a495760405162461bcd60e51b815260206004820152601b60248201527f4d6178206d696e74207065722077616c6c65742072656163686564000000000060448201526064016108c3565b610a57600880546001019055565b5f610a6160085490565b9050610a6d33826114b1565b335f908152600d60205260408120805460019290610a8c908490611f9d565b9091555050604051819033907f4cc0a9c4a99ddc700de1af2c9f916a7cbfdb71f14801ccff94061ad1ef8a8040905f90a35050610ac96001600755565b565b5f610ad560085490565b905090565b610ae26113e8565b600e805460ff191690556040517fd76d4045ba8d223490b9c6a5657cfdaa2316ac28a5a65274870bfe66a33ea0c4905f90a1565b6001600160a01b038216610b3f57604051633250574960e11b81525f60048201526024016108c3565b5f610b4b8383336114ca565b9050836001600160a01b0316816001600160a01b031614610b99576040516364283d7b60e01b81526001600160a01b03808616600483015260248201849052821660448201526064016108c3565b50505050565b610ba76113e8565b610baf611458565b600b548290610bbe8383611fb0565b600854610bcb9190611f9d565b1115610c0f5760405162461bcd60e51b815260206004820152601360248201527213585e081cdd5c1c1b1e48195e18d959591959606a1b60448201526064016108c3565b5f5b81811015610cdc575f5b83811015610cd357610c31600880546001019055565b5f610c3b60085490565b9050610c6d878785818110610c5257610c52611fc7565b9050602002016020810190610c679190611e29565b826114b1565b80878785818110610c8057610c80611fc7565b9050602002016020810190610c959190611e29565b6001600160a01b03167f4cc0a9c4a99ddc700de1af2c9f916a7cbfdb71f14801ccff94061ad1ef8a804060405160405180910390a350600101610c1b565b50600101610c11565b5050610ce86001600755565b505050565b610cf56113e8565b610cfd611458565b4780610d445760405162461bcd60e51b81526020600482015260166024820152754e6f2062616c616e636520746f20776974686472617760501b60448201526064016108c3565b5f610d576006546001600160a01b031690565b6001600160a01b0316826040515f6040518083038185875af1925050503d805f8114610d9e576040519150601f19603f3d011682016040523d82523d5f602084013e610da3565b606091505b5050905080610de85760405162461bcd60e51b815260206004820152601160248201527015da5d1a191c985dd85b0819985a5b1959607a1b60448201526064016108c3565b5050610ac96001600755565b610ce883838360405180602001604052805f815250611113565b610e166113e8565b6010610e22828261201f565b507f6741b2fc379fad678116fe3d4d4b9a1a184ab53ba36b86ad0fa66340b1ab41ad816040516107a59190611c28565b610e5a6113e8565b600a8190556040518181527f6267c2c470a7940d276500728ecd2ad64aed9043ea1a307826e7613adff1f20f906020016107a5565b5f61074e82611415565b610ea16113e8565b600854811015610f045760405162461bcd60e51b815260206004820152602860248201527f4e6577206d617820737570706c79206973206c657373207468616e206d696e7460448201526719590818dbdd5b9d60c21b60648201526084016108c3565b600b8190556040518181527f7810bd47de260c3e9ee10061cf438099dd12256c79485f12f94dbccc981e806c906020016107a5565b5f6001600160a01b038216610f63576040516322718ad960e21b81525f60048201526024016108c3565b506001600160a01b03165f9081526003602052604090205490565b610f866113e8565b610ac95f6115bc565b610f976113e8565b6001600160a01b0381165f818152600f6020526040808220805460ff19169055517f535611fb62fa2a833988f283b779e417e996813e44046f521d76c17b5943b08c9190a250565b6060600180546107be90611f51565b80156110465760115460ff166110465760405162461bcd60e51b815260206004820152601f60248201527f4d61726b6574706c616365206c697374696e672069732064697361626c65640060448201526064016108c3565b6108d6828261160d565b6110586113e8565b60098190556040518181527fa099db76bfe45aed42fd5d0753ef45c663a92745c5b265059e1fdd56efca4d49906020016107a5565b6110956113e8565b600c8190556040518181527fa70551d77839af8d46672cc5a1e4fc3a1b08e9e3cc87239c10d705a80baf938c906020016107a5565b6110d26113e8565b6011805460ff19168215159081179091556040519081527f705ccf061eece93f15c7c062eb64445c1942f1d89ea221d376bbc3475dde657f906020016107a5565b61111e848484610b16565b610b993385858585611618565b60605f8211801561113e57506008548211155b6111a25760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016108c3565b60106111ad83611740565b6040516020016111be9291906120da565b6040516020818303038152906040529050919050565b6111dc6113e8565b600e805460ff191660011790556040517fd7d248ba47bac931be252275aff92303dd610ca36c92c05dbac783fde1662a0e905f90a1565b61121b6113e8565b611223611458565b600b5481908161123260085490565b61123c9190611f9d565b11156112805760405162461bcd60e51b815260206004820152601360248201527213585e081cdd5c1c1b1e48195e18d959591959606a1b60448201526064016108c3565b5f5b8181101561131f57611298600880546001019055565b5f6112a260085490565b90506112b9858584818110610c5257610c52611fc7565b808585848181106112cc576112cc611fc7565b90506020020160208101906112e19190611e29565b6001600160a01b03167f4cc0a9c4a99ddc700de1af2c9f916a7cbfdb71f14801ccff94061ad1ef8a804060405160405180910390a350600101611282565b50506108d66001600755565b6113336113e8565b6001600160a01b0381165f818152600f6020526040808220805460ff19166001179055517f4f783c179409b4127238bc9c990bc99b9a651666a0d20b51d6c42849eb88466d9190a250565b6001600160a01b039182165f90815260056020908152604080832093909416825291909152205460ff1690565b6113b36113e8565b6001600160a01b0381166113dc57604051631e4fbdf760e01b81525f60048201526024016108c3565b6113e5816115bc565b50565b6006546001600160a01b03163314610ac95760405163118cdaa760e01b81523360048201526024016108c3565b5f818152600260205260408120546001600160a01b03168061074e57604051637e27328960e01b8152600481018490526024016108c3565b6108d68282336117d0565b6002600754036114aa5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108c3565b6002600755565b6108d6828260405180602001604052805f8152506117dd565b5f828152600260205260408120546001600160a01b03908116908316156114f6576114f68184866117f4565b6001600160a01b03811615611530576115115f855f5f611858565b6001600160a01b0381165f90815260036020526040902080545f190190555b6001600160a01b0385161561155e576001600160a01b0385165f908152600360205260409020805460010190555b5f8481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6108d633838361195c565b6001600160a01b0383163b1561173957604051630a85bd0160e11b81526001600160a01b0384169063150b7a029061165a90889088908790879060040161215a565b6020604051808303815f875af1925050508015611694575060408051601f3d908101601f1916820190925261169191810190612196565b60015b6116fb573d8080156116c1576040519150601f19603f3d011682016040523d82523d5f602084013e6116c6565b606091505b5080515f036116f357604051633250574960e11b81526001600160a01b03851660048201526024016108c3565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461173757604051633250574960e11b81526001600160a01b03851660048201526024016108c3565b505b5050505050565b60605f61174c836119fa565b60010190505f8167ffffffffffffffff81111561176b5761176b611d59565b6040519080825280601f01601f191660200182016040528015611795576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461179f57509392505050565b610ce88383836001611858565b6117e78383611ad1565b610ce8335f858585611618565b6117ff838383611b32565b610ce8576001600160a01b03831661182d57604051637e27328960e01b8152600481018290526024016108c3565b60405163177e802f60e01b81526001600160a01b0383166004820152602481018290526044016108c3565b808061186c57506001600160a01b03821615155b1561192d575f61187b84611415565b90506001600160a01b038316158015906118a75750826001600160a01b0316816001600160a01b031614155b80156118ba57506118b8818461137e565b155b156118e35760405163a9fbf51f60e01b81526001600160a01b03841660048201526024016108c3565b811561192b5783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03821661198e57604051630b61174360e31b81526001600160a01b03831660048201526024016108c3565b6001600160a01b038381165f81815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310611a385772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611a64576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611a8257662386f26fc10000830492506010015b6305f5e1008310611a9a576305f5e100830492506008015b6127108310611aae57612710830492506004015b60648310611ac0576064830492506002015b600a831061074e5760010192915050565b6001600160a01b038216611afa57604051633250574960e11b81525f60048201526024016108c3565b5f611b0683835f6114ca565b90506001600160a01b03811615610ce8576040516339e3563760e11b81525f60048201526024016108c3565b5f6001600160a01b03831615801590611b8e5750826001600160a01b0316846001600160a01b03161480611b6b5750611b6b848461137e565b80611b8e57505f828152600460205260409020546001600160a01b038481169116145b949350505050565b6001600160e01b0319811681146113e5575f5ffd5b5f60208284031215611bbb575f5ffd5b8135611bc681611b96565b9392505050565b80358015158114611bdc575f5ffd5b919050565b5f60208284031215611bf1575f5ffd5b611bc682611bcd565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f611bc66020830184611bfa565b5f60208284031215611c4a575f5ffd5b5035919050565b80356001600160a01b0381168114611bdc575f5ffd5b5f5f60408385031215611c78575f5ffd5b611c8183611c51565b946020939093013593505050565b5f5f5f60608486031215611ca1575f5ffd5b611caa84611c51565b9250611cb860208501611c51565b929592945050506040919091013590565b5f5f83601f840112611cd9575f5ffd5b50813567ffffffffffffffff811115611cf0575f5ffd5b6020830191508360208260051b8501011115611d0a575f5ffd5b9250929050565b5f5f5f60408486031215611d23575f5ffd5b833567ffffffffffffffff811115611d39575f5ffd5b611d4586828701611cc9565b909790965060209590950135949350505050565b634e487b7160e01b5f52604160045260245ffd5b5f5f67ffffffffffffffff841115611d8757611d87611d59565b50604051601f19601f85018116603f0116810181811067ffffffffffffffff82111715611db657611db6611d59565b604052838152905080828401851015611dcd575f5ffd5b838360208301375f60208583010152509392505050565b5f60208284031215611df4575f5ffd5b813567ffffffffffffffff811115611e0a575f5ffd5b8201601f81018413611e1a575f5ffd5b611b8e84823560208401611d6d565b5f60208284031215611e39575f5ffd5b611bc682611c51565b5f5f60408385031215611e53575f5ffd5b611e5c83611c51565b9150611e6a60208401611bcd565b90509250929050565b5f5f5f5f60808587031215611e86575f5ffd5b611e8f85611c51565b9350611e9d60208601611c51565b925060408501359150606085013567ffffffffffffffff811115611ebf575f5ffd5b8501601f81018713611ecf575f5ffd5b611ede87823560208401611d6d565b91505092959194509250565b5f5f60208385031215611efb575f5ffd5b823567ffffffffffffffff811115611f11575f5ffd5b611f1d85828601611cc9565b90969095509350505050565b5f5f60408385031215611f3a575f5ffd5b611f4383611c51565b9150611e6a60208401611c51565b600181811c90821680611f6557607f821691505b602082108103611f8357634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8082018082111561074e5761074e611f89565b808202811582820484141761074e5761074e611f89565b634e487b7160e01b5f52603260045260245ffd5b601f821115610ce857805f5260205f20601f840160051c810160208510156120005750805b601f840160051c820191505b81811015611739575f815560010161200c565b815167ffffffffffffffff81111561203957612039611d59565b61204d816120478454611f51565b84611fdb565b6020601f82116001811461207f575f83156120685750848201515b5f19600385901b1c1916600184901b178455611739565b5f84815260208120601f198516915b828110156120ae578785015182556020948501946001909201910161208e565b50848210156120cb57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f5f84546120e781611f51565b6001821680156120fe576001811461211357612140565b60ff1983168652811515820286019350612140565b875f5260205f205f5b838110156121385781548882015260019091019060200161211c565b505081860193505b50505083518060208601835e5f9101908152949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f9061218c90830184611bfa565b9695505050505050565b5f602082840312156121a6575f5ffd5b8151611bc681611b9656fea2646970667358221220933ece53901e1b3858011f9cb70a7e9a015ecf7384ce7b39837a3b51771e7f1764736f6c634300081c003300000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000009fdf42f6e4800000000000000000000000000000000000000000000000000000b1a2bc2ec50000000000000000000000000000000000000000000000000000000000000000115c0000000000000000000000000000000000000000000000000000000000000019000000000000000000000000000000000000000000000000000000000000002668747470733a2f2f6d657461646174612e6672656e7376696c6c652e636f6d2f63686962692f0000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x60806040526004361061023e575f3560e01c806375fb6a2311610134578063b5cfe31b116100b3578063d67b06c111610078578063d67b06c114610647578063dc53fd9214610666578063e43252d71461067b578063e985e9c51461069a578063f2fde38b146106b9578063fddcb5ea146106d8575f5ffd5b8063b5cfe31b146105c1578063b88d4fde146105e0578063c87b56dd146105ff578063cd85cdb51461061e578063d5abeb0114610632575f5ffd5b80639b19251a116100f95780639b19251a14610521578063a22cb4651461054f578063a611708e1461056e578063afdf61341461058d578063b228d925146105ac575f5ffd5b806375fb6a231461049f5780637e4831d3146104b85780638ab1d681146104d15780638da5cb5b146104f057806395d89b411461050d575f5ffd5b806339b7ec29116101c05780635d82cf6e116101855780635d82cf6e1461040f5780636352211e1461042e5780636f8b44b01461044d57806370a082311461046c578063715018a61461048b575f5ffd5b806339b7ec29146103805780633ccfd60b1461039f57806342842e0e146103b357806351fb012d146103d257806355f804b3146103f0575f5ffd5b80631249c58b116102065780631249c58b1461030e57806318160ddd146103165780631a8bd2da1461033857806323b872dd1461034c57806335c6aaf81461036b575f5ffd5b806301ffc9a714610242578063052d9e7e1461027657806306fdde0314610297578063081812fc146102b8578063095ea7b3146102ef575b5f5ffd5b34801561024d575f5ffd5b5061026161025c366004611bab565b610703565b60405190151581526020015b60405180910390f35b348015610281575f5ffd5b50610295610290366004611be1565b610754565b005b3480156102a2575f5ffd5b506102ab6107b0565b60405161026d9190611c28565b3480156102c3575f5ffd5b506102d76102d2366004611c3a565b61083f565b6040516001600160a01b03909116815260200161026d565b3480156102fa575f5ffd5b50610295610309366004611c67565b610866565b6102956108da565b348015610321575f5ffd5b5061032a610acb565b60405190815260200161026d565b348015610343575f5ffd5b50610295610ada565b348015610357575f5ffd5b50610295610366366004611c8f565b610b16565b348015610376575f5ffd5b5061032a60095481565b34801561038b575f5ffd5b5061029561039a366004611d11565b610b9f565b3480156103aa575f5ffd5b50610295610ced565b3480156103be575f5ffd5b506102956103cd366004611c8f565b610df4565b3480156103dd575f5ffd5b50600e5461026190610100900460ff1681565b3480156103fb575f5ffd5b5061029561040a366004611de4565b610e0e565b34801561041a575f5ffd5b50610295610429366004611c3a565b610e52565b348015610439575f5ffd5b506102d7610448366004611c3a565b610e8f565b348015610458575f5ffd5b50610295610467366004611c3a565b610e99565b348015610477575f5ffd5b5061032a610486366004611e29565b610f39565b348015610496575f5ffd5b50610295610f7e565b3480156104aa575f5ffd5b506011546102619060ff1681565b3480156104c3575f5ffd5b50600e546102619060ff1681565b3480156104dc575f5ffd5b506102956104eb366004611e29565b610f8f565b3480156104fb575f5ffd5b506006546001600160a01b03166102d7565b348015610518575f5ffd5b506102ab610fdf565b34801561052c575f5ffd5b5061026161053b366004611e29565b600f6020525f908152604090205460ff1681565b34801561055a575f5ffd5b50610295610569366004611e42565b610fee565b348015610579575f5ffd5b50610295610588366004611c3a565b611050565b348015610598575f5ffd5b506102956105a7366004611c3a565b61108d565b3480156105b7575f5ffd5b5061032a600c5481565b3480156105cc575f5ffd5b506102956105db366004611be1565b6110ca565b3480156105eb575f5ffd5b506102956105fa366004611e73565b611113565b34801561060a575f5ffd5b506102ab610619366004611c3a565b61112b565b348015610629575f5ffd5b506102956111d4565b34801561063d575f5ffd5b5061032a600b5481565b348015610652575f5ffd5b50610295610661366004611eea565b611213565b348015610671575f5ffd5b5061032a600a5481565b348015610686575f5ffd5b50610295610695366004611e29565b61132b565b3480156106a5575f5ffd5b506102616106b4366004611f29565b61137e565b3480156106c4575f5ffd5b506102956106d3366004611e29565b6113ab565b3480156106e3575f5ffd5b5061032a6106f2366004611e29565b600d6020525f908152604090205481565b5f6001600160e01b031982166380ac58cd60e01b148061073357506001600160e01b03198216635b5e139f60e01b145b8061074e57506301ffc9a760e01b6001600160e01b03198316145b92915050565b61075c6113e8565b600e80548215156101000261ff00199091161790556040517f1cf28b997975c7be355bcef74f2f5019aa48253bc1e54b3c8b002471865fdba8906107a590831515815260200190565b60405180910390a150565b60605f80546107be90611f51565b80601f01602080910402602001604051908101604052809291908181526020018280546107ea90611f51565b80156108355780601f1061080c57610100808354040283529160200191610835565b820191905f5260205f20905b81548152906001019060200180831161081857829003601f168201915b5050505050905090565b5f61084982611415565b505f828152600460205260409020546001600160a01b031661074e565b6001600160a01b038216156108cc5760115460ff166108cc5760405162461bcd60e51b815260206004820152601f60248201527f4d61726b6574706c616365206c697374696e672069732064697361626c65640060448201526064015b60405180910390fd5b6108d6828261144d565b5050565b6108e2611458565b600e5460ff16156109295760405162461bcd60e51b8152602060048201526011602482015270135a5b9d1a5b99c81a5cc81c185d5cd959607a1b60448201526064016108c3565b600a54600e54610100900460ff1680156109515750335f908152600f602052604090205460ff165b1561095b57506009545b803410156109a25760405162461bcd60e51b8152602060048201526014602482015273125b9cdd59999a58da595b9d081c185e5b595b9d60621b60448201526064016108c3565b600b54600854106109ea5760405162461bcd60e51b815260206004820152601260248201527113585e081cdd5c1c1b1e481c995858da195960721b60448201526064016108c3565b600c54335f908152600d602052604090205410610a495760405162461bcd60e51b815260206004820152601b60248201527f4d6178206d696e74207065722077616c6c65742072656163686564000000000060448201526064016108c3565b610a57600880546001019055565b5f610a6160085490565b9050610a6d33826114b1565b335f908152600d60205260408120805460019290610a8c908490611f9d565b9091555050604051819033907f4cc0a9c4a99ddc700de1af2c9f916a7cbfdb71f14801ccff94061ad1ef8a8040905f90a35050610ac96001600755565b565b5f610ad560085490565b905090565b610ae26113e8565b600e805460ff191690556040517fd76d4045ba8d223490b9c6a5657cfdaa2316ac28a5a65274870bfe66a33ea0c4905f90a1565b6001600160a01b038216610b3f57604051633250574960e11b81525f60048201526024016108c3565b5f610b4b8383336114ca565b9050836001600160a01b0316816001600160a01b031614610b99576040516364283d7b60e01b81526001600160a01b03808616600483015260248201849052821660448201526064016108c3565b50505050565b610ba76113e8565b610baf611458565b600b548290610bbe8383611fb0565b600854610bcb9190611f9d565b1115610c0f5760405162461bcd60e51b815260206004820152601360248201527213585e081cdd5c1c1b1e48195e18d959591959606a1b60448201526064016108c3565b5f5b81811015610cdc575f5b83811015610cd357610c31600880546001019055565b5f610c3b60085490565b9050610c6d878785818110610c5257610c52611fc7565b9050602002016020810190610c679190611e29565b826114b1565b80878785818110610c8057610c80611fc7565b9050602002016020810190610c959190611e29565b6001600160a01b03167f4cc0a9c4a99ddc700de1af2c9f916a7cbfdb71f14801ccff94061ad1ef8a804060405160405180910390a350600101610c1b565b50600101610c11565b5050610ce86001600755565b505050565b610cf56113e8565b610cfd611458565b4780610d445760405162461bcd60e51b81526020600482015260166024820152754e6f2062616c616e636520746f20776974686472617760501b60448201526064016108c3565b5f610d576006546001600160a01b031690565b6001600160a01b0316826040515f6040518083038185875af1925050503d805f8114610d9e576040519150601f19603f3d011682016040523d82523d5f602084013e610da3565b606091505b5050905080610de85760405162461bcd60e51b815260206004820152601160248201527015da5d1a191c985dd85b0819985a5b1959607a1b60448201526064016108c3565b5050610ac96001600755565b610ce883838360405180602001604052805f815250611113565b610e166113e8565b6010610e22828261201f565b507f6741b2fc379fad678116fe3d4d4b9a1a184ab53ba36b86ad0fa66340b1ab41ad816040516107a59190611c28565b610e5a6113e8565b600a8190556040518181527f6267c2c470a7940d276500728ecd2ad64aed9043ea1a307826e7613adff1f20f906020016107a5565b5f61074e82611415565b610ea16113e8565b600854811015610f045760405162461bcd60e51b815260206004820152602860248201527f4e6577206d617820737570706c79206973206c657373207468616e206d696e7460448201526719590818dbdd5b9d60c21b60648201526084016108c3565b600b8190556040518181527f7810bd47de260c3e9ee10061cf438099dd12256c79485f12f94dbccc981e806c906020016107a5565b5f6001600160a01b038216610f63576040516322718ad960e21b81525f60048201526024016108c3565b506001600160a01b03165f9081526003602052604090205490565b610f866113e8565b610ac95f6115bc565b610f976113e8565b6001600160a01b0381165f818152600f6020526040808220805460ff19169055517f535611fb62fa2a833988f283b779e417e996813e44046f521d76c17b5943b08c9190a250565b6060600180546107be90611f51565b80156110465760115460ff166110465760405162461bcd60e51b815260206004820152601f60248201527f4d61726b6574706c616365206c697374696e672069732064697361626c65640060448201526064016108c3565b6108d6828261160d565b6110586113e8565b60098190556040518181527fa099db76bfe45aed42fd5d0753ef45c663a92745c5b265059e1fdd56efca4d49906020016107a5565b6110956113e8565b600c8190556040518181527fa70551d77839af8d46672cc5a1e4fc3a1b08e9e3cc87239c10d705a80baf938c906020016107a5565b6110d26113e8565b6011805460ff19168215159081179091556040519081527f705ccf061eece93f15c7c062eb64445c1942f1d89ea221d376bbc3475dde657f906020016107a5565b61111e848484610b16565b610b993385858585611618565b60605f8211801561113e57506008548211155b6111a25760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016108c3565b60106111ad83611740565b6040516020016111be9291906120da565b6040516020818303038152906040529050919050565b6111dc6113e8565b600e805460ff191660011790556040517fd7d248ba47bac931be252275aff92303dd610ca36c92c05dbac783fde1662a0e905f90a1565b61121b6113e8565b611223611458565b600b5481908161123260085490565b61123c9190611f9d565b11156112805760405162461bcd60e51b815260206004820152601360248201527213585e081cdd5c1c1b1e48195e18d959591959606a1b60448201526064016108c3565b5f5b8181101561131f57611298600880546001019055565b5f6112a260085490565b90506112b9858584818110610c5257610c52611fc7565b808585848181106112cc576112cc611fc7565b90506020020160208101906112e19190611e29565b6001600160a01b03167f4cc0a9c4a99ddc700de1af2c9f916a7cbfdb71f14801ccff94061ad1ef8a804060405160405180910390a350600101611282565b50506108d66001600755565b6113336113e8565b6001600160a01b0381165f818152600f6020526040808220805460ff19166001179055517f4f783c179409b4127238bc9c990bc99b9a651666a0d20b51d6c42849eb88466d9190a250565b6001600160a01b039182165f90815260056020908152604080832093909416825291909152205460ff1690565b6113b36113e8565b6001600160a01b0381166113dc57604051631e4fbdf760e01b81525f60048201526024016108c3565b6113e5816115bc565b50565b6006546001600160a01b03163314610ac95760405163118cdaa760e01b81523360048201526024016108c3565b5f818152600260205260408120546001600160a01b03168061074e57604051637e27328960e01b8152600481018490526024016108c3565b6108d68282336117d0565b6002600754036114aa5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016108c3565b6002600755565b6108d6828260405180602001604052805f8152506117dd565b5f828152600260205260408120546001600160a01b03908116908316156114f6576114f68184866117f4565b6001600160a01b03811615611530576115115f855f5f611858565b6001600160a01b0381165f90815260036020526040902080545f190190555b6001600160a01b0385161561155e576001600160a01b0385165f908152600360205260409020805460010190555b5f8481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6108d633838361195c565b6001600160a01b0383163b1561173957604051630a85bd0160e11b81526001600160a01b0384169063150b7a029061165a90889088908790879060040161215a565b6020604051808303815f875af1925050508015611694575060408051601f3d908101601f1916820190925261169191810190612196565b60015b6116fb573d8080156116c1576040519150601f19603f3d011682016040523d82523d5f602084013e6116c6565b606091505b5080515f036116f357604051633250574960e11b81526001600160a01b03851660048201526024016108c3565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461173757604051633250574960e11b81526001600160a01b03851660048201526024016108c3565b505b5050505050565b60605f61174c836119fa565b60010190505f8167ffffffffffffffff81111561176b5761176b611d59565b6040519080825280601f01601f191660200182016040528015611795576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461179f57509392505050565b610ce88383836001611858565b6117e78383611ad1565b610ce8335f858585611618565b6117ff838383611b32565b610ce8576001600160a01b03831661182d57604051637e27328960e01b8152600481018290526024016108c3565b60405163177e802f60e01b81526001600160a01b0383166004820152602481018290526044016108c3565b808061186c57506001600160a01b03821615155b1561192d575f61187b84611415565b90506001600160a01b038316158015906118a75750826001600160a01b0316816001600160a01b031614155b80156118ba57506118b8818461137e565b155b156118e35760405163a9fbf51f60e01b81526001600160a01b03841660048201526024016108c3565b811561192b5783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03821661198e57604051630b61174360e31b81526001600160a01b03831660048201526024016108c3565b6001600160a01b038381165f81815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310611a385772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611a64576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611a8257662386f26fc10000830492506010015b6305f5e1008310611a9a576305f5e100830492506008015b6127108310611aae57612710830492506004015b60648310611ac0576064830492506002015b600a831061074e5760010192915050565b6001600160a01b038216611afa57604051633250574960e11b81525f60048201526024016108c3565b5f611b0683835f6114ca565b90506001600160a01b03811615610ce8576040516339e3563760e11b81525f60048201526024016108c3565b5f6001600160a01b03831615801590611b8e5750826001600160a01b0316846001600160a01b03161480611b6b5750611b6b848461137e565b80611b8e57505f828152600460205260409020546001600160a01b038481169116145b949350505050565b6001600160e01b0319811681146113e5575f5ffd5b5f60208284031215611bbb575f5ffd5b8135611bc681611b96565b9392505050565b80358015158114611bdc575f5ffd5b919050565b5f60208284031215611bf1575f5ffd5b611bc682611bcd565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f611bc66020830184611bfa565b5f60208284031215611c4a575f5ffd5b5035919050565b80356001600160a01b0381168114611bdc575f5ffd5b5f5f60408385031215611c78575f5ffd5b611c8183611c51565b946020939093013593505050565b5f5f5f60608486031215611ca1575f5ffd5b611caa84611c51565b9250611cb860208501611c51565b929592945050506040919091013590565b5f5f83601f840112611cd9575f5ffd5b50813567ffffffffffffffff811115611cf0575f5ffd5b6020830191508360208260051b8501011115611d0a575f5ffd5b9250929050565b5f5f5f60408486031215611d23575f5ffd5b833567ffffffffffffffff811115611d39575f5ffd5b611d4586828701611cc9565b909790965060209590950135949350505050565b634e487b7160e01b5f52604160045260245ffd5b5f5f67ffffffffffffffff841115611d8757611d87611d59565b50604051601f19601f85018116603f0116810181811067ffffffffffffffff82111715611db657611db6611d59565b604052838152905080828401851015611dcd575f5ffd5b838360208301375f60208583010152509392505050565b5f60208284031215611df4575f5ffd5b813567ffffffffffffffff811115611e0a575f5ffd5b8201601f81018413611e1a575f5ffd5b611b8e84823560208401611d6d565b5f60208284031215611e39575f5ffd5b611bc682611c51565b5f5f60408385031215611e53575f5ffd5b611e5c83611c51565b9150611e6a60208401611bcd565b90509250929050565b5f5f5f5f60808587031215611e86575f5ffd5b611e8f85611c51565b9350611e9d60208601611c51565b925060408501359150606085013567ffffffffffffffff811115611ebf575f5ffd5b8501601f81018713611ecf575f5ffd5b611ede87823560208401611d6d565b91505092959194509250565b5f5f60208385031215611efb575f5ffd5b823567ffffffffffffffff811115611f11575f5ffd5b611f1d85828601611cc9565b90969095509350505050565b5f5f60408385031215611f3a575f5ffd5b611f4383611c51565b9150611e6a60208401611c51565b600181811c90821680611f6557607f821691505b602082108103611f8357634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8082018082111561074e5761074e611f89565b808202811582820484141761074e5761074e611f89565b634e487b7160e01b5f52603260045260245ffd5b601f821115610ce857805f5260205f20601f840160051c810160208510156120005750805b601f840160051c820191505b81811015611739575f815560010161200c565b815167ffffffffffffffff81111561203957612039611d59565b61204d816120478454611f51565b84611fdb565b6020601f82116001811461207f575f83156120685750848201515b5f19600385901b1c1916600184901b178455611739565b5f84815260208120601f198516915b828110156120ae578785015182556020948501946001909201910161208e565b50848210156120cb57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f5f84546120e781611f51565b6001821680156120fe576001811461211357612140565b60ff1983168652811515820286019350612140565b875f5260205f205f5b838110156121385781548882015260019091019060200161211c565b505081860193505b50505083518060208601835e5f9101908152949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f9061218c90830184611bfa565b9695505050505050565b5f602082840312156121a6575f5ffd5b8151611bc681611b9656fea2646970667358221220933ece53901e1b3858011f9cb70a7e9a015ecf7384ce7b39837a3b51771e7f1764736f6c634300081c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000009fdf42f6e4800000000000000000000000000000000000000000000000000000b1a2bc2ec50000000000000000000000000000000000000000000000000000000000000000115c0000000000000000000000000000000000000000000000000000000000000019000000000000000000000000000000000000000000000000000000000000002668747470733a2f2f6d657461646174612e6672656e7376696c6c652e636f6d2f63686962692f0000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _initBaseURI (string): https://metadata.frensville.com/chibi/
Arg [1] : _initWhitelistMintPrice (uint256): 45000000000000000
Arg [2] : _initPublicMintPrice (uint256): 50000000000000000
Arg [3] : _maxSupply (uint256): 4444
Arg [4] : _maxMintPerWallet (uint256): 25
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [1] : 000000000000000000000000000000000000000000000000009fdf42f6e48000
Arg [2] : 00000000000000000000000000000000000000000000000000b1a2bc2ec50000
Arg [3] : 000000000000000000000000000000000000000000000000000000000000115c
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000019
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000026
Arg [6] : 68747470733a2f2f6d657461646174612e6672656e7376696c6c652e636f6d2f
Arg [7] : 63686962692f0000000000000000000000000000000000000000000000000000
Deployed Bytecode Sourcemap
129939:9006:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;106683:305;;;;;;;;;;-1:-1:-1;106683:305:0;;;;;:::i;:::-;;:::i;:::-;;;565:14:1;;558:22;540:41;;528:2;513:18;106683:305:0;;;;;;;;132762:157;;;;;;;;;;-1:-1:-1;132762:157:0;;;;;:::i;:::-;;:::i;:::-;;107514:91;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;108686:158::-;;;;;;;;;;-1:-1:-1;108686:158:0;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;1856:32:1;;;1838:51;;1826:2;1811:18;108686:158:0;1692:203:1;138395:235:0;;;;;;;;;;-1:-1:-1;138395:235:0;;;;;:::i;:::-;;:::i;134932:712::-;;;:::i;137738:106::-;;;;;;;;;;;;;:::i;:::-;;;2529:25:1;;;2517:2;2502:18;137738:106:0;2383:177:1;133098:109:0;;;;;;;;;;;;;:::i;109355:588::-;;;;;;;;;;-1:-1:-1;109355:588:0;;;;;:::i;:::-;;:::i;130204:33::-;;;;;;;;;;;;;;;;136713:630;;;;;;;;;;-1:-1:-1;136713:630:0;;;;;:::i;:::-;;:::i;137399:286::-;;;;;;;;;;;;;:::i;110014:134::-;;;;;;;;;;-1:-1:-1;110014:134:0;;;;;:::i;:::-;;:::i;130661:28::-;;;;;;;;;;-1:-1:-1;130661:28:0;;;;;;;;;;;133611:151;;;;;;;;;;-1:-1:-1;133611:151:0;;;;;:::i;:::-;;:::i;133445:158::-;;;;;;;;;;-1:-1:-1;133445:158:0;;;;;:::i;:::-;;:::i;107327:120::-;;;;;;;;;;-1:-1:-1;107327:120:0;;;;;:::i;:::-;;:::i;133770:257::-;;;;;;;;;;-1:-1:-1;133770:257:0;;;;;:::i;:::-;;:::i;107052:213::-;;;;;;;;;;-1:-1:-1;107052:213:0;;;;;:::i;:::-;;:::i;124336:103::-;;;;;;;;;;;;;:::i;130949:37::-;;;;;;;;;;-1:-1:-1;130949:37:0;;;;;;;;130597:22;;;;;;;;;;-1:-1:-1;130597:22:0;;;;;;;;132598:156;;;;;;;;;;-1:-1:-1;132598:156:0;;;;;:::i;:::-;;:::i;123661:87::-;;;;;;;;;;-1:-1:-1;123734:6:0;;-1:-1:-1;;;;;123734:6:0;123661:87;;107674:95;;;;;;;;;;;;;:::i;130696:41::-;;;;;;;;;;-1:-1:-1;130696:41:0;;;;;:::i;:::-;;;;;;;;;;;;;;;;138684:258;;;;;;;;;;-1:-1:-1;138684:258:0;;;;;:::i;:::-;;:::i;133270:167::-;;;;;;;;;;-1:-1:-1;133270:167:0;;;;;:::i;:::-;;:::i;134035:188::-;;;;;;;;;;-1:-1:-1;134035:188:0;;;;;:::i;:::-;;:::i;130401:31::-;;;;;;;;;;;;;;;;134231:181;;;;;;;;;;-1:-1:-1;134231:181:0;;;;;:::i;:::-;;:::i;110219:236::-;;;;;;;;;;-1:-1:-1;110219:236:0;;;;;:::i;:::-;;:::i;138016:286::-;;;;;;;;;;-1:-1:-1;138016:286:0;;;;;:::i;:::-;;:::i;132986:104::-;;;;;;;;;;;;;:::i;130307:24::-;;;;;;;;;;;;;;;;135957:506;;;;;;;;;;-1:-1:-1;135957:506:0;;;;;:::i;:::-;;:::i;130244:30::-;;;;;;;;;;;;;;;;132449:141;;;;;;;;;;-1:-1:-1;132449:141:0;;;;;:::i;:::-;;:::i;109133:155::-;;;;;;;;;;-1:-1:-1;109133:155:0;;;;;:::i;:::-;;:::i;124594:220::-;;;;;;;;;;-1:-1:-1;124594:220:0;;;;;:::i;:::-;;:::i;130514:46::-;;;;;;;;;;-1:-1:-1;130514:46:0;;;;;:::i;:::-;;;;;;;;;;;;;;106683:305;106785:4;-1:-1:-1;;;;;;106822:40:0;;-1:-1:-1;;;106822:40:0;;:105;;-1:-1:-1;;;;;;;106879:48:0;;-1:-1:-1;;;106879:48:0;106822:105;:158;;;-1:-1:-1;;;;;;;;;;105381:40:0;;;106944:36;106802:178;106683:305;-1:-1:-1;;106683:305:0:o;132762:157::-;123547:13;:11;:13::i;:::-;132836:16:::1;:27:::0;;;::::1;;;;-1:-1:-1::0;;132836:27:0;;::::1;;::::0;;132879:32:::1;::::0;::::1;::::0;::::1;::::0;132855:8;565:14:1;558:22;540:41;;528:2;513:18;;400:187;132879:32:0::1;;;;;;;;132762:157:::0;:::o;107514:91::-;107559:13;107592:5;107585:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;107514:91;:::o;108686:158::-;108753:7;108773:22;108787:7;108773:13;:22::i;:::-;-1:-1:-1;111288:7:0;111315:24;;;:15;:24;;;;;;-1:-1:-1;;;;;111315:24:0;108815:21;111218:129;138395:235;-1:-1:-1;;;;;138472:16:0;;;138468:118;;138513:25;;;;138505:69;;;;-1:-1:-1;;;138505:69:0;;7643:2:1;138505:69:0;;;7625:21:1;7682:2;7662:18;;;7655:30;7721:33;7701:18;;;7694:61;7772:18;;138505:69:0;;;;;;;;;138596:26;138610:2;138614:7;138596:13;:26::i;:::-;138395:235;;:::o;134932:712::-;128982:21;:19;:21::i;:::-;134998:10:::1;::::0;::::1;;134997:11;134989:41;;;::::0;-1:-1:-1;;;134989:41:0;;8003:2:1;134989:41:0::1;::::0;::::1;7985:21:1::0;8042:2;8022:18;;;8015:30;-1:-1:-1;;;8061:18:1;;;8054:47;8118:18;;134989:41:0::1;7801:341:1::0;134989:41:0::1;135057:15;::::0;135087:16:::1;::::0;::::1;::::0;::::1;;;:41:::0;::::1;;;-1:-1:-1::0;135117:10:0::1;135107:21;::::0;;;:9:::1;:21;::::0;;;;;::::1;;135087:41;135083:100;;;-1:-1:-1::0;135153:18:0::1;::::0;135083:100:::1;135214:5;135201:9;:18;;135193:51;;;::::0;-1:-1:-1;;;135193:51:0;;8349:2:1;135193:51:0::1;::::0;::::1;8331:21:1::0;8388:2;8368:18;;;8361:30;-1:-1:-1;;;8407:18:1;;;8400:50;8467:18;;135193:51:0::1;8147:344:1::0;135193:51:0::1;135291:9;::::0;135263:15:::1;126136:14:::0;135263:37:::1;135255:68;;;::::0;-1:-1:-1;;;135255:68:0;;8698:2:1;135255:68:0::1;::::0;::::1;8680:21:1::0;8737:2;8717:18;;;8710:30;-1:-1:-1;;;8756:18:1;;;8749:48;8814:18;;135255:68:0::1;8496:342:1::0;135255:68:0::1;135368:16;::::0;135354:10:::1;135342:23;::::0;;;:11:::1;:23;::::0;;;;;:42:::1;135334:82;;;::::0;-1:-1:-1;;;135334:82:0;;9045:2:1;135334:82:0::1;::::0;::::1;9027:21:1::0;9084:2;9064:18;;;9057:30;9123:29;9103:18;;;9096:57;9170:18;;135334:82:0::1;8843:351:1::0;135334:82:0::1;135429:27;:15;126255:19:::0;;126273:1;126255:19;;;126166:127;135429:27:::1;135467:15;135485:25;:15;126136:14:::0;;126044:114;135485:25:::1;135467:43;;135521:30;135531:10;135543:7;135521:9;:30::i;:::-;135574:10;135562:23;::::0;;;:11:::1;:23;::::0;;;;:28;;135589:1:::1;::::0;135562:23;:28:::1;::::0;135589:1;;135562:28:::1;:::i;:::-;::::0;;;-1:-1:-1;;135606:30:0::1;::::0;135628:7;;135616:10:::1;::::0;135606:30:::1;::::0;;;::::1;134978:666;;129026:20:::0;128420:1;129546:7;:22;129363:213;129026:20;134932:712::o;137738:106::-;137784:7;137811:25;:15;126136:14;;126044:114;137811:25;137804:32;;137738:106;:::o;133098:109::-;123547:13;:11;:13::i;:::-;133151:10:::1;:18:::0;;-1:-1:-1;;133151:18:0::1;::::0;;133185:14:::1;::::0;::::1;::::0;133164:5:::1;::::0;133185:14:::1;133098:109::o:0;109355:588::-;-1:-1:-1;;;;;109450:16:0;;109446:89;;109490:33;;-1:-1:-1;;;109490:33:0;;109520:1;109490:33;;;1838:51:1;1811:18;;109490:33:0;1692:203:1;109446:89:0;109756:21;109780:34;109788:2;109792:7;17282:10;109780:7;:34::i;:::-;109756:58;;109846:4;-1:-1:-1;;;;;109829:21:0;:13;-1:-1:-1;;;;;109829:21:0;;109825:111;;109874:50;;-1:-1:-1;;;109874:50:0;;-1:-1:-1;;;;;9681:32:1;;;109874:50:0;;;9663:51:1;9730:18;;;9723:34;;;9793:32;;9773:18;;;9766:60;9636:18;;109874:50:0;9461:371:1;109825:111:0;109435:508;109355:588;;;:::o;136713:630::-;123547:13;:11;:13::i;:::-;128982:21:::1;:19;:21::i;:::-;136950:9:::2;::::0;136856:10;;136921:24:::2;136937:8:::0;136856:10;136921:24:::2;:::i;:::-;136892:15;126136:14:::0;136892:54:::2;;;;:::i;:::-;:67;;136884:99;;;::::0;-1:-1:-1;;;136884:99:0;;10212:2:1;136884:99:0::2;::::0;::::2;10194:21:1::0;10251:2;10231:18;;;10224:30;-1:-1:-1;;;10270:18:1;;;10263:49;10329:18;;136884:99:0::2;10010:343:1::0;136884:99:0::2;136999:9;136994:342;137018:13;137014:1;:17;136994:342;;;137058:9;137053:272;137077:8;137073:1;:12;137053:272;;;137111:27;:15;126255:19:::0;;126273:1;126255:19;;;126166:127;137111:27:::2;137157:15;137175:25;:15;126136:14:::0;;126044:114;137175:25:::2;137157:43;;137219:33;137229:10;;137240:1;137229:13;;;;;;;:::i;:::-;;;;;;;;;;;;;;:::i;:::-;137244:7;137219:9;:33::i;:::-;137301:7;137286:10;;137297:1;137286:13;;;;;;;:::i;:::-;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;137276:33:0::2;;;;;;;;;;;-1:-1:-1::0;137087:3:0::2;;137053:272;;;-1:-1:-1::0;137033:3:0::2;;136994:342;;;;136821:522;129026:20:::1;128420:1:::0;129546:7;:22;129363:213;129026:20:::1;136713:630:::0;;;:::o;137399:286::-;123547:13;:11;:13::i;:::-;128982:21:::1;:19;:21::i;:::-;137480::::2;137520:11:::0;137512:46:::2;;;::::0;-1:-1:-1;;;137512:46:0;;10692:2:1;137512:46:0::2;::::0;::::2;10674:21:1::0;10731:2;10711:18;;;10704:30;-1:-1:-1;;;10750:18:1;;;10743:52;10812:18;;137512:46:0::2;10490:346:1::0;137512:46:0::2;137570:12;137596:7;123734:6:::0;;-1:-1:-1;;;;;123734:6:0;;123661:87;137596:7:::2;-1:-1:-1::0;;;;;137588:21:0::2;137617:7;137588:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;137569:60;;;137648:7;137640:37;;;::::0;-1:-1:-1;;;137640:37:0;;11253:2:1;137640:37:0::2;::::0;::::2;11235:21:1::0;11292:2;11272:18;;;11265:30;-1:-1:-1;;;11311:18:1;;;11304:47;11368:18;;137640:37:0::2;11051:341:1::0;137640:37:0::2;137451:234;;129026:20:::1;128420:1:::0;129546:7;:22;129363:213;110014:134;110101:39;110118:4;110124:2;110128:7;110101:39;;;;;;;;;;;;:16;:39::i;133611:151::-;123547:13;:11;:13::i;:::-;133687:12:::1;:25;133702:10:::0;133687:12;:25:::1;:::i;:::-;;133728:26;133743:10;133728:26;;;;;;:::i;133445:158::-:0;123547:13;:11;:13::i;:::-;133521:15:::1;:26:::0;;;133563:32:::1;::::0;2529:25:1;;;133563:32:0::1;::::0;2517:2:1;2502:18;133563:32:0::1;2383:177:1::0;107327:120:0;107390:7;107417:22;107431:7;107417:13;:22::i;133770:257::-;123547:13;:11;:13::i;:::-;133868:15:::1;126136:14:::0;133852:12:::1;:41;;133844:94;;;::::0;-1:-1:-1;;;133844:94:0;;13723:2:1;133844:94:0::1;::::0;::::1;13705:21:1::0;13762:2;13742:18;;;13735:30;13801:34;13781:18;;;13774:62;-1:-1:-1;;;13852:18:1;;;13845:38;13900:19;;133844:94:0::1;13521:404:1::0;133844:94:0::1;133949:9;:24:::0;;;133989:30:::1;::::0;2529:25:1;;;133989:30:0::1;::::0;2517:2:1;2502:18;133989:30:0::1;2383:177:1::0;107052:213:0;107115:7;-1:-1:-1;;;;;107139:19:0;;107135:89;;107182:30;;-1:-1:-1;;;107182:30:0;;107209:1;107182:30;;;1838:51:1;1811:18;;107182:30:0;1692:203:1;107135:89:0;-1:-1:-1;;;;;;107241:16:0;;;;;:9;:16;;;;;;;107052:213::o;124336:103::-;123547:13;:11;:13::i;:::-;124401:30:::1;124428:1;124401:18;:30::i;132598:156::-:0;123547:13;:11;:13::i;:::-;-1:-1:-1;;;;;132672:16:0;::::1;132691:5;132672:16:::0;;;:9:::1;:16;::::0;;;;;:24;;-1:-1:-1;;132672:24:0::1;::::0;;132712:34;::::1;::::0;132691:5;132712:34:::1;132598:156:::0;:::o;107674:95::-;107721:13;107754:7;107747:14;;;;;:::i;138684:258::-;138775:8;138771:110;;;138808:25;;;;138800:69;;;;-1:-1:-1;;;138800:69:0;;7643:2:1;138800:69:0;;;7625:21:1;7682:2;7662:18;;;7655:30;7721:33;7701:18;;;7694:61;7772:18;;138800:69:0;7441:355:1;138800:69:0;138891:43;138915:8;138925;138891:23;:43::i;133270:167::-;123547:13;:11;:13::i;:::-;133349:18:::1;:29:::0;;;133394:35:::1;::::0;2529:25:1;;;133394:35:0::1;::::0;2517:2:1;2502:18;133394:35:0::1;2383:177:1::0;134035:188:0;123547:13;:11;:13::i;:::-;134121:16:::1;:36:::0;;;134173:42:::1;::::0;2529:25:1;;;134173:42:0::1;::::0;2517:2:1;2502:18;134173:42:0::1;2383:177:1::0;134231:181:0;123547:13;:11;:13::i;:::-;134313:25:::1;:35:::0;;-1:-1:-1;;134313:35:0::1;::::0;::::1;;::::0;;::::1;::::0;;;134364:40:::1;::::0;540:41:1;;;134364:40:0::1;::::0;528:2:1;513:18;134364:40:0::1;400:187:1::0;110219:236:0;110333:31;110346:4;110352:2;110356:7;110333:12;:31::i;:::-;110375:72;17282:10;110423:4;110429:2;110433:7;110442:4;110375:33;:72::i;138016:286::-;138081:13;138125:1;138115:7;:11;:51;;;;-1:-1:-1;138141:15:0;126136:14;138130:7;:36;;138115:51;138107:111;;;;-1:-1:-1;;;138107:111:0;;14132:2:1;138107:111:0;;;14114:21:1;14171:2;14151:18;;;14144:30;14210:34;14190:18;;;14183:62;-1:-1:-1;;;14261:18:1;;;14254:45;14316:19;;138107:111:0;13930:411:1;138107:111:0;138260:12;138274:18;:7;:16;:18::i;:::-;138243:50;;;;;;;;;:::i;:::-;;;;;;;;;;;;;138229:65;;138016:286;;;:::o;132986:104::-;123547:13;:11;:13::i;:::-;133037:10:::1;:17:::0;;-1:-1:-1;;133037:17:0::1;133050:4;133037:17;::::0;;133070:12:::1;::::0;::::1;::::0;133037:10:::1;::::0;133070:12:::1;132986:104::o:0;135957:506::-;123547:13;:11;:13::i;:::-;128982:21:::1;:19;:21::i;:::-;136155:9:::2;::::0;136074:10;;;136110:25:::2;:15;126136:14:::0;;126044:114;136110:25:::2;:41;;;;:::i;:::-;:54;;136102:86;;;::::0;-1:-1:-1;;;136102:86:0;;10212:2:1;136102:86:0::2;::::0;::::2;10194:21:1::0;10251:2;10231:18;;;10224:30;-1:-1:-1;;;10270:18:1;;;10263:49;10329:18;;136102:86:0::2;10010:343:1::0;136102:86:0::2;136204:9;136199:257;136223:13;136219:1;:17;136199:257;;;136258:27;:15;126255:19:::0;;126273:1;126255:19;;;126166:127;136258:27:::2;136300:15;136318:25;:15;126136:14:::0;;126044:114;136318:25:::2;136300:43;;136358:33;136368:10;;136379:1;136368:13;;;;;;;:::i;136358:33::-;136436:7;136421:10;;136432:1;136421:13;;;;;;;:::i;:::-;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;136411:33:0::2;;;;;;;;;;;-1:-1:-1::0;136238:3:0::2;;136199:257;;;;136039:424;129026:20:::1;128420:1:::0;129546:7;:22;129363:213;132449:141;123547:13;:11;:13::i;:::-;-1:-1:-1;;;;;132518:16:0;::::1;;::::0;;;:9:::1;:16;::::0;;;;;:23;;-1:-1:-1;;132518:23:0::1;132537:4;132518:23;::::0;;132557:25;::::1;::::0;132518:16;132557:25:::1;132449:141:::0;:::o;109133:155::-;-1:-1:-1;;;;;109245:25:0;;;109221:4;109245:25;;;:18;:25;;;;;;;;:35;;;;;;;;;;;;;;;109133:155::o;124594:220::-;123547:13;:11;:13::i;:::-;-1:-1:-1;;;;;124679:22:0;::::1;124675:93;;124725:31;::::0;-1:-1:-1;;;124725:31:0;;124753:1:::1;124725:31;::::0;::::1;1838:51:1::0;1811:18;;124725:31:0::1;1692:203:1::0;124675:93:0::1;124778:28;124797:8;124778:18;:28::i;:::-;124594:220:::0;:::o;123826:166::-;123734:6;;-1:-1:-1;;;;;123734:6:0;17282:10;123886:23;123882:103;;123933:40;;-1:-1:-1;;;123933:40:0;;17282:10;123933:40;;;1838:51:1;1811:18;;123933:40:0;1692:203:1;121737:247:0;121800:7;111073:16;;;:7;:16;;;;;;-1:-1:-1;;;;;111073:16:0;;121864:90;;121911:31;;-1:-1:-1;;;121911:31:0;;;;;2529:25:1;;;2502:18;;121911:31:0;2383:177:1;108505:115:0;108577:35;108586:2;108590:7;17282:10;108577:8;:35::i;129062:293::-;128464:1;129196:7;;:19;129188:63;;;;-1:-1:-1;;;129188:63:0;;15542:2:1;129188:63:0;;;15524:21:1;15581:2;15561:18;;;15554:30;15620:33;15600:18;;;15593:61;15671:18;;129188:63:0;15340:355:1;129188:63:0;128464:1;129329:7;:18;129062:293::o;116037:102::-;116105:26;116115:2;116119:7;116105:26;;;;;;;;;;;;:9;:26::i;114179:824::-;114265:7;111073:16;;;:7;:16;;;;;;-1:-1:-1;;;;;111073:16:0;;;;114380:18;;;114376:88;;114415:37;114432:4;114438;114444:7;114415:16;:37::i;:::-;-1:-1:-1;;;;;114511:18:0;;;114507:263;;114629:48;114646:1;114650:7;114667:1;114671:5;114629:8;:48::i;:::-;-1:-1:-1;;;;;114723:15:0;;;;;;:9;:15;;;;;:20;;-1:-1:-1;;114723:20:0;;;114507:263;-1:-1:-1;;;;;114786:16:0;;;114782:111;;-1:-1:-1;;;;;114848:13:0;;;;;;:9;:13;;;;;:18;;114865:1;114848:18;;;114782:111;114905:16;;;;:7;:16;;;;;;:21;;-1:-1:-1;;;;;;114905:21:0;-1:-1:-1;;;;;114905:21:0;;;;;;;;;114944:27;;114905:16;;114944:27;;;;;;;114991:4;114179:824;-1:-1:-1;;;;114179:824:0:o;124974:191::-;125067:6;;;-1:-1:-1;;;;;125084:17:0;;;-1:-1:-1;;;;;;125084:17:0;;;;;;;125117:40;;125067:6;;;125084:17;125067:6;;125117:40;;125048:16;;125117:40;125037:128;124974:191;:::o;108916:146::-;109002:52;17282:10;109035:8;109045;109002:18;:52::i;15552:948::-;-1:-1:-1;;;;;15739:14:0;;;:18;15735:758;;15778:67;;-1:-1:-1;;;15778:67:0;;-1:-1:-1;;;;;15778:36:0;;;;;:67;;15815:8;;15825:4;;15831:7;;15840:4;;15778:67;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;-1:-1:-1;15778:67:0;;;;;;;;-1:-1:-1;;15778:67:0;;;;;;;;;;;;:::i;:::-;;;15774:708;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16141:6;:13;16158:1;16141:18;16137:330;;16247:39;;-1:-1:-1;;;16247:39:0;;-1:-1:-1;;;;;1856:32:1;;16247:39:0;;;1838:51:1;1811:18;;16247:39:0;1692:203:1;16137:330:0;16417:6;16411:13;16402:6;16398:2;16394:15;16387:38;15774:708;-1:-1:-1;;;;;;15893:51:0;;-1:-1:-1;;;15893:51:0;15889:185;;16015:39;;-1:-1:-1;;;16015:39:0;;-1:-1:-1;;;;;1856:32:1;;16015:39:0;;;1838:51:1;1811:18;;16015:39:0;1692:203:1;15889:185:0;15846:243;15774:708;15552:948;;;;;:::o;88240:650::-;88296:13;88347:14;88364:17;88375:5;88364:10;:17::i;:::-;88384:1;88364:21;88347:38;;88400:20;88434:6;88423:18;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;88423:18:0;-1:-1:-1;88400:41:0;-1:-1:-1;88533:28:0;;;88549:2;88533:28;88590:254;-1:-1:-1;;88622:5:0;-1:-1:-1;;;88723:2:0;88712:14;;88707:32;88622:5;88694:46;88786:2;88777:11;;;-1:-1:-1;88807:21:0;88590:254;88807:21;-1:-1:-1;88865:6:0;88240:650;-1:-1:-1;;;88240:650:0:o;119969:122::-;120050:33;120059:2;120063:7;120072:4;120078;120050:8;:33::i;116366:210::-;116461:18;116467:2;116471:7;116461:5;:18::i;:::-;116490:78;17282:10;116546:1;116550:2;116554:7;116563:4;116490:33;:78::i;112386:376::-;112499:38;112513:5;112520:7;112529;112499:13;:38::i;:::-;112494:261;;-1:-1:-1;;;;;112558:19:0;;112554:190;;112605:31;;-1:-1:-1;;;112605:31:0;;;;;2529:25:1;;;2502:18;;112605:31:0;2383:177:1;112554:190:0;112684:44;;-1:-1:-1;;;112684:44:0;;-1:-1:-1;;;;;16768:32:1;;112684:44:0;;;16750:51:1;16817:18;;;16810:34;;;16723:18;;112684:44:0;16576:274:1;120279:678:0;120441:9;:31;;;-1:-1:-1;;;;;;120454:18:0;;;;120441:31;120437:471;;;120489:13;120505:22;120519:7;120505:13;:22::i;:::-;120489:38;-1:-1:-1;;;;;;120658:18:0;;;;;;:35;;;120689:4;-1:-1:-1;;;;;120680:13:0;:5;-1:-1:-1;;;;;120680:13:0;;;120658:35;:69;;;;;120698:29;120715:5;120722:4;120698:16;:29::i;:::-;120697:30;120658:69;120654:144;;;120755:27;;-1:-1:-1;;;120755:27:0;;-1:-1:-1;;;;;1856:32:1;;120755:27:0;;;1838:51:1;1811:18;;120755:27:0;1692:203:1;120654:144:0;120818:9;120814:83;;;120873:7;120869:2;-1:-1:-1;;;;;120853:28:0;120862:5;-1:-1:-1;;;;;120853:28:0;;;;;;;;;;;120814:83;120474:434;120437:471;-1:-1:-1;;120920:24:0;;;;:15;:24;;;;;:29;;-1:-1:-1;;;;;;120920:29:0;-1:-1:-1;;;;;120920:29:0;;;;;;;;;;120279:678::o;121176:318::-;-1:-1:-1;;;;;121284:22:0;;121280:93;;121330:31;;-1:-1:-1;;;121330:31:0;;-1:-1:-1;;;;;1856:32:1;;121330:31:0;;;1838:51:1;1811:18;;121330:31:0;1692:203:1;121280:93:0;-1:-1:-1;;;;;121383:25:0;;;;;;;:18;:25;;;;;;;;:35;;;;;;;;;;;;;:46;;-1:-1:-1;;121383:46:0;;;;;;;;;;121445:41;;540::1;;;121445::0;;513:18:1;121445:41:0;;;;;;;121176:318;;;:::o;81567:948::-;81620:7;;-1:-1:-1;;;81698:17:0;;81694:106;;-1:-1:-1;;;81736:17:0;;;-1:-1:-1;81782:2:0;81772:12;81694:106;81827:8;81818:5;:17;81814:106;;81865:8;81856:17;;;-1:-1:-1;81902:2:0;81892:12;81814:106;81947:8;81938:5;:17;81934:106;;81985:8;81976:17;;;-1:-1:-1;82022:2:0;82012:12;81934:106;82067:7;82058:5;:16;82054:103;;82104:7;82095:16;;;-1:-1:-1;82140:1:0;82130:11;82054:103;82184:7;82175:5;:16;82171:103;;82221:7;82212:16;;;-1:-1:-1;82257:1:0;82247:11;82171:103;82301:7;82292:5;:16;82288:103;;82338:7;82329:16;;;-1:-1:-1;82374:1:0;82364:11;82288:103;82418:7;82409:5;:16;82405:68;;82456:1;82446:11;82501:6;81567:948;-1:-1:-1;;81567:948:0:o;115339:335::-;-1:-1:-1;;;;;115407:16:0;;115403:89;;115447:33;;-1:-1:-1;;;115447:33:0;;115477:1;115447:33;;;1838:51:1;1811:18;;115447:33:0;1692:203:1;115403:89:0;115502:21;115526:32;115534:2;115538:7;115555:1;115526:7;:32::i;:::-;115502:56;-1:-1:-1;;;;;;115573:27:0;;;115569:98;;115624:31;;-1:-1:-1;;;115624:31:0;;115652:1;115624:31;;;1838:51:1;1811:18;;115624:31:0;1692:203:1;111667:276:0;111770:4;-1:-1:-1;;;;;111807:21:0;;;;;;:128;;;111855:7;-1:-1:-1;;;;;111846:16:0;:5;-1:-1:-1;;;;;111846:16:0;;:52;;;;111866:32;111883:5;111890:7;111866:16;:32::i;:::-;111846:88;;;-1:-1:-1;111288:7:0;111315:24;;;:15;:24;;;;;;-1:-1:-1;;;;;111902:32:0;;;111315:24;;111902:32;111846:88;111787:148;111667:276;-1:-1:-1;;;;111667:276:0:o;14:131:1:-;-1:-1:-1;;;;;;88:32:1;;78:43;;68:71;;135:1;132;125:12;150:245;208:6;261:2;249:9;240:7;236:23;232:32;229:52;;;277:1;274;267:12;229:52;316:9;303:23;335:30;359:5;335:30;:::i;:::-;384:5;150:245;-1:-1:-1;;;150:245:1:o;592:160::-;657:20;;713:13;;706:21;696:32;;686:60;;742:1;739;732:12;686:60;592:160;;;:::o;757:180::-;813:6;866:2;854:9;845:7;841:23;837:32;834:52;;;882:1;879;872:12;834:52;905:26;921:9;905:26;:::i;942:289::-;984:3;1022:5;1016:12;1049:6;1044:3;1037:19;1105:6;1098:4;1091:5;1087:16;1080:4;1075:3;1071:14;1065:47;1157:1;1150:4;1141:6;1136:3;1132:16;1128:27;1121:38;1220:4;1213:2;1209:7;1204:2;1196:6;1192:15;1188:29;1183:3;1179:39;1175:50;1168:57;;;942:289;;;;:::o;1236:220::-;1385:2;1374:9;1367:21;1348:4;1405:45;1446:2;1435:9;1431:18;1423:6;1405:45;:::i;1461:226::-;1520:6;1573:2;1561:9;1552:7;1548:23;1544:32;1541:52;;;1589:1;1586;1579:12;1541:52;-1:-1:-1;1634:23:1;;1461:226;-1:-1:-1;1461:226:1:o;1900:173::-;1968:20;;-1:-1:-1;;;;;2017:31:1;;2007:42;;1997:70;;2063:1;2060;2053:12;2078:300;2146:6;2154;2207:2;2195:9;2186:7;2182:23;2178:32;2175:52;;;2223:1;2220;2213:12;2175:52;2246:29;2265:9;2246:29;:::i;:::-;2236:39;2344:2;2329:18;;;;2316:32;;-1:-1:-1;;;2078:300:1:o;2565:374::-;2642:6;2650;2658;2711:2;2699:9;2690:7;2686:23;2682:32;2679:52;;;2727:1;2724;2717:12;2679:52;2750:29;2769:9;2750:29;:::i;:::-;2740:39;;2798:38;2832:2;2821:9;2817:18;2798:38;:::i;:::-;2565:374;;2788:48;;-1:-1:-1;;;2905:2:1;2890:18;;;;2877:32;;2565:374::o;2944:367::-;3007:8;3017:6;3071:3;3064:4;3056:6;3052:17;3048:27;3038:55;;3089:1;3086;3079:12;3038:55;-1:-1:-1;3112:20:1;;3155:18;3144:30;;3141:50;;;3187:1;3184;3177:12;3141:50;3224:4;3216:6;3212:17;3200:29;;3284:3;3277:4;3267:6;3264:1;3260:14;3252:6;3248:27;3244:38;3241:47;3238:67;;;3301:1;3298;3291:12;3238:67;2944:367;;;;;:::o;3316:551::-;3411:6;3419;3427;3480:2;3468:9;3459:7;3455:23;3451:32;3448:52;;;3496:1;3493;3486:12;3448:52;3536:9;3523:23;3569:18;3561:6;3558:30;3555:50;;;3601:1;3598;3591:12;3555:50;3640:70;3702:7;3693:6;3682:9;3678:22;3640:70;:::i;:::-;3729:8;;3614:96;;-1:-1:-1;3833:2:1;3818:18;;;;3805:32;;3316:551;-1:-1:-1;;;;3316:551:1:o;3872:127::-;3933:10;3928:3;3924:20;3921:1;3914:31;3964:4;3961:1;3954:15;3988:4;3985:1;3978:15;4004:716;4069:5;4101:1;4125:18;4117:6;4114:30;4111:56;;;4147:18;;:::i;:::-;-1:-1:-1;4302:2:1;4296:9;-1:-1:-1;;4215:2:1;4194:15;;4190:29;;4360:2;4348:15;4344:29;4332:42;;4425:22;;;4404:18;4389:34;;4386:62;4383:88;;;4451:18;;:::i;:::-;4487:2;4480:22;4535;;;4520:6;-1:-1:-1;4520:6:1;4572:16;;;4569:25;-1:-1:-1;4566:45:1;;;4607:1;4604;4597:12;4566:45;4657:6;4652:3;4645:4;4637:6;4633:17;4620:44;4712:1;4705:4;4696:6;4688;4684:19;4680:30;4673:41;;4004:716;;;;;:::o;4725:451::-;4794:6;4847:2;4835:9;4826:7;4822:23;4818:32;4815:52;;;4863:1;4860;4853:12;4815:52;4903:9;4890:23;4936:18;4928:6;4925:30;4922:50;;;4968:1;4965;4958:12;4922:50;4991:22;;5044:4;5036:13;;5032:27;-1:-1:-1;5022:55:1;;5073:1;5070;5063:12;5022:55;5096:74;5162:7;5157:2;5144:16;5139:2;5135;5131:11;5096:74;:::i;5181:186::-;5240:6;5293:2;5281:9;5272:7;5268:23;5264:32;5261:52;;;5309:1;5306;5299:12;5261:52;5332:29;5351:9;5332:29;:::i;5372:254::-;5437:6;5445;5498:2;5486:9;5477:7;5473:23;5469:32;5466:52;;;5514:1;5511;5504:12;5466:52;5537:29;5556:9;5537:29;:::i;:::-;5527:39;;5585:35;5616:2;5605:9;5601:18;5585:35;:::i;:::-;5575:45;;5372:254;;;;;:::o;5631:713::-;5726:6;5734;5742;5750;5803:3;5791:9;5782:7;5778:23;5774:33;5771:53;;;5820:1;5817;5810:12;5771:53;5843:29;5862:9;5843:29;:::i;:::-;5833:39;;5891:38;5925:2;5914:9;5910:18;5891:38;:::i;:::-;5881:48;-1:-1:-1;5998:2:1;5983:18;;5970:32;;-1:-1:-1;6077:2:1;6062:18;;6049:32;6104:18;6093:30;;6090:50;;;6136:1;6133;6126:12;6090:50;6159:22;;6212:4;6204:13;;6200:27;-1:-1:-1;6190:55:1;;6241:1;6238;6231:12;6190:55;6264:74;6330:7;6325:2;6312:16;6307:2;6303;6299:11;6264:74;:::i;:::-;6254:84;;;5631:713;;;;;;;:::o;6349:437::-;6435:6;6443;6496:2;6484:9;6475:7;6471:23;6467:32;6464:52;;;6512:1;6509;6502:12;6464:52;6552:9;6539:23;6585:18;6577:6;6574:30;6571:50;;;6617:1;6614;6607:12;6571:50;6656:70;6718:7;6709:6;6698:9;6694:22;6656:70;:::i;:::-;6745:8;;6630:96;;-1:-1:-1;6349:437:1;-1:-1:-1;;;;6349:437:1:o;6791:260::-;6859:6;6867;6920:2;6908:9;6899:7;6895:23;6891:32;6888:52;;;6936:1;6933;6926:12;6888:52;6959:29;6978:9;6959:29;:::i;:::-;6949:39;;7007:38;7041:2;7030:9;7026:18;7007:38;:::i;7056:380::-;7135:1;7131:12;;;;7178;;;7199:61;;7253:4;7245:6;7241:17;7231:27;;7199:61;7306:2;7298:6;7295:14;7275:18;7272:38;7269:161;;7352:10;7347:3;7343:20;7340:1;7333:31;7387:4;7384:1;7377:15;7415:4;7412:1;7405:15;7269:161;;7056:380;;;:::o;9199:127::-;9260:10;9255:3;9251:20;9248:1;9241:31;9291:4;9288:1;9281:15;9315:4;9312:1;9305:15;9331:125;9396:9;;;9417:10;;;9414:36;;;9430:18;;:::i;9837:168::-;9910:9;;;9941;;9958:15;;;9952:22;;9938:37;9928:71;;9979:18;;:::i;10358:127::-;10419:10;10414:3;10410:20;10407:1;10400:31;10450:4;10447:1;10440:15;10474:4;10471:1;10464:15;11523:518;11625:2;11620:3;11617:11;11614:421;;;11661:5;11658:1;11651:16;11705:4;11702:1;11692:18;11775:2;11763:10;11759:19;11756:1;11752:27;11746:4;11742:38;11811:4;11799:10;11796:20;11793:47;;;-1:-1:-1;11834:4:1;11793:47;11889:2;11884:3;11880:12;11877:1;11873:20;11867:4;11863:31;11853:41;;11944:81;11962:2;11955:5;11952:13;11944:81;;;12021:1;12007:16;;11988:1;11977:13;11944:81;;12217:1299;12343:3;12337:10;12370:18;12362:6;12359:30;12356:56;;;12392:18;;:::i;:::-;12421:97;12511:6;12471:38;12503:4;12497:11;12471:38;:::i;:::-;12465:4;12421:97;:::i;:::-;12567:4;12598:2;12587:14;;12615:1;12610:649;;;;13303:1;13320:6;13317:89;;;-1:-1:-1;13372:19:1;;;13366:26;13317:89;-1:-1:-1;;12174:1:1;12170:11;;;12166:24;12162:29;12152:40;12198:1;12194:11;;;12149:57;13419:81;;12580:930;;12610:649;11470:1;11463:14;;;11507:4;11494:18;;-1:-1:-1;;12646:20:1;;;12764:222;12778:7;12775:1;12772:14;12764:222;;;12860:19;;;12854:26;12839:42;;12967:4;12952:20;;;;12920:1;12908:14;;;;12794:12;12764:222;;;12768:3;13014:6;13005:7;13002:19;12999:201;;;13075:19;;;13069:26;-1:-1:-1;;13158:1:1;13154:14;;;13170:3;13150:24;13146:37;13142:42;13127:58;13112:74;;12999:201;-1:-1:-1;;;;13246:1:1;13230:14;;;13226:22;13213:36;;-1:-1:-1;12217:1299:1:o;14346:989::-;14522:3;14551:1;14584:6;14578:13;14614:36;14640:9;14614:36;:::i;:::-;14681:1;14666:17;;14692:133;;;;14839:1;14834:332;;;;14659:507;;14692:133;-1:-1:-1;;14725:24:1;;14713:37;;14798:14;;14791:22;14779:35;;14770:45;;;-1:-1:-1;14692:133:1;;14834:332;14865:6;14862:1;14855:17;14913:4;14910:1;14900:18;14940:1;14954:166;14968:6;14965:1;14962:13;14954:166;;;15048:14;;15035:11;;;15028:35;15104:1;15091:15;;;;14990:4;14983:12;14954:166;;;14958:3;;15149:6;15144:3;15140:16;15133:23;;14659:507;;;;15197:6;15191:13;15243:8;15236:4;15228:6;15224:17;15219:3;15213:39;15309:1;15271:18;;15298:13;;;15271:18;14346:989;-1:-1:-1;;;;14346:989:1:o;15700:485::-;-1:-1:-1;;;;;15931:32:1;;;15913:51;;16000:32;;15995:2;15980:18;;15973:60;16064:2;16049:18;;16042:34;;;16112:3;16107:2;16092:18;;16085:31;;;-1:-1:-1;;16133:46:1;;16159:19;;16151:6;16133:46;:::i;:::-;16125:54;15700:485;-1:-1:-1;;;;;;15700:485:1:o;16190:249::-;16259:6;16312:2;16300:9;16291:7;16287:23;16283:32;16280:52;;;16328:1;16325;16318:12;16280:52;16360:9;16354:16;16379:30;16403:5;16379:30;:::i
Swarm Source
ipfs://933ece53901e1b3858011f9cb70a7e9a015ecf7384ce7b39837a3b51771e7f17
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.