Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 1,627 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Set Approval For... | 24507298 | 13 hrs ago | IN | 0 ETH | 0.00000181 | ||||
| Set Approval For... | 24496977 | 47 hrs ago | IN | 0 ETH | 0.00000242 | ||||
| Set Approval For... | 24491087 | 2 days ago | IN | 0 ETH | 0.00004661 | ||||
| Set Approval For... | 24488476 | 3 days ago | IN | 0 ETH | 0.00000558 | ||||
| Set Approval For... | 24486622 | 3 days ago | IN | 0 ETH | 0.00000316 | ||||
| Set Approval For... | 24485553 | 3 days ago | IN | 0 ETH | 0.00001613 | ||||
| Set Approval For... | 24479648 | 4 days ago | IN | 0 ETH | 0.00000692 | ||||
| Set Approval For... | 24478586 | 4 days ago | IN | 0 ETH | 0.00000755 | ||||
| Set Approval For... | 24472914 | 5 days ago | IN | 0 ETH | 0.00000217 | ||||
| Set Approval For... | 24459435 | 7 days ago | IN | 0 ETH | 0.00000256 | ||||
| Set Approval For... | 24459341 | 7 days ago | IN | 0 ETH | 0.00000282 | ||||
| Set Approval For... | 24454769 | 7 days ago | IN | 0 ETH | 0.00009542 | ||||
| Set Approval For... | 24454180 | 7 days ago | IN | 0 ETH | 0.0000954 | ||||
| Set Approval For... | 24453775 | 8 days ago | IN | 0 ETH | 0.00004352 | ||||
| Mint | 24450976 | 8 days ago | IN | 0.00025 ETH | 0.00000101 | ||||
| Set Approval For... | 24450442 | 8 days ago | IN | 0 ETH | 0.00000724 | ||||
| Mint | 24450434 | 8 days ago | IN | 0 ETH | 0.00000174 | ||||
| Set Approval For... | 24448993 | 8 days ago | IN | 0 ETH | 0.0000292 | ||||
| Safe Transfer Fr... | 24442854 | 9 days ago | IN | 0 ETH | 0.00000562 | ||||
| Set Approval For... | 24442353 | 9 days ago | IN | 0 ETH | 0.00000655 | ||||
| Set Approval For... | 24441774 | 9 days ago | IN | 0 ETH | 0.00002036 | ||||
| Set Approval For... | 24441196 | 9 days ago | IN | 0 ETH | 0.00003413 | ||||
| Set Approval For... | 24440946 | 9 days ago | IN | 0 ETH | 0.00006449 | ||||
| Set Approval For... | 24439708 | 9 days ago | IN | 0 ETH | 0.00000238 | ||||
| Set Approval For... | 24439412 | 10 days ago | IN | 0 ETH | 0.00010174 |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
Planet8004
Compiler Version
v0.8.20+commit.a1b79de6
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2026-02-07
*/
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)
pragma solidity >=0.4.16;
/**
* @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.4.0) (token/ERC721/IERC721.sol)
pragma solidity >=0.6.2;
/**
* @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.4.0) (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity >=0.6.2;
/**
* @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.4.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity >=0.5.0;
/**
* @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.4.0) (interfaces/draft-IERC6093.sol)
pragma solidity >=0.8.4;
/**
* @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.4.0) (token/ERC721/utils/ERC721Utils.sol)
pragma solidity ^0.8.20;
/**
* @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 {IERC721Receiver-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(reason, 0x20), mload(reason))
}
}
}
}
}
}
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
// File: @openzeppelin/contracts/utils/Panic.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)
pragma solidity ^0.8.20;
/**
* @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.20;
/**
* @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.3.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @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 Return the 512-bit addition of two uint256.
*
* The result is stored in two 256 variables such that sum = high * 2²⁵⁶ + low.
*/
function add512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {
assembly ("memory-safe") {
low := add(a, b)
high := lt(low, a)
}
}
/**
* @dev Return the 512-bit multiplication of two uint256.
*
* The result is stored in two 256 variables such that product = high * 2²⁵⁶ + low.
*/
function mul512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {
// 512-bit multiply [high low] = 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 = high * 2²⁵⁶ + low.
assembly ("memory-safe") {
let mm := mulmod(a, b, not(0))
low := mul(a, b)
high := sub(sub(mm, low), lt(mm, low))
}
}
/**
* @dev Returns the addition of two unsigned integers, with a success flag (no overflow).
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
uint256 c = a + b;
success = c >= a;
result = c * SafeCast.toUint(success);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with a success flag (no overflow).
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
uint256 c = a - b;
success = c <= a;
result = c * SafeCast.toUint(success);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with a success flag (no overflow).
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
uint256 c = a * b;
assembly ("memory-safe") {
// Only true when the multiplication doesn't overflow
// (c / a == b) || (a == 0)
success := or(eq(div(c, a), b), iszero(a))
}
// equivalent to: success ? c : 0
result = c * SafeCast.toUint(success);
}
}
/**
* @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 {
success = b > 0;
assembly ("memory-safe") {
// The `DIV` opcode returns zero when the denominator is 0.
result := div(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 {
success = b > 0;
assembly ("memory-safe") {
// The `MOD` opcode returns zero when the denominator is 0.
result := mod(a, b)
}
}
}
/**
* @dev Unsigned saturating addition, bounds to `2²⁵⁶ - 1` instead of overflowing.
*/
function saturatingAdd(uint256 a, uint256 b) internal pure returns (uint256) {
(bool success, uint256 result) = tryAdd(a, b);
return ternary(success, result, type(uint256).max);
}
/**
* @dev Unsigned saturating subtraction, bounds to zero instead of overflowing.
*/
function saturatingSub(uint256 a, uint256 b) internal pure returns (uint256) {
(, uint256 result) = trySub(a, b);
return result;
}
/**
* @dev Unsigned saturating multiplication, bounds to `2²⁵⁶ - 1` instead of overflowing.
*/
function saturatingMul(uint256 a, uint256 b) internal pure returns (uint256) {
(bool success, uint256 result) = tryMul(a, b);
return ternary(success, result, type(uint256).max);
}
/**
* @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 {
(uint256 high, uint256 low) = mul512(x, y);
// Handle non-overflow cases, 256 by 256 division.
if (high == 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 low / denominator;
}
// Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.
if (denominator <= high) {
Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));
}
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [high low].
uint256 remainder;
assembly ("memory-safe") {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
high := sub(high, gt(remainder, low))
low := sub(low, 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 ("memory-safe") {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [high low] by twos.
low := div(low, 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 high into low.
low |= high * 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 high
// is no longer required.
result = low * 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 Calculates floor(x * y >> n) with full precision. Throws if result overflows a uint256.
*/
function mulShr(uint256 x, uint256 y, uint8 n) internal pure returns (uint256 result) {
unchecked {
(uint256 high, uint256 low) = mul512(x, y);
if (high >= 1 << n) {
Panic.panic(Panic.UNDER_OVERFLOW);
}
return (high << (256 - n)) | (low >> n);
}
}
/**
* @dev Calculates x * y >> n with full precision, following the selected rounding direction.
*/
function mulShr(uint256 x, uint256 y, uint8 n, Rounding rounding) internal pure returns (uint256) {
return mulShr(x, y, n) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, 1 << n) > 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 x) internal pure returns (uint256 r) {
// If value has upper 128 bits set, log2 result is at least 128
r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;
// If upper 64 bits of 128-bit half set, add 64 to result
r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;
// If upper 32 bits of 64-bit half set, add 32 to result
r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;
// If upper 16 bits of 32-bit half set, add 16 to result
r |= SafeCast.toUint((x >> r) > 0xffff) << 4;
// If upper 8 bits of 16-bit half set, add 8 to result
r |= SafeCast.toUint((x >> r) > 0xff) << 3;
// If upper 4 bits of 8-bit half set, add 4 to result
r |= SafeCast.toUint((x >> r) > 0xf) << 2;
// Shifts value right by the current result and use it as an index into this lookup table:
//
// | x (4 bits) | index | table[index] = MSB position |
// |------------|---------|-----------------------------|
// | 0000 | 0 | table[0] = 0 |
// | 0001 | 1 | table[1] = 0 |
// | 0010 | 2 | table[2] = 1 |
// | 0011 | 3 | table[3] = 1 |
// | 0100 | 4 | table[4] = 2 |
// | 0101 | 5 | table[5] = 2 |
// | 0110 | 6 | table[6] = 2 |
// | 0111 | 7 | table[7] = 2 |
// | 1000 | 8 | table[8] = 3 |
// | 1001 | 9 | table[9] = 3 |
// | 1010 | 10 | table[10] = 3 |
// | 1011 | 11 | table[11] = 3 |
// | 1100 | 12 | table[12] = 3 |
// | 1101 | 13 | table[13] = 3 |
// | 1110 | 14 | table[14] = 3 |
// | 1111 | 15 | table[15] = 3 |
//
// The lookup table is represented as a 32-byte value with the MSB positions for 0-15 in the last 16 bytes.
assembly ("memory-safe") {
r := or(r, byte(shr(r, x), 0x0000010102020202030303030303030300000000000000000000000000000000))
}
}
/**
* @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 x) internal pure returns (uint256 r) {
// If value has upper 128 bits set, log2 result is at least 128
r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;
// If upper 64 bits of 128-bit half set, add 64 to result
r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;
// If upper 32 bits of 64-bit half set, add 32 to result
r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;
// If upper 16 bits of 32-bit half set, add 16 to result
r |= SafeCast.toUint((x >> r) > 0xffff) << 4;
// Add 1 if upper 8 bits of 16-bit half set, and divide accumulated result by 8
return (r >> 3) | SafeCast.toUint((x >> r) > 0xff);
}
/**
* @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.20;
/**
* @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.4.0) (utils/Strings.sol)
pragma solidity ^0.8.20;
/**
* @dev String operations.
*/
library Strings {
using SafeCast for *;
bytes16 private constant HEX_DIGITS = "0123456789abcdef";
uint8 private constant ADDRESS_LENGTH = 20;
uint256 private constant SPECIAL_CHARS_LOOKUP =
(1 << 0x08) | // backspace
(1 << 0x09) | // tab
(1 << 0x0a) | // newline
(1 << 0x0c) | // form feed
(1 << 0x0d) | // carriage return
(1 << 0x22) | // double quote
(1 << 0x5c); // backslash
/**
* @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(add(buffer, 0x20), 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-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 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-string-uint256-uint256} 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-string-uint256-uint256} 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-string} 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-string-uint256-uint256} 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 guarantees 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-string} 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-string} 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-string-uint256-uint256} 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 Escape special characters in JSON strings. This can be useful to prevent JSON injection in NFT metadata.
*
* WARNING: This function should only be used in double quoted JSON strings. Single quotes are not escaped.
*
* NOTE: This function escapes all unicode characters, and not just the ones in ranges defined in section 2.5 of
* RFC-4627 (U+0000 to U+001F, U+0022 and U+005C). ECMAScript's `JSON.parse` does recover escaped unicode
* characters that are not in this range, but other tooling may provide different results.
*/
function escapeJSON(string memory input) internal pure returns (string memory) {
bytes memory buffer = bytes(input);
bytes memory output = new bytes(2 * buffer.length); // worst case scenario
uint256 outputLength = 0;
for (uint256 i; i < buffer.length; ++i) {
bytes1 char = bytes1(_unsafeReadBytesOffset(buffer, i));
if (((SPECIAL_CHARS_LOOKUP & (1 << uint8(char))) != 0)) {
output[outputLength++] = "\\";
if (char == 0x08) output[outputLength++] = "b";
else if (char == 0x09) output[outputLength++] = "t";
else if (char == 0x0a) output[outputLength++] = "n";
else if (char == 0x0c) output[outputLength++] = "f";
else if (char == 0x0d) output[outputLength++] = "r";
else if (char == 0x5c) output[outputLength++] = "\\";
else if (char == 0x22) {
// solhint-disable-next-line quotes
output[outputLength++] = '"';
}
} else {
output[outputLength++] = char;
}
}
// write the actual length and deallocate unused memory
assembly ("memory-safe") {
mstore(output, outputLength)
mstore(0x40, add(output, shl(5, shr(5, add(outputLength, 63)))))
}
return string(output);
}
/**
* @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(add(buffer, 0x20), offset))
}
}
}
// File: @openzeppelin/contracts/utils/introspection/ERC165.sol
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
/**
* @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 {
/// @inheritdoc IERC165
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.4.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.20;
/**
* @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_;
}
/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/// @inheritdoc IERC721
function balanceOf(address owner) public view virtual returns (uint256) {
if (owner == address(0)) {
revert ERC721InvalidOwner(address(0));
}
return _balances[owner];
}
/// @inheritdoc IERC721
function ownerOf(uint256 tokenId) public view virtual returns (address) {
return _requireOwned(tokenId);
}
/// @inheritdoc IERC721Metadata
function name() public view virtual returns (string memory) {
return _name;
}
/// @inheritdoc IERC721Metadata
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/// @inheritdoc IERC721Metadata
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 "";
}
/// @inheritdoc IERC721
function approve(address to, uint256 tokenId) public virtual {
_approve(to, tokenId, _msgSender());
}
/// @inheritdoc IERC721
function getApproved(uint256 tokenId) public view virtual returns (address) {
_requireOwned(tokenId);
return _getApproved(tokenId);
}
/// @inheritdoc IERC721
function setApprovalForAll(address operator, bool approved) public virtual {
_setApprovalForAll(_msgSender(), operator, approved);
}
/// @inheritdoc IERC721
function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {
return _operatorApprovals[owner][operator];
}
/// @inheritdoc IERC721
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);
}
}
/// @inheritdoc IERC721
function safeTransferFrom(address from, address to, uint256 tokenId) public {
safeTransferFrom(from, to, tokenId, "");
}
/// @inheritdoc IERC721
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.20;
/**
* @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: Planet8004_fixed.sol
pragma solidity ^0.8.20;
interface IERC721Balance {
function balanceOf(address owner) external view returns (uint256);
}
interface IPlanet8004Renderer {
function renderMetadata(uint256 tokenId, uint256[7] memory traits, string memory endpoint) external view returns (string memory);
}
contract Planet8004 is ERC721, Ownable {
uint256 public constant MAX_SUPPLY = 888;
uint256 public constant DEV_RESERVE = 44;
uint256 public totalMinted;
uint256 public allowlistPrice = 0.0015 ether;
uint256 public publicPrice = 0.003 ether;
bool public devMinted = false;
string public agentServiceEndpoint = "https://planet8004.com/agent/";
address public renderer;
// Blue-chip NFT collection contracts for holder-based allowlist
address[] public allowlistCollections;
mapping(address => bool) public isAllowlistCollection;
mapping(address => uint256) public mintedPerWallet;
event AgentRegistered(uint256 indexed tokenId, address indexed owner);
constructor(address _renderer) ERC721("Planet8004", "P8004") Ownable(msg.sender) {
renderer = _renderer;
// Blue-chip NFT collections — holders get allowlist price
address[28] memory collections = [
0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D, // BAYC
0x60E4d786628Fea6478F785A6d7e704777c86a7c6, // MAYC
0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB, // CryptoPunks
0xED5AF388653567Af2F388E6224dC7C4b3241C544, // Azuki
0xBd3531dA5CF5857e7CfAA92426877b022e612cf8, // Pudgy Penguins
0x8a90CAb2b38dba80c64b7734e58Ee1dB38B8992e, // Doodles
0xa7d8d9ef8D8Ce8992Df33D8b8CF4Aebabd5bD270, // Art Blocks
0x79FCDEF22feeD20eDDacbB2587640e45491b757f, // Mfers
0xD4B7D9bb20fA20dDADa9eCEf8a7355ca983cCCB1, // Meebits (check)
0xa3AEe8BcE55BEeA1951EF834b99f3Ac60d1ABeeB, // VeeFriends
0x23581767a106ae21c074b2276D25e5C3e136a68b, // Moonbirds
0x1A92f7381B9F03921564a437210bB9396471050C, // Cool Cats
0x5Af0D9827E0c53E4799BB226655A1de152A425a5, // Milady
0x7Bd29408f11D2bFC23c34f18275bBf23bB716Bc7, // Penguin
0x42069ABFE407C60cf4ae4112bEDEaD391dBa1cdB, // CryptoDickButts
0x209e639a0EC166Ac7a1A4bA41968fa967dB30221, // Checks
0x2acAb3DEa77832C09420663b0E1cB386031bA17B, // DeGods
0xc3f733ca98E0daD0386979Eb96fb1722A1A05E69, // Moon Boyz
0xbCe3781ae7Ca1a5e050Bd9C4c77369867eBc307e, // Goblintown
0x3bf2922f4520a8BA0c2eFC3D2a1539678DaD5e9D, // 0N1 Force
0x364C828eE171616a39897688A831c2499aD972ec, // Wrapped Strikers
0xd774557b647330C91Bf44cfEAB205095f7E6c367, // Nakamigos
0x1CB1A5e65610AEFF2551A50f76a87a7d3fB649C6, // CrypToadz
0x59325733eb952a92e069C87F0A6168b29E80627f, // CloneX (fragment)
0xe785E82358879F061BC3dcAC6f0444462D4b5330, // World of Women
0xC2C747E0F7004F9E8817Db2ca4997657a7746928, // Hashmasks
0x80336Ad7A747236ef41F47ed2C7641828a480BAA, // Otherdeed
0x0D0167A823C6619D430B1a96aD85B888bcF97C37 // Fidenza / AB (check)
];
for (uint256 i = 0; i < collections.length; i++) {
allowlistCollections.push(collections[i]);
isAllowlistCollection[collections[i]] = true;
}
}
// --- Allowlist check: returns true if minter holds any blue-chip NFT ---
function isAllowlisted(address minter) public view returns (bool) {
for (uint256 i = 0; i < allowlistCollections.length; i++) {
// Use low-level call to handle non-standard contracts (e.g. CryptoPunks)
(bool success, bytes memory data) = allowlistCollections[i].staticcall(
abi.encodeWithSelector(IERC721Balance.balanceOf.selector, minter)
);
if (success && data.length >= 32) {
uint256 balance = abi.decode(data, (uint256));
if (balance > 0) return true;
}
}
return false;
}
// --- Trait generation (unchanged) ---
function hash(uint256 id, uint256 idx) internal pure returns (uint256) {
return uint256(keccak256(abi.encodePacked("PLANET8004", id, idx)));
}
function getSpecies(uint256 id) public pure returns (uint256) {
uint256 r = hash(id, 0) % 10000;
if (r < 100) return 17; // Synth - 1%
if (r < 320) return 16; // Cyborg - 2.2%
if (r < 680) return 0; // T-800 - 3.6%
if (r < 1100) return 15; // Prototype - 4.2%
if (r < 1600) return 14; // Viper - 5%
if (r < 2100) return 13; // Warbot - 5%
if (r < 2600) return 12; // Guardian - 5%
if (r < 3200) return 11; // Colossus - 6%
if (r < 3800) return 10; // Titan - 6%
if (r < 4400) return 9; // Enforcer - 6%
if (r < 5000) return 8; // Destroyer - 6%
if (r < 5700) return 7; // Robocop - 7%
if (r < 6400) return 6; // Atlas - 7%
if (r < 7100) return 5; // Ultron - 7%
if (r < 7900) return 4; // Bender - 8%
if (r < 8700) return 3; // Optimus - 8%
if (r < 9500) return 2; // Megatron - 8%
return 1; // Sentinel - 5%
}
function getTraits(uint256 id) public pure returns (uint256[7] memory) {
return [
getSpecies(id),
hash(id, 1) % 10,
hash(id, 2) % 14,
hash(id, 3) % 13,
hash(id, 4) % 10,
hash(id, 5) % 10,
hash(id, 6) % 6
];
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
require(ownerOf(tokenId) != address(0), "Token does not exist");
return IPlanet8004Renderer(renderer).renderMetadata(tokenId, getTraits(tokenId), agentServiceEndpoint);
}
// --- Minting ---
function devMint() external onlyOwner {
require(!devMinted, "Dev already minted");
require(totalMinted + DEV_RESERVE <= MAX_SUPPLY, "Exceeds max supply");
devMinted = true;
for (uint256 i = 0; i < DEV_RESERVE; i++) {
totalMinted++;
_safeMint(msg.sender, totalMinted);
emit AgentRegistered(totalMinted, msg.sender);
}
}
function mint() external payable {
require(devMinted, "Dev mint not done yet");
require(totalMinted < MAX_SUPPLY, "Max supply reached");
require(mintedPerWallet[msg.sender] < 1, "Already minted");
uint256 price = isAllowlisted(msg.sender) ? allowlistPrice : publicPrice;
require(msg.value >= price, "Insufficient payment");
totalMinted++;
mintedPerWallet[msg.sender]++;
_safeMint(msg.sender, totalMinted);
emit AgentRegistered(totalMinted, msg.sender);
if (msg.value > price) {
(bool success, ) = payable(msg.sender).call{value: msg.value - price}("");
require(success, "Refund failed");
}
}
// --- Owner functions ---
function addAllowlistCollection(address collection) external onlyOwner {
require(!isAllowlistCollection[collection], "Already added");
allowlistCollections.push(collection);
isAllowlistCollection[collection] = true;
}
function removeAllowlistCollection(address collection) external onlyOwner {
require(isAllowlistCollection[collection], "Not in list");
isAllowlistCollection[collection] = false;
// Remove from array
for (uint256 i = 0; i < allowlistCollections.length; i++) {
if (allowlistCollections[i] == collection) {
allowlistCollections[i] = allowlistCollections[allowlistCollections.length - 1];
allowlistCollections.pop();
break;
}
}
}
function setRenderer(address _renderer) external onlyOwner {
renderer = _renderer;
}
function setAgentEndpoint(string memory newEndpoint) external onlyOwner {
agentServiceEndpoint = newEndpoint;
}
function setAllowlistPrice(uint256 newPrice) external onlyOwner {
allowlistPrice = newPrice;
}
function setPublicPrice(uint256 newPrice) external onlyOwner {
publicPrice = newPrice;
}
function withdraw() external onlyOwner {
(bool success, ) = payable(owner()).call{value: address(this).balance}("");
require(success, "Withdrawal failed");
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_renderer","type":"address"}],"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":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"AgentRegistered","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":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DEV_RESERVE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"}],"name":"addAllowlistCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"agentServiceEndpoint","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"allowlistCollections","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowlistPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"devMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"devMinted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getSpecies","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getTraits","outputs":[{"internalType":"uint256[7]","name":"","type":"uint256[7]"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isAllowlistCollection","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"isAllowlisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"mintedPerWallet","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":"publicPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"}],"name":"removeAllowlistCollection","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renderer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newEndpoint","type":"string"}],"name":"setAgentEndpoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setAllowlistPrice","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":"uint256","name":"newPrice","type":"uint256"}],"name":"setPublicPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_renderer","type":"address"}],"name":"setRenderer","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":"totalMinted","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":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
6605543df729c000600855660aa87bee538000600955600a805460ff1916905560c0604052601d60809081527f68747470733a2f2f706c616e6574383030342e636f6d2f6167656e742f00000060a052600b906200005e9082620005ef565b503480156200006b575f80fd5b5060405162002949380380620029498339810160408190526200008e91620006b7565b336040518060400160405280600a815260200169141b185b995d0e0c0c0d60b21b81525060405180604001604052806005815260200164140e0c0c0d60da1b815250815f9081620000e09190620005ef565b506001620000ef8282620005ef565b5050506001600160a01b0381166200012057604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6200012b81620004fe565b50600c80546001600160a01b0319166001600160a01b038316179055604080516103808101825273bc4ca0eda7647a8ab7c2061c2e118a18a936f13d81527360e4d786628fea6478f785a6d7e704777c86a7c6602082015273b47e3cd837ddf8e4c57f05d70ab865de6e193bbb9181019190915273ed5af388653567af2f388e6224dc7c4b3241c544606082015273bd3531da5cf5857e7cfaa92426877b022e612cf86080820152738a90cab2b38dba80c64b7734e58ee1db38b8992e60a082015273a7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd27060c08201527379fcdef22feed20eddacbb2587640e45491b757f60e082015273d4b7d9bb20fa20ddada9ecef8a7355ca983cccb161010082015273a3aee8bce55beea1951ef834b99f3ac60d1abeeb6101208201527323581767a106ae21c074b2276d25e5c3e136a68b610140820152731a92f7381b9f03921564a437210bb9396471050c610160820152735af0d9827e0c53e4799bb226655a1de152a425a5610180820152737bd29408f11d2bfc23c34f18275bbf23bb716bc76101a08201527342069abfe407c60cf4ae4112bedead391dba1cdb6101c082015273209e639a0ec166ac7a1a4ba41968fa967db302216101e0820152732acab3dea77832c09420663b0e1cb386031ba17b61020082015273c3f733ca98e0dad0386979eb96fb1722a1a05e6961022082015273bce3781ae7ca1a5e050bd9c4c77369867ebc307e610240820152733bf2922f4520a8ba0c2efc3d2a1539678dad5e9d61026082015273364c828ee171616a39897688a831c2499ad972ec61028082015273d774557b647330c91bf44cfeab205095f7e6c3676102a0820152731cb1a5e65610aeff2551a50f76a87a7d3fb649c66102c08201527359325733eb952a92e069c87f0a6168b29e80627f6102e082015273e785e82358879f061bc3dcac6f0444462d4b533061030082015273c2c747e0f7004f9e8817db2ca4997657a77469286103208201527380336ad7a747236ef41f47ed2c7641828a480baa610340820152730d0167a823c6619d430b1a96ad85b888bcf97c376103608201525f5b601c811015620004f557600d8282601c8110620004605762000460620006e6565b602090810291909101518254600180820185555f9485529284200180546001600160a01b0319166001600160a01b0390921691909117905590600e908484601c8110620004b157620004b1620006e6565b602090810291909101516001600160a01b031682528101919091526040015f20805460ff191691151591909117905580620004ec81620006fa565b9150506200043f565b5050506200071f565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b634e487b7160e01b5f52604160045260245ffd5b600181811c908216806200057857607f821691505b6020821081036200059757634e487b7160e01b5f52602260045260245ffd5b50919050565b601f821115620005ea575f81815260208120601f850160051c81016020861015620005c55750805b601f850160051c820191505b81811015620005e657828155600101620005d1565b5050505b505050565b81516001600160401b038111156200060b576200060b6200054f565b62000623816200061c845462000563565b846200059d565b602080601f83116001811462000659575f8415620006415750858301515b5f19600386901b1c1916600185901b178555620005e6565b5f85815260208120601f198616915b82811015620006895788860151825594840194600190910190840162000668565b5085821015620006a757878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f60208284031215620006c8575f80fd5b81516001600160a01b0381168114620006df575f80fd5b9392505050565b634e487b7160e01b5f52603260045260245ffd5b5f600182016200071857634e487b7160e01b5f52601160045260245ffd5b5060010190565b61221c806200072d5f395ff3fe608060405260043610610228575f3560e01c806370a0823111610129578063a945bf80116100a8578063c87b56dd1161006d578063c87b56dd1461061b578063e1dc07611461063a578063e985e9c514610666578063f2fde38b14610685578063f48a2e03146106a4575f80fd5b8063a945bf8014610590578063adf2131b146105a5578063b88d4fde146105be578063c2e31e39146105dd578063c6275255146105fc575f80fd5b806390967a52116100ee57806390967a521461051457806395d89b4114610529578063a22cb4651461053d578063a2309ff81461055c578063a8d0b1f214610571575f80fd5b806370a0823114610491578063715018a6146104b05780637c69e207146104c45780638ada6b0f146104d85780638da5cb5b146104f7575f80fd5b8063255083f0116101b55780633ccfd60b1161017a5780633ccfd60b1461040157806342842e0e146104155780635229c0661461043457806356d3163d146104535780636352211e14610472575f80fd5b8063255083f0146103615780632be6a2a91461038057806332cb6b0c146103ad57806334df1f7c146103c25780633a602b4d146103d6575f80fd5b8063095ea7b3116101fb578063095ea7b3146102d75780630b3d8362146102f85780631249c58b1461030c5780631da8586d1461031457806323b872dd14610342575f80fd5b806301ffc9a71461022c57806305a3b8091461026057806306fdde031461027f578063081812fc146102a0575b5f80fd5b348015610237575f80fd5b5061024b610246366004611b50565b6106c3565b60405190151581526020015b60405180910390f35b34801561026b575f80fd5b5061024b61027a366004611b8d565b610714565b34801561028a575f80fd5b50610293610833565b6040516102579190611bf3565b3480156102ab575f80fd5b506102bf6102ba366004611c05565b6108c2565b6040516001600160a01b039091168152602001610257565b3480156102e2575f80fd5b506102f66102f1366004611c1c565b6108e9565b005b348015610303575f80fd5b506102936108f8565b6102f6610984565b34801561031f575f80fd5b5061024b61032e366004611b8d565b600e6020525f908152604090205460ff1681565b34801561034d575f80fd5b506102f661035c366004611c44565b610bd0565b34801561036c575f80fd5b506102bf61037b366004611c05565b610c59565b34801561038b575f80fd5b5061039f61039a366004611c05565b610c81565b604051908152602001610257565b3480156103b8575f80fd5b5061039f61037881565b3480156103cd575f80fd5b5061039f602c81565b3480156103e1575f80fd5b5061039f6103f0366004611b8d565b600f6020525f908152604090205481565b34801561040c575f80fd5b506102f6610de6565b348015610420575f80fd5b506102f661042f366004611c44565b610e92565b34801561043f575f80fd5b506102f661044e366004611b8d565b610eb1565b34801561045e575f80fd5b506102f661046d366004611b8d565b610f77565b34801561047d575f80fd5b506102bf61048c366004611c05565b610fa1565b34801561049c575f80fd5b5061039f6104ab366004611b8d565b610fab565b3480156104bb575f80fd5b506102f6610ff0565b3480156104cf575f80fd5b506102f6611003565b3480156104e3575f80fd5b50600c546102bf906001600160a01b031681565b348015610502575f80fd5b506006546001600160a01b03166102bf565b34801561051f575f80fd5b5061039f60085481565b348015610534575f80fd5b50610293611120565b348015610548575f80fd5b506102f6610557366004611c7d565b61112f565b348015610567575f80fd5b5061039f60075481565b34801561057c575f80fd5b506102f661058b366004611d5d565b61113a565b34801561059b575f80fd5b5061039f60095481565b3480156105b0575f80fd5b50600a5461024b9060ff1681565b3480156105c9575f80fd5b506102f66105d8366004611da2565b61114e565b3480156105e8575f80fd5b506102f66105f7366004611b8d565b611166565b348015610607575f80fd5b506102f6610616366004611c05565b6112e0565b348015610626575f80fd5b50610293610635366004611c05565b6112ed565b348015610645575f80fd5b50610659610654366004611c05565b6113c2565b6040516102579190611e3b565b348015610671575f80fd5b5061024b610680366004611e49565b61148e565b348015610690575f80fd5b506102f661069f366004611b8d565b6114bb565b3480156106af575f80fd5b506102f66106be366004611c05565b6114f5565b5f6001600160e01b031982166380ac58cd60e01b14806106f357506001600160e01b03198216635b5e139f60e01b145b8061070e57506301ffc9a760e01b6001600160e01b03198316145b92915050565b5f805b600d5481101561082b575f80600d838154811061073657610736611e7a565b5f9182526020918290200154604080516001600160a01b03898116602480840191909152835180840390910181526044909201835293810180516001600160e01b03166370a0823160e01b179052905192909116916107959190611e8e565b5f60405180830381855afa9150503d805f81146107cd576040519150601f19603f3d011682016040523d82523d5f602084013e6107d2565b606091505b50915091508180156107e657506020815110155b15610816575f818060200190518101906108009190611ea9565b905080156108145750600195945050505050565b505b5050808061082390611ed4565b915050610717565b505f92915050565b60605f805461084190611eec565b80601f016020809104026020016040519081016040528092919081815260200182805461086d90611eec565b80156108b85780601f1061088f576101008083540402835291602001916108b8565b820191905f5260205f20905b81548152906001019060200180831161089b57829003601f168201915b5050505050905090565b5f6108cc82611502565b505f828152600460205260409020546001600160a01b031661070e565b6108f482823361153a565b5050565b600b805461090590611eec565b80601f016020809104026020016040519081016040528092919081815260200182805461093190611eec565b801561097c5780601f106109535761010080835404028352916020019161097c565b820191905f5260205f20905b81548152906001019060200180831161095f57829003601f168201915b505050505081565b600a5460ff166109d35760405162461bcd60e51b815260206004820152601560248201527411195d881b5a5b9d081b9bdd08191bdb99481e595d605a1b60448201526064015b60405180910390fd5b61037860075410610a1b5760405162461bcd60e51b815260206004820152601260248201527113585e081cdd5c1c1b1e481c995858da195960721b60448201526064016109ca565b335f908152600f6020526040902054600111610a6a5760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e481b5a5b9d195960921b60448201526064016109ca565b5f610a7433610714565b610a8057600954610a84565b6008545b905080341015610acd5760405162461bcd60e51b8152602060048201526014602482015273125b9cdd59999a58da595b9d081c185e5b595b9d60621b60448201526064016109ca565b60078054905f610adc83611ed4565b9091555050335f908152600f60205260408120805491610afb83611ed4565b9190505550610b0c33600754611547565b6007546040513391907fba9d3be5149ecab5ff8e380633795e5d9153c2f0e1ec952dd1de4611d661c9f5905f90a380341115610bcd575f33610b4e8334611f24565b6040515f81818185875af1925050503d805f8114610b87576040519150601f19603f3d011682016040523d82523d5f602084013e610b8c565b606091505b50509050806108f45760405162461bcd60e51b815260206004820152600d60248201526c1499599d5b990819985a5b1959609a1b60448201526064016109ca565b50565b6001600160a01b038216610bf957604051633250574960e11b81525f60048201526024016109ca565b5f610c05838333611560565b9050836001600160a01b0316816001600160a01b031614610c53576040516364283d7b60e01b81526001600160a01b03808616600483015260248201849052821660448201526064016109ca565b50505050565b600d8181548110610c68575f80fd5b5f918252602090912001546001600160a01b0316905081565b5f80612710610c90845f611652565b610c9a9190611f37565b90506064811015610cae5750601192915050565b610140811015610cc15750601092915050565b6102a8811015610cd357505f92915050565b61044c811015610ce65750600f92915050565b610640811015610cf95750600e92915050565b610834811015610d0c5750600d92915050565b610a28811015610d1f5750600c92915050565b610c80811015610d325750600b92915050565b610ed8811015610d455750600a92915050565b611130811015610d585750600992915050565b611388811015610d6b5750600892915050565b611644811015610d7e5750600792915050565b611900811015610d915750600692915050565b611bbc811015610da45750600592915050565b611edc811015610db75750600492915050565b6121fc811015610dca5750600392915050565b61251c811015610ddd5750600292915050565b50600192915050565b610dee611695565b5f610e016006546001600160a01b031690565b6001600160a01b0316476040515f6040518083038185875af1925050503d805f8114610e48576040519150601f19603f3d011682016040523d82523d5f602084013e610e4d565b606091505b5050905080610bcd5760405162461bcd60e51b815260206004820152601160248201527015da5d1a191c985dd85b0819985a5b1959607a1b60448201526064016109ca565b610eac83838360405180602001604052805f81525061114e565b505050565b610eb9611695565b6001600160a01b0381165f908152600e602052604090205460ff1615610f115760405162461bcd60e51b815260206004820152600d60248201526c105b1c9958591e481859191959609a1b60448201526064016109ca565b600d805460018181019092557fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50180546001600160a01b039093166001600160a01b0319909316831790555f918252600e6020526040909120805460ff19169091179055565b610f7f611695565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b5f61070e82611502565b5f6001600160a01b038216610fd5576040516322718ad960e21b81525f60048201526024016109ca565b506001600160a01b03165f9081526003602052604090205490565b610ff8611695565b6110015f6116c2565b565b61100b611695565b600a5460ff16156110535760405162461bcd60e51b815260206004820152601260248201527111195d88185b1c9958591e481b5a5b9d195960721b60448201526064016109ca565b610378602c6007546110659190611f56565b11156110a85760405162461bcd60e51b815260206004820152601260248201527145786365656473206d617820737570706c7960701b60448201526064016109ca565b600a805460ff191660011790555f5b602c811015610bcd5760078054905f6110cf83611ed4565b91905055506110e033600754611547565b6007546040513391907fba9d3be5149ecab5ff8e380633795e5d9153c2f0e1ec952dd1de4611d661c9f5905f90a38061111881611ed4565b9150506110b7565b60606001805461084190611eec565b6108f4338383611713565b611142611695565b600b6108f48282611fae565b611159848484610bd0565b610c5333858585856117b1565b61116e611695565b6001600160a01b0381165f908152600e602052604090205460ff166111c35760405162461bcd60e51b815260206004820152600b60248201526a139bdd081a5b881b1a5cdd60aa1b60448201526064016109ca565b6001600160a01b0381165f908152600e60205260408120805460ff191690555b600d548110156108f457816001600160a01b0316600d828154811061120a5761120a611e7a565b5f918252602090912001546001600160a01b0316036112ce57600d805461123390600190611f24565b8154811061124357611243611e7a565b5f91825260209091200154600d80546001600160a01b03909216918390811061126e5761126e611e7a565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550600d8054806112aa576112aa61206a565b5f8281526020902081015f1990810180546001600160a01b03191690550190555050565b806112d881611ed4565b9150506111e3565b6112e8611695565b600955565b60605f6112f983610fa1565b6001600160a01b0316036113465760405162461bcd60e51b8152602060048201526014602482015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b60448201526064016109ca565b600c546001600160a01b031663bcce959183611361816113c2565b600b6040518463ffffffff1660e01b81526004016113819392919061207e565b5f60405180830381865afa15801561139b573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f1916820160405261070e919081019061211d565b6113ca611b1d565b6040518060e001604052806113de84610c81565b8152602001600a6113f0856001611652565b6113fa9190611f37565b8152602001600e61140c856002611652565b6114169190611f37565b8152602001600d611428856003611652565b6114329190611f37565b8152602001600a611444856004611652565b61144e9190611f37565b8152602001600a611460856005611652565b61146a9190611f37565b8152602001600661147c856006611652565b6114869190611f37565b905292915050565b6001600160a01b039182165f90815260056020908152604080832093909416825291909152205460ff1690565b6114c3611695565b6001600160a01b0381166114ec57604051631e4fbdf760e01b81525f60048201526024016109ca565b610bcd816116c2565b6114fd611695565b600855565b5f818152600260205260408120546001600160a01b03168061070e57604051637e27328960e01b8152600481018490526024016109ca565b610eac83838360016118d9565b6108f4828260405180602001604052805f8152506119dd565b5f828152600260205260408120546001600160a01b039081169083161561158c5761158c8184866119f4565b6001600160a01b038116156115c6576115a75f855f806118d9565b6001600160a01b0381165f90815260036020526040902080545f190190555b6001600160a01b038516156115f4576001600160a01b0385165f908152600360205260409020805460010190555b5f8481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b60408051691413105391550e0c0c0d60b21b602080830191909152602a820194909452604a8082019390935281518082039093018352606a019052805191012090565b6006546001600160a01b031633146110015760405163118cdaa760e01b81523360048201526024016109ca565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6001600160a01b03821661174557604051630b61174360e31b81526001600160a01b03831660048201526024016109ca565b6001600160a01b038381165f81815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b156118d257604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906117f390889088908790879060040161218f565b6020604051808303815f875af192505050801561182d575060408051601f3d908101601f1916820190925261182a918101906121cb565b60015b611894573d80801561185a576040519150601f19603f3d011682016040523d82523d5f602084013e61185f565b606091505b5080515f0361188c57604051633250574960e11b81526001600160a01b03851660048201526024016109ca565b805160208201fd5b6001600160e01b03198116630a85bd0160e11b146118d057604051633250574960e11b81526001600160a01b03851660048201526024016109ca565b505b5050505050565b80806118ed57506001600160a01b03821615155b156119ae575f6118fc84611502565b90506001600160a01b038316158015906119285750826001600160a01b0316816001600160a01b031614155b801561193b5750611939818461148e565b155b156119645760405163a9fbf51f60e01b81526001600160a01b03841660048201526024016109ca565b81156119ac5783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6119e78383611a58565b610eac335f8585856117b1565b6119ff838383611ab9565b610eac576001600160a01b038316611a2d57604051637e27328960e01b8152600481018290526024016109ca565b60405163177e802f60e01b81526001600160a01b0383166004820152602481018290526044016109ca565b6001600160a01b038216611a8157604051633250574960e11b81525f60048201526024016109ca565b5f611a8d83835f611560565b90506001600160a01b03811615610eac576040516339e3563760e11b81525f60048201526024016109ca565b5f6001600160a01b03831615801590611b155750826001600160a01b0316846001600160a01b03161480611af25750611af2848461148e565b80611b1557505f828152600460205260409020546001600160a01b038481169116145b949350505050565b6040518060e001604052806007906020820280368337509192915050565b6001600160e01b031981168114610bcd575f80fd5b5f60208284031215611b60575f80fd5b8135611b6b81611b3b565b9392505050565b80356001600160a01b0381168114611b88575f80fd5b919050565b5f60208284031215611b9d575f80fd5b611b6b82611b72565b5f5b83811015611bc0578181015183820152602001611ba8565b50505f910152565b5f8151808452611bdf816020860160208601611ba6565b601f01601f19169290920160200192915050565b602081525f611b6b6020830184611bc8565b5f60208284031215611c15575f80fd5b5035919050565b5f8060408385031215611c2d575f80fd5b611c3683611b72565b946020939093013593505050565b5f805f60608486031215611c56575f80fd5b611c5f84611b72565b9250611c6d60208501611b72565b9150604084013590509250925092565b5f8060408385031215611c8e575f80fd5b611c9783611b72565b915060208301358015158114611cab575f80fd5b809150509250929050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611cf357611cf3611cb6565b604052919050565b5f67ffffffffffffffff821115611d1457611d14611cb6565b50601f01601f191660200190565b5f611d34611d2f84611cfb565b611cca565b9050828152838383011115611d47575f80fd5b828260208301375f602084830101529392505050565b5f60208284031215611d6d575f80fd5b813567ffffffffffffffff811115611d83575f80fd5b8201601f81018413611d93575f80fd5b611b1584823560208401611d22565b5f805f8060808587031215611db5575f80fd5b611dbe85611b72565b9350611dcc60208601611b72565b925060408501359150606085013567ffffffffffffffff811115611dee575f80fd5b8501601f81018713611dfe575f80fd5b611e0d87823560208401611d22565b91505092959194509250565b805f5b6007811015610c53578151845260209384019390910190600101611e1c565b60e0810161070e8284611e19565b5f8060408385031215611e5a575f80fd5b611e6383611b72565b9150611e7160208401611b72565b90509250929050565b634e487b7160e01b5f52603260045260245ffd5b5f8251611e9f818460208701611ba6565b9190910192915050565b5f60208284031215611eb9575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b5f60018201611ee557611ee5611ec0565b5060010190565b600181811c90821680611f0057607f821691505b602082108103611f1e57634e487b7160e01b5f52602260045260245ffd5b50919050565b8181038181111561070e5761070e611ec0565b5f82611f5157634e487b7160e01b5f52601260045260245ffd5b500690565b8082018082111561070e5761070e611ec0565b601f821115610eac575f81815260208120601f850160051c81016020861015611f8f5750805b601f850160051c820191505b818110156118d057828155600101611f9b565b815167ffffffffffffffff811115611fc857611fc8611cb6565b611fdc81611fd68454611eec565b84611f69565b602080601f83116001811461200f575f8415611ff85750858301515b5f19600386901b1c1916600185901b1785556118d0565b5f85815260208120601f198616915b8281101561203d5788860151825594840194600190910190840161201e565b508582101561205a57878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b5f52603160045260245ffd5b5f610120858352602061209381850187611e19565b816101008501525f85546120a681611eec565b93860184905261014093600182811680156120c857600181146120e25761210d565b60ff1984168988015282151560051b89018701945061210d565b895f52855f205f5b848110156121055781548b82018a01529083019087016120ea565b8a0188019550505b50929a9950505050505050505050565b5f6020828403121561212d575f80fd5b815167ffffffffffffffff811115612143575f80fd5b8201601f81018413612153575f80fd5b8051612161611d2f82611cfb565b818152856020838501011115612175575f80fd5b612186826020830160208601611ba6565b95945050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f906121c190830184611bc8565b9695505050505050565b5f602082840312156121db575f80fd5b8151611b6b81611b3b56fea26469706673582212206e96bcce39eaf1e551173e5f5f3570f0a3b79bb9996a4889cbe2dc27d72b446d64736f6c634300081400330000000000000000000000004c84ddf97b4ae6da9ee919313c7b89c4c6a2a574
Deployed Bytecode
0x608060405260043610610228575f3560e01c806370a0823111610129578063a945bf80116100a8578063c87b56dd1161006d578063c87b56dd1461061b578063e1dc07611461063a578063e985e9c514610666578063f2fde38b14610685578063f48a2e03146106a4575f80fd5b8063a945bf8014610590578063adf2131b146105a5578063b88d4fde146105be578063c2e31e39146105dd578063c6275255146105fc575f80fd5b806390967a52116100ee57806390967a521461051457806395d89b4114610529578063a22cb4651461053d578063a2309ff81461055c578063a8d0b1f214610571575f80fd5b806370a0823114610491578063715018a6146104b05780637c69e207146104c45780638ada6b0f146104d85780638da5cb5b146104f7575f80fd5b8063255083f0116101b55780633ccfd60b1161017a5780633ccfd60b1461040157806342842e0e146104155780635229c0661461043457806356d3163d146104535780636352211e14610472575f80fd5b8063255083f0146103615780632be6a2a91461038057806332cb6b0c146103ad57806334df1f7c146103c25780633a602b4d146103d6575f80fd5b8063095ea7b3116101fb578063095ea7b3146102d75780630b3d8362146102f85780631249c58b1461030c5780631da8586d1461031457806323b872dd14610342575f80fd5b806301ffc9a71461022c57806305a3b8091461026057806306fdde031461027f578063081812fc146102a0575b5f80fd5b348015610237575f80fd5b5061024b610246366004611b50565b6106c3565b60405190151581526020015b60405180910390f35b34801561026b575f80fd5b5061024b61027a366004611b8d565b610714565b34801561028a575f80fd5b50610293610833565b6040516102579190611bf3565b3480156102ab575f80fd5b506102bf6102ba366004611c05565b6108c2565b6040516001600160a01b039091168152602001610257565b3480156102e2575f80fd5b506102f66102f1366004611c1c565b6108e9565b005b348015610303575f80fd5b506102936108f8565b6102f6610984565b34801561031f575f80fd5b5061024b61032e366004611b8d565b600e6020525f908152604090205460ff1681565b34801561034d575f80fd5b506102f661035c366004611c44565b610bd0565b34801561036c575f80fd5b506102bf61037b366004611c05565b610c59565b34801561038b575f80fd5b5061039f61039a366004611c05565b610c81565b604051908152602001610257565b3480156103b8575f80fd5b5061039f61037881565b3480156103cd575f80fd5b5061039f602c81565b3480156103e1575f80fd5b5061039f6103f0366004611b8d565b600f6020525f908152604090205481565b34801561040c575f80fd5b506102f6610de6565b348015610420575f80fd5b506102f661042f366004611c44565b610e92565b34801561043f575f80fd5b506102f661044e366004611b8d565b610eb1565b34801561045e575f80fd5b506102f661046d366004611b8d565b610f77565b34801561047d575f80fd5b506102bf61048c366004611c05565b610fa1565b34801561049c575f80fd5b5061039f6104ab366004611b8d565b610fab565b3480156104bb575f80fd5b506102f6610ff0565b3480156104cf575f80fd5b506102f6611003565b3480156104e3575f80fd5b50600c546102bf906001600160a01b031681565b348015610502575f80fd5b506006546001600160a01b03166102bf565b34801561051f575f80fd5b5061039f60085481565b348015610534575f80fd5b50610293611120565b348015610548575f80fd5b506102f6610557366004611c7d565b61112f565b348015610567575f80fd5b5061039f60075481565b34801561057c575f80fd5b506102f661058b366004611d5d565b61113a565b34801561059b575f80fd5b5061039f60095481565b3480156105b0575f80fd5b50600a5461024b9060ff1681565b3480156105c9575f80fd5b506102f66105d8366004611da2565b61114e565b3480156105e8575f80fd5b506102f66105f7366004611b8d565b611166565b348015610607575f80fd5b506102f6610616366004611c05565b6112e0565b348015610626575f80fd5b50610293610635366004611c05565b6112ed565b348015610645575f80fd5b50610659610654366004611c05565b6113c2565b6040516102579190611e3b565b348015610671575f80fd5b5061024b610680366004611e49565b61148e565b348015610690575f80fd5b506102f661069f366004611b8d565b6114bb565b3480156106af575f80fd5b506102f66106be366004611c05565b6114f5565b5f6001600160e01b031982166380ac58cd60e01b14806106f357506001600160e01b03198216635b5e139f60e01b145b8061070e57506301ffc9a760e01b6001600160e01b03198316145b92915050565b5f805b600d5481101561082b575f80600d838154811061073657610736611e7a565b5f9182526020918290200154604080516001600160a01b03898116602480840191909152835180840390910181526044909201835293810180516001600160e01b03166370a0823160e01b179052905192909116916107959190611e8e565b5f60405180830381855afa9150503d805f81146107cd576040519150601f19603f3d011682016040523d82523d5f602084013e6107d2565b606091505b50915091508180156107e657506020815110155b15610816575f818060200190518101906108009190611ea9565b905080156108145750600195945050505050565b505b5050808061082390611ed4565b915050610717565b505f92915050565b60605f805461084190611eec565b80601f016020809104026020016040519081016040528092919081815260200182805461086d90611eec565b80156108b85780601f1061088f576101008083540402835291602001916108b8565b820191905f5260205f20905b81548152906001019060200180831161089b57829003601f168201915b5050505050905090565b5f6108cc82611502565b505f828152600460205260409020546001600160a01b031661070e565b6108f482823361153a565b5050565b600b805461090590611eec565b80601f016020809104026020016040519081016040528092919081815260200182805461093190611eec565b801561097c5780601f106109535761010080835404028352916020019161097c565b820191905f5260205f20905b81548152906001019060200180831161095f57829003601f168201915b505050505081565b600a5460ff166109d35760405162461bcd60e51b815260206004820152601560248201527411195d881b5a5b9d081b9bdd08191bdb99481e595d605a1b60448201526064015b60405180910390fd5b61037860075410610a1b5760405162461bcd60e51b815260206004820152601260248201527113585e081cdd5c1c1b1e481c995858da195960721b60448201526064016109ca565b335f908152600f6020526040902054600111610a6a5760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e481b5a5b9d195960921b60448201526064016109ca565b5f610a7433610714565b610a8057600954610a84565b6008545b905080341015610acd5760405162461bcd60e51b8152602060048201526014602482015273125b9cdd59999a58da595b9d081c185e5b595b9d60621b60448201526064016109ca565b60078054905f610adc83611ed4565b9091555050335f908152600f60205260408120805491610afb83611ed4565b9190505550610b0c33600754611547565b6007546040513391907fba9d3be5149ecab5ff8e380633795e5d9153c2f0e1ec952dd1de4611d661c9f5905f90a380341115610bcd575f33610b4e8334611f24565b6040515f81818185875af1925050503d805f8114610b87576040519150601f19603f3d011682016040523d82523d5f602084013e610b8c565b606091505b50509050806108f45760405162461bcd60e51b815260206004820152600d60248201526c1499599d5b990819985a5b1959609a1b60448201526064016109ca565b50565b6001600160a01b038216610bf957604051633250574960e11b81525f60048201526024016109ca565b5f610c05838333611560565b9050836001600160a01b0316816001600160a01b031614610c53576040516364283d7b60e01b81526001600160a01b03808616600483015260248201849052821660448201526064016109ca565b50505050565b600d8181548110610c68575f80fd5b5f918252602090912001546001600160a01b0316905081565b5f80612710610c90845f611652565b610c9a9190611f37565b90506064811015610cae5750601192915050565b610140811015610cc15750601092915050565b6102a8811015610cd357505f92915050565b61044c811015610ce65750600f92915050565b610640811015610cf95750600e92915050565b610834811015610d0c5750600d92915050565b610a28811015610d1f5750600c92915050565b610c80811015610d325750600b92915050565b610ed8811015610d455750600a92915050565b611130811015610d585750600992915050565b611388811015610d6b5750600892915050565b611644811015610d7e5750600792915050565b611900811015610d915750600692915050565b611bbc811015610da45750600592915050565b611edc811015610db75750600492915050565b6121fc811015610dca5750600392915050565b61251c811015610ddd5750600292915050565b50600192915050565b610dee611695565b5f610e016006546001600160a01b031690565b6001600160a01b0316476040515f6040518083038185875af1925050503d805f8114610e48576040519150601f19603f3d011682016040523d82523d5f602084013e610e4d565b606091505b5050905080610bcd5760405162461bcd60e51b815260206004820152601160248201527015da5d1a191c985dd85b0819985a5b1959607a1b60448201526064016109ca565b610eac83838360405180602001604052805f81525061114e565b505050565b610eb9611695565b6001600160a01b0381165f908152600e602052604090205460ff1615610f115760405162461bcd60e51b815260206004820152600d60248201526c105b1c9958591e481859191959609a1b60448201526064016109ca565b600d805460018181019092557fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50180546001600160a01b039093166001600160a01b0319909316831790555f918252600e6020526040909120805460ff19169091179055565b610f7f611695565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b5f61070e82611502565b5f6001600160a01b038216610fd5576040516322718ad960e21b81525f60048201526024016109ca565b506001600160a01b03165f9081526003602052604090205490565b610ff8611695565b6110015f6116c2565b565b61100b611695565b600a5460ff16156110535760405162461bcd60e51b815260206004820152601260248201527111195d88185b1c9958591e481b5a5b9d195960721b60448201526064016109ca565b610378602c6007546110659190611f56565b11156110a85760405162461bcd60e51b815260206004820152601260248201527145786365656473206d617820737570706c7960701b60448201526064016109ca565b600a805460ff191660011790555f5b602c811015610bcd5760078054905f6110cf83611ed4565b91905055506110e033600754611547565b6007546040513391907fba9d3be5149ecab5ff8e380633795e5d9153c2f0e1ec952dd1de4611d661c9f5905f90a38061111881611ed4565b9150506110b7565b60606001805461084190611eec565b6108f4338383611713565b611142611695565b600b6108f48282611fae565b611159848484610bd0565b610c5333858585856117b1565b61116e611695565b6001600160a01b0381165f908152600e602052604090205460ff166111c35760405162461bcd60e51b815260206004820152600b60248201526a139bdd081a5b881b1a5cdd60aa1b60448201526064016109ca565b6001600160a01b0381165f908152600e60205260408120805460ff191690555b600d548110156108f457816001600160a01b0316600d828154811061120a5761120a611e7a565b5f918252602090912001546001600160a01b0316036112ce57600d805461123390600190611f24565b8154811061124357611243611e7a565b5f91825260209091200154600d80546001600160a01b03909216918390811061126e5761126e611e7a565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550600d8054806112aa576112aa61206a565b5f8281526020902081015f1990810180546001600160a01b03191690550190555050565b806112d881611ed4565b9150506111e3565b6112e8611695565b600955565b60605f6112f983610fa1565b6001600160a01b0316036113465760405162461bcd60e51b8152602060048201526014602482015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b60448201526064016109ca565b600c546001600160a01b031663bcce959183611361816113c2565b600b6040518463ffffffff1660e01b81526004016113819392919061207e565b5f60405180830381865afa15801561139b573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f1916820160405261070e919081019061211d565b6113ca611b1d565b6040518060e001604052806113de84610c81565b8152602001600a6113f0856001611652565b6113fa9190611f37565b8152602001600e61140c856002611652565b6114169190611f37565b8152602001600d611428856003611652565b6114329190611f37565b8152602001600a611444856004611652565b61144e9190611f37565b8152602001600a611460856005611652565b61146a9190611f37565b8152602001600661147c856006611652565b6114869190611f37565b905292915050565b6001600160a01b039182165f90815260056020908152604080832093909416825291909152205460ff1690565b6114c3611695565b6001600160a01b0381166114ec57604051631e4fbdf760e01b81525f60048201526024016109ca565b610bcd816116c2565b6114fd611695565b600855565b5f818152600260205260408120546001600160a01b03168061070e57604051637e27328960e01b8152600481018490526024016109ca565b610eac83838360016118d9565b6108f4828260405180602001604052805f8152506119dd565b5f828152600260205260408120546001600160a01b039081169083161561158c5761158c8184866119f4565b6001600160a01b038116156115c6576115a75f855f806118d9565b6001600160a01b0381165f90815260036020526040902080545f190190555b6001600160a01b038516156115f4576001600160a01b0385165f908152600360205260409020805460010190555b5f8481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b60408051691413105391550e0c0c0d60b21b602080830191909152602a820194909452604a8082019390935281518082039093018352606a019052805191012090565b6006546001600160a01b031633146110015760405163118cdaa760e01b81523360048201526024016109ca565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6001600160a01b03821661174557604051630b61174360e31b81526001600160a01b03831660048201526024016109ca565b6001600160a01b038381165f81815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b156118d257604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906117f390889088908790879060040161218f565b6020604051808303815f875af192505050801561182d575060408051601f3d908101601f1916820190925261182a918101906121cb565b60015b611894573d80801561185a576040519150601f19603f3d011682016040523d82523d5f602084013e61185f565b606091505b5080515f0361188c57604051633250574960e11b81526001600160a01b03851660048201526024016109ca565b805160208201fd5b6001600160e01b03198116630a85bd0160e11b146118d057604051633250574960e11b81526001600160a01b03851660048201526024016109ca565b505b5050505050565b80806118ed57506001600160a01b03821615155b156119ae575f6118fc84611502565b90506001600160a01b038316158015906119285750826001600160a01b0316816001600160a01b031614155b801561193b5750611939818461148e565b155b156119645760405163a9fbf51f60e01b81526001600160a01b03841660048201526024016109ca565b81156119ac5783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6119e78383611a58565b610eac335f8585856117b1565b6119ff838383611ab9565b610eac576001600160a01b038316611a2d57604051637e27328960e01b8152600481018290526024016109ca565b60405163177e802f60e01b81526001600160a01b0383166004820152602481018290526044016109ca565b6001600160a01b038216611a8157604051633250574960e11b81525f60048201526024016109ca565b5f611a8d83835f611560565b90506001600160a01b03811615610eac576040516339e3563760e11b81525f60048201526024016109ca565b5f6001600160a01b03831615801590611b155750826001600160a01b0316846001600160a01b03161480611af25750611af2848461148e565b80611b1557505f828152600460205260409020546001600160a01b038481169116145b949350505050565b6040518060e001604052806007906020820280368337509192915050565b6001600160e01b031981168114610bcd575f80fd5b5f60208284031215611b60575f80fd5b8135611b6b81611b3b565b9392505050565b80356001600160a01b0381168114611b88575f80fd5b919050565b5f60208284031215611b9d575f80fd5b611b6b82611b72565b5f5b83811015611bc0578181015183820152602001611ba8565b50505f910152565b5f8151808452611bdf816020860160208601611ba6565b601f01601f19169290920160200192915050565b602081525f611b6b6020830184611bc8565b5f60208284031215611c15575f80fd5b5035919050565b5f8060408385031215611c2d575f80fd5b611c3683611b72565b946020939093013593505050565b5f805f60608486031215611c56575f80fd5b611c5f84611b72565b9250611c6d60208501611b72565b9150604084013590509250925092565b5f8060408385031215611c8e575f80fd5b611c9783611b72565b915060208301358015158114611cab575f80fd5b809150509250929050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611cf357611cf3611cb6565b604052919050565b5f67ffffffffffffffff821115611d1457611d14611cb6565b50601f01601f191660200190565b5f611d34611d2f84611cfb565b611cca565b9050828152838383011115611d47575f80fd5b828260208301375f602084830101529392505050565b5f60208284031215611d6d575f80fd5b813567ffffffffffffffff811115611d83575f80fd5b8201601f81018413611d93575f80fd5b611b1584823560208401611d22565b5f805f8060808587031215611db5575f80fd5b611dbe85611b72565b9350611dcc60208601611b72565b925060408501359150606085013567ffffffffffffffff811115611dee575f80fd5b8501601f81018713611dfe575f80fd5b611e0d87823560208401611d22565b91505092959194509250565b805f5b6007811015610c53578151845260209384019390910190600101611e1c565b60e0810161070e8284611e19565b5f8060408385031215611e5a575f80fd5b611e6383611b72565b9150611e7160208401611b72565b90509250929050565b634e487b7160e01b5f52603260045260245ffd5b5f8251611e9f818460208701611ba6565b9190910192915050565b5f60208284031215611eb9575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b5f60018201611ee557611ee5611ec0565b5060010190565b600181811c90821680611f0057607f821691505b602082108103611f1e57634e487b7160e01b5f52602260045260245ffd5b50919050565b8181038181111561070e5761070e611ec0565b5f82611f5157634e487b7160e01b5f52601260045260245ffd5b500690565b8082018082111561070e5761070e611ec0565b601f821115610eac575f81815260208120601f850160051c81016020861015611f8f5750805b601f850160051c820191505b818110156118d057828155600101611f9b565b815167ffffffffffffffff811115611fc857611fc8611cb6565b611fdc81611fd68454611eec565b84611f69565b602080601f83116001811461200f575f8415611ff85750858301515b5f19600386901b1c1916600185901b1785556118d0565b5f85815260208120601f198616915b8281101561203d5788860151825594840194600190910190840161201e565b508582101561205a57878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b5f52603160045260245ffd5b5f610120858352602061209381850187611e19565b816101008501525f85546120a681611eec565b93860184905261014093600182811680156120c857600181146120e25761210d565b60ff1984168988015282151560051b89018701945061210d565b895f52855f205f5b848110156121055781548b82018a01529083019087016120ea565b8a0188019550505b50929a9950505050505050505050565b5f6020828403121561212d575f80fd5b815167ffffffffffffffff811115612143575f80fd5b8201601f81018413612153575f80fd5b8051612161611d2f82611cfb565b818152856020838501011115612175575f80fd5b612186826020830160208601611ba6565b95945050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f906121c190830184611bc8565b9695505050505050565b5f602082840312156121db575f80fd5b8151611b6b81611b3b56fea26469706673582212206e96bcce39eaf1e551173e5f5f3570f0a3b79bb9996a4889cbe2dc27d72b446d64736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000004c84ddf97b4ae6da9ee919313c7b89c4c6a2a574
-----Decoded View---------------
Arg [0] : _renderer (address): 0x4c84Ddf97B4ae6Da9EE919313c7b89c4C6a2a574
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000004c84ddf97b4ae6da9ee919313c7b89c4c6a2a574
Deployed Bytecode Sourcemap
131471:8475:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;112982:305;;;;;;;;;;-1:-1:-1;112982:305:0;;;;;:::i;:::-;;:::i;:::-;;;565:14:1;;558:22;540:41;;528:2;513:18;112982:305:0;;;;;;;;134728:623;;;;;;;;;;-1:-1:-1;134728:623:0;;;;;:::i;:::-;;:::i;113739:91::-;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;114807:158::-;;;;;;;;;;-1:-1:-1;114807:158:0;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;2066:32:1;;;2048:51;;2036:2;2021:18;114807:158:0;1902:203:1;114655:115:0;;;;;;;;;;-1:-1:-1;114655:115:0;;;;;:::i;:::-;;:::i;:::-;;131796:68;;;;;;;;;;;;;:::i;137690:751::-;;;:::i;132017:53::-;;;;;;;;;;-1:-1:-1;132017:53:0;;;;;:::i;:::-;;;;;;;;;;;;;;;;115377:588;;;;;;;;;;-1:-1:-1;115377:588:0;;;;;:::i;:::-;;:::i;131973:37::-;;;;;;;;;;-1:-1:-1;131973:37:0;;;;;:::i;:::-;;:::i;135568:1042::-;;;;;;;;;;-1:-1:-1;135568:1042:0;;;;;:::i;:::-;;:::i;:::-;;;2848:25:1;;;2836:2;2821:18;135568:1042:0;2702:177:1;131517:40:0;;;;;;;;;;;;131554:3;131517:40;;131564;;;;;;;;;;;;131602:2;131564:40;;132077:50;;;;;;;;;;-1:-1:-1;132077:50:0;;;;;:::i;:::-;;;;;;;;;;;;;;139763:180;;;;;;;;;;;;;:::i;116002:134::-;;;;;;;;;;-1:-1:-1;116002:134:0;;;;;:::i;:::-;;:::i;138481:249::-;;;;;;;;;;-1:-1:-1;138481:249:0;;;;;:::i;:::-;;:::i;139298:98::-;;;;;;;;;;-1:-1:-1;139298:98:0;;;;;:::i;:::-;;:::i;113574:120::-;;;;;;;;;;-1:-1:-1;113574:120:0;;;;;:::i;:::-;;:::i;113324:213::-;;;;;;;;;;-1:-1:-1;113324:213:0;;;;;:::i;:::-;;:::i;130290:103::-;;;;;;;;;;;;;:::i;137255:427::-;;;;;;;;;;;;;:::i;131871:23::-;;;;;;;;;;-1:-1:-1;131871:23:0;;;;-1:-1:-1;;;;;131871:23:0;;;129615:87;;;;;;;;;;-1:-1:-1;129688:6:0;;-1:-1:-1;;;;;129688:6:0;129615:87;;131650:44;;;;;;;;;;;;;;;;113875:95;;;;;;;;;;;;;:::i;115002:146::-;;;;;;;;;;-1:-1:-1;115002:146:0;;;;;:::i;:::-;;:::i;131611:26::-;;;;;;;;;;;;;;;;139404:125;;;;;;;;;;-1:-1:-1;139404:125:0;;;;;:::i;:::-;;:::i;131701:40::-;;;;;;;;;;;;;;;;131754:29;;;;;;;;;;-1:-1:-1;131754:29:0;;;;;;;;116173:236;;;;;;;;;;-1:-1:-1;116173:236:0;;;;;:::i;:::-;;:::i;138738:552::-;;;;;;;;;;-1:-1:-1;138738:552:0;;;;;:::i;:::-;;:::i;139653:102::-;;;;;;;;;;-1:-1:-1;139653:102:0;;;;;:::i;:::-;;:::i;136948:275::-;;;;;;;;;;-1:-1:-1;136948:275:0;;;;;:::i;:::-;;:::i;136618:322::-;;;;;;;;;;-1:-1:-1;136618:322:0;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;115185:155::-;;;;;;;;;;-1:-1:-1;115185:155:0;;;;;:::i;:::-;;:::i;130548:220::-;;;;;;;;;;-1:-1:-1;130548:220:0;;;;;:::i;:::-;;:::i;139537:108::-;;;;;;;;;;-1:-1:-1;139537:108:0;;;;;:::i;:::-;;:::i;112982:305::-;113084:4;-1:-1:-1;;;;;;113121:40:0;;-1:-1:-1;;;113121:40:0;;:105;;-1:-1:-1;;;;;;;113178:48:0;;-1:-1:-1;;;113178:48:0;113121:105;:158;;;-1:-1:-1;;;;;;;;;;111715:40:0;;;113243:36;113101:178;112982:305;-1:-1:-1;;112982:305:0:o;134728:623::-;134788:4;;134805:516;134829:20;:27;134825:31;;134805:516;;;134966:12;134980:17;135001:20;135022:1;135001:23;;;;;;;;:::i;:::-;;;;;;;;;;;;135054:65;;;-1:-1:-1;;;;;2066:32:1;;;135054:65:0;;;;2048:51:1;;;;135054:65:0;;;;;;;;;;2021:18:1;;;;135054:65:0;;;;;;;-1:-1:-1;;;;;135054:65:0;-1:-1:-1;;;135054:65:0;;;135001:133;;:23;;;;;:133;;135054:65;135001:133;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;134965:169;;;;135153:7;:28;;;;;135179:2;135164:4;:11;:17;;135153:28;135149:161;;;135202:15;135231:4;135220:27;;;;;;;;;;;;:::i;:::-;135202:45;-1:-1:-1;135270:11:0;;135266:28;;-1:-1:-1;135290:4:0;;134728:623;-1:-1:-1;;;;;134728:623:0:o;135266:28::-;135183:127;135149:161;134863:458;;134858:3;;;;;:::i;:::-;;;;134805:516;;;-1:-1:-1;135338:5:0;;134728:623;-1:-1:-1;;134728:623:0:o;113739:91::-;113784:13;113817:5;113810:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;113739:91;:::o;114807:158::-;114874:7;114894:22;114908:7;114894:13;:22::i;:::-;-1:-1:-1;117242:7:0;117269:24;;;:15;:24;;;;;;-1:-1:-1;;;;;117269:24:0;114936:21;117172:129;114655:115;114727:35;114736:2;114740:7;17260:10;114727:8;:35::i;:::-;114655:115;;:::o;131796:68::-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;137690:751::-;137742:9;;;;137734:43;;;;-1:-1:-1;;;137734:43:0;;7626:2:1;137734:43:0;;;7608:21:1;7665:2;7645:18;;;7638:30;-1:-1:-1;;;7684:18:1;;;7677:51;7745:18;;137734:43:0;;;;;;;;;131554:3;137796:11;;:24;137788:55;;;;-1:-1:-1;;;137788:55:0;;7976:2:1;137788:55:0;;;7958:21:1;8015:2;7995:18;;;7988:30;-1:-1:-1;;;8034:18:1;;;8027:48;8092:18;;137788:55:0;7774:342:1;137788:55:0;137878:10;137862:27;;;;:15;:27;;;;;;137892:1;-1:-1:-1;137854:58:0;;;;-1:-1:-1;;;137854:58:0;;8323:2:1;137854:58:0;;;8305:21:1;8362:2;8342:18;;;8335:30;-1:-1:-1;;;8381:18:1;;;8374:44;8435:18;;137854:58:0;8121:338:1;137854:58:0;137933:13;137949:25;137963:10;137949:13;:25::i;:::-;:56;;137994:11;;137949:56;;;137977:14;;137949:56;137933:72;;138037:5;138024:9;:18;;138016:51;;;;-1:-1:-1;;;138016:51:0;;8666:2:1;138016:51:0;;;8648:21:1;8705:2;8685:18;;;8678:30;-1:-1:-1;;;8724:18:1;;;8717:50;8784:18;;138016:51:0;8464:344:1;138016:51:0;138088:11;:13;;;:11;:13;;;:::i;:::-;;;;-1:-1:-1;;138128:10:0;138112:27;;;;:15;:27;;;;;:29;;;;;;:::i;:::-;;;;;;138152:34;138162:10;138174:11;;138152:9;:34::i;:::-;138218:11;;138202:40;;138231:10;;138218:11;138202:40;;;;;138279:5;138267:9;:17;138263:171;;;138302:12;138328:10;138352:17;138364:5;138352:9;:17;:::i;:::-;138320:54;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;138301:73;;;138397:7;138389:33;;;;-1:-1:-1;;;138389:33:0;;9358:2:1;138389:33:0;;;9340:21:1;9397:2;9377:18;;;9370:30;-1:-1:-1;;;9416:18:1;;;9409:43;9469:18;;138389:33:0;9156:337:1;138263:171:0;137723:718;137690:751::o;115377:588::-;-1:-1:-1;;;;;115472:16:0;;115468:89;;115512:33;;-1:-1:-1;;;115512:33:0;;115542:1;115512:33;;;2048:51:1;2021:18;;115512:33:0;1902:203:1;115468:89:0;115778:21;115802:34;115810:2;115814:7;17260:10;115802:7;:34::i;:::-;115778:58;;115868:4;-1:-1:-1;;;;;115851:21:0;:13;-1:-1:-1;;;;;115851:21:0;;115847:111;;115896:50;;-1:-1:-1;;;115896:50:0;;-1:-1:-1;;;;;9756:15:1;;;115896:50:0;;;9738:34:1;9788:18;;;9781:34;;;9851:15;;9831:18;;;9824:43;9673:18;;115896:50:0;9498:375:1;115847:111:0;115457:508;115377:588;;;:::o;131973:37::-;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;131973:37:0;;-1:-1:-1;131973:37:0;:::o;135568:1042::-;135621:7;135641:9;135667:5;135653:11;135658:2;135662:1;135653:4;:11::i;:::-;:19;;;;:::i;:::-;135641:31;;135701:3;135697:1;:7;135693:22;;;-1:-1:-1;135713:2:0;;135568:1042;-1:-1:-1;;135568:1042:0:o;135693:22::-;135750:3;135746:1;:7;135742:22;;;-1:-1:-1;135762:2:0;;135568:1042;-1:-1:-1;;135568:1042:0:o;135742:22::-;135802:3;135798:1;:7;135794:21;;;-1:-1:-1;135814:1:0;;135568:1042;-1:-1:-1;;135568:1042:0:o;135794:21::-;135853:4;135849:1;:8;135845:23;;;-1:-1:-1;135866:2:0;;135568:1042;-1:-1:-1;;135568:1042:0:o;135845:23::-;135908:4;135904:1;:8;135900:23;;;-1:-1:-1;135921:2:0;;135568:1042;-1:-1:-1;;135568:1042:0:o;135900:23::-;135957:4;135953:1;:8;135949:23;;;-1:-1:-1;135970:2:0;;135568:1042;-1:-1:-1;;135568:1042:0:o;135949:23::-;136007:4;136003:1;:8;135999:23;;;-1:-1:-1;136020:2:0;;135568:1042;-1:-1:-1;;135568:1042:0:o;135999:23::-;136059:4;136055:1;:8;136051:23;;;-1:-1:-1;136072:2:0;;135568:1042;-1:-1:-1;;135568:1042:0:o;136051:23::-;136111:4;136107:1;:8;136103:23;;;-1:-1:-1;136124:2:0;;135568:1042;-1:-1:-1;;135568:1042:0:o;136103:23::-;136160:4;136156:1;:8;136152:22;;;-1:-1:-1;136173:1:0;;135568:1042;-1:-1:-1;;135568:1042:0:o;136152:22::-;136212:4;136208:1;:8;136204:22;;;-1:-1:-1;136225:1:0;;135568:1042;-1:-1:-1;;135568:1042:0:o;136204:22::-;136265:4;136261:1;:8;136257:22;;;-1:-1:-1;136278:1:0;;135568:1042;-1:-1:-1;;135568:1042:0:o;136257:22::-;136316:4;136312:1;:8;136308:22;;;-1:-1:-1;136329:1:0;;135568:1042;-1:-1:-1;;135568:1042:0:o;136308:22::-;136365:4;136361:1;:8;136357:22;;;-1:-1:-1;136378:1:0;;135568:1042;-1:-1:-1;;135568:1042:0:o;136357:22::-;136415:4;136411:1;:8;136407:22;;;-1:-1:-1;136428:1:0;;135568:1042;-1:-1:-1;;135568:1042:0:o;136407:22::-;136465:4;136461:1;:8;136457:22;;;-1:-1:-1;136478:1:0;;135568:1042;-1:-1:-1;;135568:1042:0:o;136457:22::-;136516:4;136512:1;:8;136508:22;;;-1:-1:-1;136529:1:0;;135568:1042;-1:-1:-1;;135568:1042:0:o;136508:22::-;-1:-1:-1;136567:1:0;;135568:1042;-1:-1:-1;;135568:1042:0:o;139763:180::-;129501:13;:11;:13::i;:::-;139814:12:::1;139840:7;129688:6:::0;;-1:-1:-1;;;;;129688:6:0;;129615:87;139840:7:::1;-1:-1:-1::0;;;;;139832:21:0::1;139861;139832:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;139813:74;;;139906:7;139898:37;;;::::0;-1:-1:-1;;;139898:37:0;;10294:2:1;139898:37:0::1;::::0;::::1;10276:21:1::0;10333:2;10313:18;;;10306:30;-1:-1:-1;;;10352:18:1;;;10345:47;10409:18;;139898:37:0::1;10092:341:1::0;116002:134:0;116089:39;116106:4;116112:2;116116:7;116089:39;;;;;;;;;;;;:16;:39::i;:::-;116002:134;;;:::o;138481:249::-;129501:13;:11;:13::i;:::-;-1:-1:-1;;;;;138572:33:0;::::1;;::::0;;;:21:::1;:33;::::0;;;;;::::1;;138571:34;138563:60;;;::::0;-1:-1:-1;;;138563:60:0;;10640:2:1;138563:60:0::1;::::0;::::1;10622:21:1::0;10679:2;10659:18;;;10652:30;-1:-1:-1;;;10698:18:1;;;10691:43;10751:18;;138563:60:0::1;10438:337:1::0;138563:60:0::1;138634:20;:37:::0;;::::1;::::0;;::::1;::::0;;;;::::1;::::0;;-1:-1:-1;;;;;138634:37:0;;::::1;-1:-1:-1::0;;;;;;138634:37:0;;::::1;::::0;::::1;::::0;;-1:-1:-1;138682:33:0;;;:21:::1;138634:37;138682:33:::0;;;;;:40;;-1:-1:-1;;138682:40:0::1;::::0;;::::1;::::0;;138481:249::o;139298:98::-;129501:13;:11;:13::i;:::-;139368:8:::1;:20:::0;;-1:-1:-1;;;;;;139368:20:0::1;-1:-1:-1::0;;;;;139368:20:0;;;::::1;::::0;;;::::1;::::0;;139298:98::o;113574:120::-;113637:7;113664:22;113678:7;113664:13;:22::i;113324:213::-;113387:7;-1:-1:-1;;;;;113411:19:0;;113407:89;;113454:30;;-1:-1:-1;;;113454:30:0;;113481:1;113454:30;;;2048:51:1;2021:18;;113454:30:0;1902:203:1;113407:89:0;-1:-1:-1;;;;;;113513:16:0;;;;;:9;:16;;;;;;;113324:213::o;130290:103::-;129501:13;:11;:13::i;:::-;130355:30:::1;130382:1;130355:18;:30::i;:::-;130290:103::o:0;137255:427::-;129501:13;:11;:13::i;:::-;137313:9:::1;::::0;::::1;;137312:10;137304:41;;;::::0;-1:-1:-1;;;137304:41:0;;10982:2:1;137304:41:0::1;::::0;::::1;10964:21:1::0;11021:2;11001:18;;;10994:30;-1:-1:-1;;;11040:18:1;;;11033:48;11098:18;;137304:41:0::1;10780:342:1::0;137304:41:0::1;131554:3;131602:2;137364:11;;:25;;;;:::i;:::-;:39;;137356:70;;;::::0;-1:-1:-1;;;137356:70:0;;11459:2:1;137356:70:0::1;::::0;::::1;11441:21:1::0;11498:2;11478:18;;;11471:30;-1:-1:-1;;;11517:18:1;;;11510:48;11575:18;;137356:70:0::1;11257:342:1::0;137356:70:0::1;137447:9;:16:::0;;-1:-1:-1;;137447:16:0::1;137459:4;137447:16;::::0;;:9:::1;137484:191;131602:2;137504:1;:15;137484:191;;;137541:11;:13:::0;;;:11:::1;:13;::::0;::::1;:::i;:::-;;;;;;137569:34;137579:10;137591:11;;137569:9;:34::i;:::-;137639:11;::::0;137623:40:::1;::::0;137652:10:::1;::::0;137639:11;137623:40:::1;::::0;;;::::1;137521:3:::0;::::1;::::0;::::1;:::i;:::-;;;;137484:191;;113875:95:::0;113922:13;113955:7;113948:14;;;;;:::i;115002:146::-;115088:52;17260:10;115121:8;115131;115088:18;:52::i;139404:125::-;129501:13;:11;:13::i;:::-;139487:20:::1;:34;139510:11:::0;139487:20;:34:::1;:::i;116173:236::-:0;116287:31;116300:4;116306:2;116310:7;116287:12;:31::i;:::-;116329:72;17260:10;116377:4;116383:2;116387:7;116396:4;116329:33;:72::i;138738:552::-;129501:13;:11;:13::i;:::-;-1:-1:-1;;;;;138831:33:0;::::1;;::::0;;;:21:::1;:33;::::0;;;;;::::1;;138823:57;;;::::0;-1:-1:-1;;;138823:57:0;;14010:2:1;138823:57:0::1;::::0;::::1;13992:21:1::0;14049:2;14029:18;;;14022:30;-1:-1:-1;;;14068:18:1;;;14061:41;14119:18;;138823:57:0::1;13808:335:1::0;138823:57:0::1;-1:-1:-1::0;;;;;138891:33:0;::::1;138927:5;138891:33:::0;;;:21:::1;:33;::::0;;;;:41;;-1:-1:-1;;138891:41:0::1;::::0;;138973:310:::1;138997:20;:27:::0;138993:31;::::1;138973:310;;;139077:10;-1:-1:-1::0;;;;;139050:37:0::1;:20;139071:1;139050:23;;;;;;;;:::i;:::-;;::::0;;;::::1;::::0;;;::::1;::::0;-1:-1:-1;;;;;139050:23:0::1;:37:::0;139046:226:::1;;139134:20;139155:27:::0;;:31:::1;::::0;139185:1:::1;::::0;139155:31:::1;:::i;:::-;139134:53;;;;;;;;:::i;:::-;;::::0;;;::::1;::::0;;;::::1;::::0;139108:20:::1;:23:::0;;-1:-1:-1;;;;;139134:53:0;;::::1;::::0;139129:1;;139108:23;::::1;;;;;:::i;:::-;;;;;;;;;:79;;;;;-1:-1:-1::0;;;;;139108:79:0::1;;;;;-1:-1:-1::0;;;;;139108:79:0::1;;;;;;139206:20;:26;;;;;;;:::i;:::-;;::::0;;;::::1;::::0;;;;-1:-1:-1;;139206:26:0;;;;;-1:-1:-1;;;;;;139206:26:0::1;::::0;;;;;114655:115;;:::o;139046:226::-:1;139026:3:::0;::::1;::::0;::::1;:::i;:::-;;;;138973:310;;139653:102:::0;129501:13;:11;:13::i;:::-;139725:11:::1;:22:::0;139653:102::o;136948:275::-;137013:13;137075:1;137047:16;137055:7;137047;:16::i;:::-;-1:-1:-1;;;;;137047:30:0;;137039:63;;;;-1:-1:-1;;;137039:63:0;;14482:2:1;137039:63:0;;;14464:21:1;14521:2;14501:18;;;14494:30;-1:-1:-1;;;14540:18:1;;;14533:50;14600:18;;137039:63:0;14280:344:1;137039:63:0;137140:8;;-1:-1:-1;;;;;137140:8:0;137120:44;137165:7;137174:18;137165:7;137174:9;:18::i;:::-;137194:20;137120:95;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;137120:95:0;;;;;;;;;;;;:::i;136618:322::-;136670:17;;:::i;:::-;136700:232;;;;;;;;136722:14;136733:2;136722:10;:14::i;:::-;136700:232;;;;136765:2;136751:11;136756:2;136760:1;136751:4;:11::i;:::-;:16;;;;:::i;:::-;136700:232;;;;136796:2;136782:11;136787:2;136791:1;136782:4;:11::i;:::-;:16;;;;:::i;:::-;136700:232;;;;136827:2;136813:11;136818:2;136822:1;136813:4;:11::i;:::-;:16;;;;:::i;:::-;136700:232;;;;136858:2;136844:11;136849:2;136853:1;136844:4;:11::i;:::-;:16;;;;:::i;:::-;136700:232;;;;136889:2;136875:11;136880:2;136884:1;136875:4;:11::i;:::-;:16;;;;:::i;:::-;136700:232;;;;136920:1;136906:11;136911:2;136915:1;136906:4;:11::i;:::-;:15;;;;:::i;:::-;136700:232;;;136618:322;-1:-1:-1;;136618:322:0:o;115185:155::-;-1:-1:-1;;;;;115297:25:0;;;115273:4;115297:25;;;:18;:25;;;;;;;;:35;;;;;;;;;;;;;;;115185:155::o;130548:220::-;129501:13;:11;:13::i;:::-;-1:-1:-1;;;;;130633:22:0;::::1;130629:93;;130679:31;::::0;-1:-1:-1;;;130679:31:0;;130707:1:::1;130679:31;::::0;::::1;2048:51:1::0;2021:18;;130679:31:0::1;1902:203:1::0;130629:93:0::1;130732:28;130751:8;130732:18;:28::i;139537:108::-:0;129501:13;:11;:13::i;:::-;139612:14:::1;:25:::0;139537:108::o;127691:247::-;127754:7;117027:16;;;:7;:16;;;;;;-1:-1:-1;;;;;117027:16:0;;127818:90;;127865:31;;-1:-1:-1;;;127865:31:0;;;;;2848:25:1;;;2821:18;;127865:31:0;2702:177:1;125923:122:0;126004:33;126013:2;126017:7;126026:4;126032;126004:8;:33::i;121991:102::-;122059:26;122069:2;122073:7;122059:26;;;;;;;;;;;;:9;:26::i;120133:824::-;120219:7;117027:16;;;:7;:16;;;;;;-1:-1:-1;;;;;117027:16:0;;;;120334:18;;;120330:88;;120369:37;120386:4;120392;120398:7;120369:16;:37::i;:::-;-1:-1:-1;;;;;120465:18:0;;;120461:263;;120583:48;120600:1;120604:7;120621:1;120625:5;120583:8;:48::i;:::-;-1:-1:-1;;;;;120677:15:0;;;;;;:9;:15;;;;;:20;;-1:-1:-1;;120677:20:0;;;120461:263;-1:-1:-1;;;;;120740:16:0;;;120736:111;;-1:-1:-1;;;;;120802:13:0;;;;;;:9;:13;;;;;:18;;120819:1;120802:18;;;120736:111;120859:16;;;;:7;:16;;;;;;:21;;-1:-1:-1;;;;;;120859:21:0;-1:-1:-1;;;;;120859:21:0;;;;;;;;;120898:27;;120859:16;;120898:27;;;;;;;120945:4;120133:824;-1:-1:-1;;;;120133:824:0:o;135404:156::-;135511:39;;;-1:-1:-1;;;135511:39:0;;;;16739:25:1;;;;16780:12;;;16773:28;;;;16817:12;;;;16810:28;;;;135511:39:0;;;;;;;;;;16854:12:1;;135511:39:0;;135501:50;;;;;;135404:156::o;129780:166::-;129688:6;;-1:-1:-1;;;;;129688:6:0;17260:10;129840:23;129836:103;;129887:40;;-1:-1:-1;;;129887:40:0;;17260:10;129887:40;;;2048:51:1;2021:18;;129887:40:0;1902:203:1;130928:191:0;131021:6;;;-1:-1:-1;;;;;131038:17:0;;;-1:-1:-1;;;;;;131038:17:0;;;;;;;131071:40;;131021:6;;;131038:17;131021:6;;131071:40;;131002:16;;131071:40;130991:128;130928:191;:::o;127130:318::-;-1:-1:-1;;;;;127238:22:0;;127234:93;;127284:31;;-1:-1:-1;;;127284:31:0;;-1:-1:-1;;;;;2066:32:1;;127284:31:0;;;2048:51:1;2021:18;;127284:31:0;1902:203:1;127234:93:0;-1:-1:-1;;;;;127337:25:0;;;;;;;:18;:25;;;;;;;;:35;;;;;;;;;;;;;:46;;-1:-1:-1;;127337:46:0;;;;;;;;;;127399:41;;540::1;;;127399::0;;513:18:1;127399:41:0;;;;;;;127130:318;;;:::o;15528:950::-;-1:-1:-1;;;;;15715:14:0;;;:18;15711:760;;15754:67;;-1:-1:-1;;;15754:67:0;;-1:-1:-1;;;;;15754:36:0;;;;;:67;;15791:8;;15801:4;;15807:7;;15816:4;;15754:67;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;-1:-1:-1;15754:67:0;;;;;;;;-1:-1:-1;;15754:67:0;;;;;;;;;;;;:::i;:::-;;;15750:710;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16117:6;:13;16134:1;16117:18;16113:332;;16223:39;;-1:-1:-1;;;16223:39:0;;-1:-1:-1;;;;;2066:32:1;;16223:39:0;;;2048:51:1;2021:18;;16223:39:0;1902:203:1;16113:332:0;16395:6;16389:13;16382:4;16374:6;16370:17;16363:40;15750:710;-1:-1:-1;;;;;;15869:51:0;;-1:-1:-1;;;15869:51:0;15865:185;;15991:39;;-1:-1:-1;;;15991:39:0;;-1:-1:-1;;;;;2066:32:1;;15991:39:0;;;2048:51:1;2021:18;;15991:39:0;1902:203:1;15865:185:0;15822:243;15750:710;15528:950;;;;;:::o;126233:678::-;126395:9;:31;;;-1:-1:-1;;;;;;126408:18:0;;;;126395:31;126391:471;;;126443:13;126459:22;126473:7;126459:13;:22::i;:::-;126443:38;-1:-1:-1;;;;;;126612:18:0;;;;;;:35;;;126643:4;-1:-1:-1;;;;;126634:13:0;:5;-1:-1:-1;;;;;126634:13:0;;;126612:35;:69;;;;;126652:29;126669:5;126676:4;126652:16;:29::i;:::-;126651:30;126612:69;126608:144;;;126709:27;;-1:-1:-1;;;126709:27:0;;-1:-1:-1;;;;;2066:32:1;;126709:27:0;;;2048:51:1;2021:18;;126709:27:0;1902:203:1;126608:144:0;126772:9;126768:83;;;126827:7;126823:2;-1:-1:-1;;;;;126807:28:0;126816:5;-1:-1:-1;;;;;126807:28:0;;;;;;;;;;;126768:83;126428:434;126391:471;-1:-1:-1;;126874:24:0;;;;:15;:24;;;;;:29;;-1:-1:-1;;;;;;126874:29:0;-1:-1:-1;;;;;126874:29:0;;;;;;;;;;126233:678::o;122320:210::-;122415:18;122421:2;122425:7;122415:5;:18::i;:::-;122444:78;17260:10;122500:1;122504:2;122508:7;122517:4;122444:33;:78::i;118340:376::-;118453:38;118467:5;118474:7;118483;118453:13;:38::i;:::-;118448:261;;-1:-1:-1;;;;;118512:19:0;;118508:190;;118559:31;;-1:-1:-1;;;118559:31:0;;;;;2848:25:1;;;2821:18;;118559:31:0;2702:177:1;118508:190:0;118638:44;;-1:-1:-1;;;118638:44:0;;-1:-1:-1;;;;;17817:32:1;;118638:44:0;;;17799:51:1;17866:18;;;17859:34;;;17772:18;;118638:44:0;17625:274:1;121293:335:0;-1:-1:-1;;;;;121361:16:0;;121357:89;;121401:33;;-1:-1:-1;;;121401:33:0;;121431:1;121401:33;;;2048:51:1;2021:18;;121401:33:0;1902:203:1;121357:89:0;121456:21;121480:32;121488:2;121492:7;121509:1;121480:7;:32::i;:::-;121456:56;-1:-1:-1;;;;;;121527:27:0;;;121523:98;;121578:31;;-1:-1:-1;;;121578:31:0;;121606:1;121578:31;;;2048:51:1;2021:18;;121578:31:0;1902:203:1;117621:276:0;117724:4;-1:-1:-1;;;;;117761:21:0;;;;;;:128;;;117809:7;-1:-1:-1;;;;;117800:16:0;:5;-1:-1:-1;;;;;117800:16:0;;:52;;;;117820:32;117837:5;117844:7;117820:16;:32::i;:::-;117800:88;;;-1:-1:-1;117242:7:0;117269:24;;;:15;:24;;;;;;-1:-1:-1;;;;;117856:32:0;;;117269:24;;117856:32;117800:88;117741:148;117621:276;-1:-1:-1;;;;117621:276:0:o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;:::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:173::-;660:20;;-1:-1:-1;;;;;709:31:1;;699:42;;689:70;;755:1;752;745:12;689:70;592:173;;;:::o;770:186::-;829:6;882:2;870:9;861:7;857:23;853:32;850:52;;;898:1;895;888:12;850:52;921:29;940:9;921:29;:::i;961:250::-;1046:1;1056:113;1070:6;1067:1;1064:13;1056:113;;;1146:11;;;1140:18;1127:11;;;1120:39;1092:2;1085:10;1056:113;;;-1:-1:-1;;1203:1:1;1185:16;;1178:27;961:250::o;1216:271::-;1258:3;1296:5;1290:12;1323:6;1318:3;1311:19;1339:76;1408:6;1401:4;1396:3;1392:14;1385:4;1378:5;1374:16;1339:76;:::i;:::-;1469:2;1448:15;-1:-1:-1;;1444:29:1;1435:39;;;;1476:4;1431:50;;1216:271;-1:-1:-1;;1216:271:1:o;1492:220::-;1641:2;1630:9;1623:21;1604:4;1661:45;1702:2;1691:9;1687:18;1679:6;1661:45;:::i;1717:180::-;1776:6;1829:2;1817:9;1808:7;1804:23;1800:32;1797:52;;;1845:1;1842;1835:12;1797:52;-1:-1:-1;1868:23:1;;1717:180;-1:-1:-1;1717:180:1:o;2110:254::-;2178:6;2186;2239:2;2227:9;2218:7;2214:23;2210:32;2207:52;;;2255:1;2252;2245:12;2207:52;2278:29;2297:9;2278:29;:::i;:::-;2268:39;2354:2;2339:18;;;;2326:32;;-1:-1:-1;;;2110:254:1:o;2369:328::-;2446:6;2454;2462;2515:2;2503:9;2494:7;2490:23;2486:32;2483:52;;;2531:1;2528;2521:12;2483:52;2554:29;2573:9;2554:29;:::i;:::-;2544:39;;2602:38;2636:2;2625:9;2621:18;2602:38;:::i;:::-;2592:48;;2687:2;2676:9;2672:18;2659:32;2649:42;;2369:328;;;;;:::o;2884:347::-;2949:6;2957;3010:2;2998:9;2989:7;2985:23;2981:32;2978:52;;;3026:1;3023;3016:12;2978:52;3049:29;3068:9;3049:29;:::i;:::-;3039:39;;3128:2;3117:9;3113:18;3100:32;3175:5;3168:13;3161:21;3154:5;3151:32;3141:60;;3197:1;3194;3187:12;3141:60;3220:5;3210:15;;;2884:347;;;;;:::o;3236:127::-;3297:10;3292:3;3288:20;3285:1;3278:31;3328:4;3325:1;3318:15;3352:4;3349:1;3342:15;3368:275;3439:2;3433:9;3504:2;3485:13;;-1:-1:-1;;3481:27:1;3469:40;;3539:18;3524:34;;3560:22;;;3521:62;3518:88;;;3586:18;;:::i;:::-;3622:2;3615:22;3368:275;;-1:-1:-1;3368:275:1:o;3648:187::-;3697:4;3730:18;3722:6;3719:30;3716:56;;;3752:18;;:::i;:::-;-1:-1:-1;3818:2:1;3797:15;-1:-1:-1;;3793:29:1;3824:4;3789:40;;3648:187::o;3840:338::-;3905:5;3934:53;3950:36;3979:6;3950:36;:::i;:::-;3934:53;:::i;:::-;3925:62;;4010:6;4003:5;3996:21;4050:3;4041:6;4036:3;4032:16;4029:25;4026:45;;;4067:1;4064;4057:12;4026:45;4116:6;4111:3;4104:4;4097:5;4093:16;4080:43;4170:1;4163:4;4154:6;4147:5;4143:18;4139:29;4132:40;3840:338;;;;;:::o;4183:451::-;4252:6;4305:2;4293:9;4284:7;4280:23;4276:32;4273:52;;;4321:1;4318;4311:12;4273:52;4361:9;4348:23;4394:18;4386:6;4383:30;4380:50;;;4426:1;4423;4416:12;4380:50;4449:22;;4502:4;4494:13;;4490:27;-1:-1:-1;4480:55:1;;4531:1;4528;4521:12;4480:55;4554:74;4620:7;4615:2;4602:16;4597:2;4593;4589:11;4554:74;:::i;4639:667::-;4734:6;4742;4750;4758;4811:3;4799:9;4790:7;4786:23;4782:33;4779:53;;;4828:1;4825;4818:12;4779:53;4851:29;4870:9;4851:29;:::i;:::-;4841:39;;4899:38;4933:2;4922:9;4918:18;4899:38;:::i;:::-;4889:48;;4984:2;4973:9;4969:18;4956:32;4946:42;;5039:2;5028:9;5024:18;5011:32;5066:18;5058:6;5055:30;5052:50;;;5098:1;5095;5088:12;5052:50;5121:22;;5174:4;5166:13;;5162:27;-1:-1:-1;5152:55:1;;5203:1;5200;5193:12;5152:55;5226:74;5292:7;5287:2;5274:16;5269:2;5265;5261:11;5226:74;:::i;:::-;5216:84;;;4639:667;;;;;;;:::o;5311:326::-;5404:5;5427:1;5437:194;5451:4;5448:1;5445:11;5437:194;;;5510:13;;5498:26;;5547:4;5571:12;;;;5606:15;;;;5471:1;5464:9;5437:194;;5642:242;5822:3;5807:19;;5835:43;5811:9;5860:6;5835:43;:::i;5889:260::-;5957:6;5965;6018:2;6006:9;5997:7;5993:23;5989:32;5986:52;;;6034:1;6031;6024:12;5986:52;6057:29;6076:9;6057:29;:::i;:::-;6047:39;;6105:38;6139:2;6128:9;6124:18;6105:38;:::i;:::-;6095:48;;5889:260;;;;;:::o;6154:127::-;6215:10;6210:3;6206:20;6203:1;6196:31;6246:4;6243:1;6236:15;6270:4;6267:1;6260:15;6286:287;6415:3;6453:6;6447:13;6469:66;6528:6;6523:3;6516:4;6508:6;6504:17;6469:66;:::i;:::-;6551:16;;;;;6286:287;-1:-1:-1;;6286:287:1:o;6578:184::-;6648:6;6701:2;6689:9;6680:7;6676:23;6672:32;6669:52;;;6717:1;6714;6707:12;6669:52;-1:-1:-1;6740:16:1;;6578:184;-1:-1:-1;6578:184:1:o;6767:127::-;6828:10;6823:3;6819:20;6816:1;6809:31;6859:4;6856:1;6849:15;6883:4;6880:1;6873:15;6899:135;6938:3;6959:17;;;6956:43;;6979:18;;:::i;:::-;-1:-1:-1;7026:1:1;7015:13;;6899:135::o;7039:380::-;7118:1;7114:12;;;;7161;;;7182:61;;7236:4;7228:6;7224:17;7214:27;;7182:61;7289:2;7281:6;7278:14;7258:18;7255:38;7252:161;;7335:10;7330:3;7326:20;7323:1;7316:31;7370:4;7367:1;7360:15;7398:4;7395:1;7388:15;7252:161;;7039:380;;;:::o;8813:128::-;8880:9;;;8901:11;;;8898:37;;;8915:18;;:::i;9878:209::-;9910:1;9936;9926:132;;9980:10;9975:3;9971:20;9968:1;9961:31;10015:4;10012:1;10005:15;10043:4;10040:1;10033:15;9926:132;-1:-1:-1;10072:9:1;;9878:209::o;11127:125::-;11192:9;;;11213:10;;;11210:36;;;11226:18;;:::i;11730:545::-;11832:2;11827:3;11824:11;11821:448;;;11868:1;11893:5;11889:2;11882:17;11938:4;11934:2;11924:19;12008:2;11996:10;11992:19;11989:1;11985:27;11979:4;11975:38;12044:4;12032:10;12029:20;12026:47;;;-1:-1:-1;12067:4:1;12026:47;12122:2;12117:3;12113:12;12110:1;12106:20;12100:4;12096:31;12086:41;;12177:82;12195:2;12188:5;12185:13;12177:82;;;12240:17;;;12221:1;12210:13;12177:82;;12451:1352;12577:3;12571:10;12604:18;12596:6;12593:30;12590:56;;;12626:18;;:::i;:::-;12655:97;12745:6;12705:38;12737:4;12731:11;12705:38;:::i;:::-;12699:4;12655:97;:::i;:::-;12807:4;;12871:2;12860:14;;12888:1;12883:663;;;;13590:1;13607:6;13604:89;;;-1:-1:-1;13659:19:1;;;13653:26;13604:89;-1:-1:-1;;12408:1:1;12404:11;;;12400:24;12396:29;12386:40;12432:1;12428:11;;;12383:57;13706:81;;12853:944;;12883:663;11677:1;11670:14;;;11714:4;11701:18;;-1:-1:-1;;12919:20:1;;;13037:236;13051:7;13048:1;13045:14;13037:236;;;13140:19;;;13134:26;13119:42;;13232:27;;;;13200:1;13188:14;;;;13067:19;;13037:236;;;13041:3;13301:6;13292:7;13289:19;13286:201;;;13362:19;;;13356:26;-1:-1:-1;;13445:1:1;13441:14;;;13457:3;13437:24;13433:37;13429:42;13414:58;13399:74;;13286:201;-1:-1:-1;;;;;13533:1:1;13517:14;;;13513:22;13500:36;;-1:-1:-1;12451:1352:1:o;14148:127::-;14209:10;14204:3;14200:20;14197:1;14190:31;14240:4;14237:1;14230:15;14264:4;14261:1;14254:15;14629:1193;14840:4;14869:3;14899:6;14888:9;14881:25;14925:2;14936:52;14984:2;14973:9;14969:18;14961:6;14936:52;:::i;:::-;15025:2;15019:3;15008:9;15004:19;14997:31;15048:1;15081:6;15075:13;15111:36;15137:9;15111:36;:::i;:::-;15163:18;;;15156:34;;;15209:3;;15231:1;15248:18;;;15275:158;;;;15447:1;15442:354;;;;15241:555;;15275:158;-1:-1:-1;;15323:24:1;;15303:18;;;15296:52;15401:14;;15394:22;15391:1;15387:30;15372:46;;15368:55;;;-1:-1:-1;15275:158:1;;15442:354;15473:6;15470:1;15463:17;15521:2;15518:1;15508:16;15546:1;15560:180;15574:6;15571:1;15568:13;15560:180;;;15667:14;;15643:17;;;15639:26;;15632:50;15710:16;;;;15589:10;;15560:180;;;15764:17;;15760:26;;;-1:-1:-1;;15241:555:1;-1:-1:-1;15813:3:1;;14629:1193;-1:-1:-1;;;;;;;;;;14629:1193:1:o;15827:649::-;15907:6;15960:2;15948:9;15939:7;15935:23;15931:32;15928:52;;;15976:1;15973;15966:12;15928:52;16009:9;16003:16;16042:18;16034:6;16031:30;16028:50;;;16074:1;16071;16064:12;16028:50;16097:22;;16150:4;16142:13;;16138:27;-1:-1:-1;16128:55:1;;16179:1;16176;16169:12;16128:55;16208:2;16202:9;16233:49;16249:32;16278:2;16249:32;:::i;16233:49::-;16305:2;16298:5;16291:17;16345:7;16340:2;16335;16331;16327:11;16323:20;16320:33;16317:53;;;16366:1;16363;16356:12;16317:53;16379:67;16443:2;16438;16431:5;16427:14;16422:2;16418;16414:11;16379:67;:::i;:::-;16465:5;15827:649;-1:-1:-1;;;;;15827:649:1:o;16877:489::-;-1:-1:-1;;;;;17146:15:1;;;17128:34;;17198:15;;17193:2;17178:18;;17171:43;17245:2;17230:18;;17223:34;;;17293:3;17288:2;17273:18;;17266:31;;;17071:4;;17314:46;;17340:19;;17332:6;17314:46;:::i;:::-;17306:54;16877:489;-1:-1:-1;;;;;;16877:489:1:o;17371:249::-;17440:6;17493:2;17481:9;17472:7;17468:23;17464:32;17461:52;;;17509:1;17506;17499:12;17461:52;17541:9;17535:16;17560:30;17584:5;17560:30;:::i
Swarm Source
ipfs://6e96bcce39eaf1e551173e5f5f3570f0a3b79bb9996a4889cbe2dc27d72b446d
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.