Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00Latest 1 from a total of 1 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Safe Mint | 13362111 | 291 days ago | IN | 0 ETH | 0.00000002 |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
BTCUNIZoomMascot
Compiler Version
v0.8.28+commit.7893614a
Contract Source Code (Solidity)
/**
*Submitted for verification at uniscan.xyz on 2025-04-08
*/
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File: @openzeppelin/contracts/token/ERC721/IERC721.sol
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.20;
/**
* @dev Required interface of an ERC-721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
* a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC-721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or
* {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
* a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the address zero.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.20;
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.20;
/**
* @title ERC-721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC-721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be
* reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
// File: @openzeppelin/contracts/interfaces/draft-IERC6093.sol
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard ERC-20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Standard ERC-721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
error ERC721InvalidOwner(address owner);
/**
* @dev Indicates a `tokenId` whose `owner` is the zero address.
* @param tokenId Identifier number of a token.
*/
error ERC721NonexistentToken(uint256 tokenId);
/**
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param tokenId Identifier number of a token.
* @param owner Address of the current owner of a token.
*/
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC721InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC721InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param tokenId Identifier number of a token.
*/
error ERC721InsufficientApproval(address operator, uint256 tokenId);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC721InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC721InvalidOperator(address operator);
}
/**
* @dev Standard ERC-1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.
*/
interface IERC1155Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
* @param tokenId Identifier number of a token.
*/
error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC1155InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC1155InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC1155InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC1155InvalidOperator(address operator);
/**
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
* Used in batch transfers.
* @param idsLength Length of the array of token identifiers
* @param valuesLength Length of the array of token amounts
*/
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}
// File: @openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/utils/ERC721Utils.sol)
pragma solidity ^0.8.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 {IERC721-onERC721Received}
* on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).
*
* The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).
* Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept
* the transfer.
*/
function checkOnERC721Received(
address operator,
address from,
address to,
uint256 tokenId,
bytes memory data
) internal {
if (to.code.length > 0) {
try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) {
if (retval != IERC721Receiver.onERC721Received.selector) {
// Token rejected
revert IERC721Errors.ERC721InvalidReceiver(to);
}
} catch (bytes memory reason) {
if (reason.length == 0) {
// non-IERC721Receiver implementer
revert IERC721Errors.ERC721InvalidReceiver(to);
} else {
assembly ("memory-safe") {
revert(add(32, reason), mload(reason))
}
}
}
}
}
}
// File: @openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.20;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Storage of the initializable contract.
*
* It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
* when using with upgradeable contracts.
*
* @custom:storage-location erc7201:openzeppelin.storage.Initializable
*/
struct InitializableStorage {
/**
* @dev Indicates that the contract has been initialized.
*/
uint64 _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool _initializing;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;
/**
* @dev The contract is already initialized.
*/
error InvalidInitialization();
/**
* @dev The contract is not initializing.
*/
error NotInitializing();
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint64 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
* number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
* production.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
// Cache values to avoid duplicated sloads
bool isTopLevelCall = !$._initializing;
uint64 initialized = $._initialized;
// Allowed calls:
// - initialSetup: the contract is not in the initializing state and no previous version was
// initialized
// - construction: the contract is initialized at version 1 (no reininitialization) and the
// current contract is just being deployed
bool initialSetup = initialized == 0 && isTopLevelCall;
bool construction = initialized == 1 && address(this).code.length == 0;
if (!initialSetup && !construction) {
revert InvalidInitialization();
}
$._initialized = 1;
if (isTopLevelCall) {
$._initializing = true;
}
_;
if (isTopLevelCall) {
$._initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint64 version) {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing || $._initialized >= version) {
revert InvalidInitialization();
}
$._initialized = version;
$._initializing = true;
_;
$._initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
_checkInitializing();
_;
}
/**
* @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
*/
function _checkInitializing() internal view virtual {
if (!_isInitializing()) {
revert NotInitializing();
}
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing) {
revert InvalidInitialization();
}
if ($._initialized != type(uint64).max) {
$._initialized = type(uint64).max;
emit Initialized(type(uint64).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint64) {
return _getInitializableStorage()._initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _getInitializableStorage()._initializing;
}
/**
* @dev Returns a pointer to the storage namespace.
*/
// solhint-disable-next-line var-name-mixedcase
function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
assembly {
$.slot := INITIALIZABLE_STORAGE
}
}
}
// File: @openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.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 ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
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.1.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 Returns the addition of two unsigned integers, with an success flag (no overflow).
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a success flag (no division by zero).
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.
*
* IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.
* However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute
* one branch when needed, making this function more expensive.
*/
function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {
unchecked {
// branchless ternary works because:
// b ^ (a ^ b) == a
// b ^ 0 == b
return b ^ ((a ^ b) * SafeCast.toUint(condition));
}
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return ternary(a > b, a, b);
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return ternary(a < b, a, b);
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
Panic.panic(Panic.DIVISION_BY_ZERO);
}
// The following calculation ensures accurate ceiling division without overflow.
// Since a is non-zero, (a - 1) / b will not overflow.
// The largest possible result occurs when (a - 1) / b is type(uint256).max,
// but the largest value we can obtain is type(uint256).max - 1, which happens
// when a = type(uint256).max and b = 1.
unchecked {
return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);
}
}
/**
* @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
*
* Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
* Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use
// the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2²⁵⁶ + prod0.
uint256 prod0 = x * y; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.
if (denominator <= prod1) {
Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));
}
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator.
// Always >= 1. See https://cs.stackexchange.com/q/138556/92363.
uint256 twos = denominator & (0 - denominator);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2²⁵⁶ / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such
// that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv ≡ 1 mod 2⁴.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
// works in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2⁸
inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶
inverse *= 2 - denominator * inverse; // inverse mod 2³²
inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴
inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸
inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2²⁵⁶. Since the preconditions guarantee that the outcome is
// less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @dev Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);
}
/**
* @dev Calculate the modular multiplicative inverse of a number in Z/nZ.
*
* If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.
* If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.
*
* If the input value is not inversible, 0 is returned.
*
* NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the
* inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.
*/
function invMod(uint256 a, uint256 n) internal pure returns (uint256) {
unchecked {
if (n == 0) return 0;
// The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)
// Used to compute integers x and y such that: ax + ny = gcd(a, n).
// When the gcd is 1, then the inverse of a modulo n exists and it's x.
// ax + ny = 1
// ax = 1 + (-y)n
// ax ≡ 1 (mod n) # x is the inverse of a modulo n
// If the remainder is 0 the gcd is n right away.
uint256 remainder = a % n;
uint256 gcd = n;
// Therefore the initial coefficients are:
// ax + ny = gcd(a, n) = n
// 0a + 1n = n
int256 x = 0;
int256 y = 1;
while (remainder != 0) {
uint256 quotient = gcd / remainder;
(gcd, remainder) = (
// The old remainder is the next gcd to try.
remainder,
// Compute the next remainder.
// Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd
// where gcd is at most n (capped to type(uint256).max)
gcd - remainder * quotient
);
(x, y) = (
// Increment the coefficient of a.
y,
// Decrement the coefficient of n.
// Can overflow, but the result is casted to uint256 so that the
// next value of y is "wrapped around" to a value between 0 and n - 1.
x - y * int256(quotient)
);
}
if (gcd != 1) return 0; // No inverse exists.
return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.
}
}
/**
* @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.
*
* From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is
* prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that
* `a**(p-2)` is the modular multiplicative inverse of a in Fp.
*
* NOTE: this function does NOT check that `p` is a prime greater than `2`.
*/
function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {
unchecked {
return Math.modExp(a, p - 2, p);
}
}
/**
* @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)
*
* Requirements:
* - modulus can't be zero
* - underlying staticcall to precompile must succeed
*
* IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make
* sure the chain you're using it on supports the precompiled contract for modular exponentiation
* at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,
* the underlying function will succeed given the lack of a revert, but the result may be incorrectly
* interpreted as 0.
*/
function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {
(bool success, uint256 result) = tryModExp(b, e, m);
if (!success) {
Panic.panic(Panic.DIVISION_BY_ZERO);
}
return result;
}
/**
* @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).
* It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying
* to operate modulo 0 or if the underlying precompile reverted.
*
* IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain
* you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in
* https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack
* of a revert, but the result may be incorrectly interpreted as 0.
*/
function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {
if (m == 0) return (false, 0);
assembly ("memory-safe") {
let ptr := mload(0x40)
// | Offset | Content | Content (Hex) |
// |-----------|------------|--------------------------------------------------------------------|
// | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |
// | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |
// | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |
// | 0x60:0x7f | value of b | 0x<.............................................................b> |
// | 0x80:0x9f | value of e | 0x<.............................................................e> |
// | 0xa0:0xbf | value of m | 0x<.............................................................m> |
mstore(ptr, 0x20)
mstore(add(ptr, 0x20), 0x20)
mstore(add(ptr, 0x40), 0x20)
mstore(add(ptr, 0x60), b)
mstore(add(ptr, 0x80), e)
mstore(add(ptr, 0xa0), m)
// Given the result < m, it's guaranteed to fit in 32 bytes,
// so we can use the memory scratch space located at offset 0.
success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)
result := mload(0x00)
}
}
/**
* @dev Variant of {modExp} that supports inputs of arbitrary length.
*/
function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {
(bool success, bytes memory result) = tryModExp(b, e, m);
if (!success) {
Panic.panic(Panic.DIVISION_BY_ZERO);
}
return result;
}
/**
* @dev Variant of {tryModExp} that supports inputs of arbitrary length.
*/
function tryModExp(
bytes memory b,
bytes memory e,
bytes memory m
) internal view returns (bool success, bytes memory result) {
if (_zeroBytes(m)) return (false, new bytes(0));
uint256 mLen = m.length;
// Encode call args in result and move the free memory pointer
result = abi.encodePacked(b.length, e.length, mLen, b, e, m);
assembly ("memory-safe") {
let dataPtr := add(result, 0x20)
// Write result on top of args to avoid allocating extra memory.
success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)
// Overwrite the length.
// result.length > returndatasize() is guaranteed because returndatasize() == m.length
mstore(result, mLen)
// Set the memory pointer after the returned data.
mstore(0x40, add(dataPtr, mLen))
}
}
/**
* @dev Returns whether the provided byte array is zero.
*/
function _zeroBytes(bytes memory byteArray) private pure returns (bool) {
for (uint256 i = 0; i < byteArray.length; ++i) {
if (byteArray[i] != 0) {
return false;
}
}
return true;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* This method is based on Newton's method for computing square roots; the algorithm is restricted to only
* using integer operations.
*/
function sqrt(uint256 a) internal pure returns (uint256) {
unchecked {
// Take care of easy edge cases when a == 0 or a == 1
if (a <= 1) {
return a;
}
// In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a
// sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between
// the current value as `ε_n = | x_n - sqrt(a) |`.
//
// For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root
// of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is
// bigger than any uint256.
//
// By noticing that
// `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`
// we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar
// to the msb function.
uint256 aa = a;
uint256 xn = 1;
if (aa >= (1 << 128)) {
aa >>= 128;
xn <<= 64;
}
if (aa >= (1 << 64)) {
aa >>= 64;
xn <<= 32;
}
if (aa >= (1 << 32)) {
aa >>= 32;
xn <<= 16;
}
if (aa >= (1 << 16)) {
aa >>= 16;
xn <<= 8;
}
if (aa >= (1 << 8)) {
aa >>= 8;
xn <<= 4;
}
if (aa >= (1 << 4)) {
aa >>= 4;
xn <<= 2;
}
if (aa >= (1 << 2)) {
xn <<= 1;
}
// We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).
//
// We can refine our estimation by noticing that the middle of that interval minimizes the error.
// If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).
// This is going to be our x_0 (and ε_0)
xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)
// From here, Newton's method give us:
// x_{n+1} = (x_n + a / x_n) / 2
//
// One should note that:
// x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a
// = ((x_n² + a) / (2 * x_n))² - a
// = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a
// = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)
// = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)
// = (x_n² - a)² / (2 * x_n)²
// = ((x_n² - a) / (2 * x_n))²
// ≥ 0
// Which proves that for all n ≥ 1, sqrt(a) ≤ x_n
//
// This gives us the proof of quadratic convergence of the sequence:
// ε_{n+1} = | x_{n+1} - sqrt(a) |
// = | (x_n + a / x_n) / 2 - sqrt(a) |
// = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |
// = | (x_n - sqrt(a))² / (2 * x_n) |
// = | ε_n² / (2 * x_n) |
// = ε_n² / | (2 * x_n) |
//
// For the first iteration, we have a special case where x_0 is known:
// ε_1 = ε_0² / | (2 * x_0) |
// ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))
// ≤ 2**(2*e-4) / (3 * 2**(e-1))
// ≤ 2**(e-3) / 3
// ≤ 2**(e-3-log2(3))
// ≤ 2**(e-4.5)
//
// For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:
// ε_{n+1} = ε_n² / | (2 * x_n) |
// ≤ (2**(e-k))² / (2 * 2**(e-1))
// ≤ 2**(2*e-2*k) / 2**e
// ≤ 2**(e-2*k)
xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above
xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5
xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9
xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18
xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36
xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72
// Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision
// ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either
// sqrt(a) or sqrt(a) + 1.
return xn - SafeCast.toUint(xn > a / xn);
}
}
/**
* @dev Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
uint256 exp;
unchecked {
exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);
value >>= exp;
result += exp;
exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);
value >>= exp;
result += exp;
exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);
value >>= exp;
result += exp;
exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);
value >>= exp;
result += exp;
exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);
value >>= exp;
result += exp;
exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);
value >>= exp;
result += exp;
exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);
value >>= exp;
result += exp;
result += SafeCast.toUint(value > 1);
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
uint256 isGt;
unchecked {
isGt = SafeCast.toUint(value > (1 << 128) - 1);
value >>= isGt * 128;
result += isGt * 16;
isGt = SafeCast.toUint(value > (1 << 64) - 1);
value >>= isGt * 64;
result += isGt * 8;
isGt = SafeCast.toUint(value > (1 << 32) - 1);
value >>= isGt * 32;
result += isGt * 4;
isGt = SafeCast.toUint(value > (1 << 16) - 1);
value >>= isGt * 16;
result += isGt * 2;
result += SafeCast.toUint(value > (1 << 8) - 1);
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}
// File: @openzeppelin/contracts/utils/math/SignedMath.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.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.2.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;
/**
* @dev The `value` string doesn't fit in the specified `length`.
*/
error StringsInsufficientHexLength(uint256 value, uint256 length);
/**
* @dev The string being parsed contains characters that are not in scope of the given base.
*/
error StringsInvalidChar();
/**
* @dev The string being parsed is not a properly formatted address.
*/
error StringsInvalidAddressFormat();
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
assembly ("memory-safe") {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
assembly ("memory-safe") {
mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toStringSigned(int256 value) internal pure returns (string memory) {
return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
uint256 localValue = value;
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = HEX_DIGITS[localValue & 0xf];
localValue >>= 4;
}
if (localValue != 0) {
revert StringsInsufficientHexLength(value, length);
}
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
* representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal
* representation, according to EIP-55.
*/
function toChecksumHexString(address addr) internal pure returns (string memory) {
bytes memory buffer = bytes(toHexString(addr));
// hash the hex part of buffer (skip length + 2 bytes, length 40)
uint256 hashValue;
assembly ("memory-safe") {
hashValue := shr(96, keccak256(add(buffer, 0x22), 40))
}
for (uint256 i = 41; i > 1; --i) {
// possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)
if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {
// case shift by xoring with 0x20
buffer[i] ^= 0x20;
}
hashValue >>= 4;
}
return string(buffer);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
}
/**
* @dev Parse a decimal string and returns the value as a `uint256`.
*
* Requirements:
* - The string must be formatted as `[0-9]*`
* - The result must fit into an `uint256` type
*/
function parseUint(string memory input) internal pure returns (uint256) {
return parseUint(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseUint} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `[0-9]*`
* - The result must fit into an `uint256` type
*/
function parseUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {
(bool success, uint256 value) = tryParseUint(input, begin, end);
if (!success) revert StringsInvalidChar();
return value;
}
/**
* @dev Variant of {parseUint-string} that returns false if the parsing fails because of an invalid character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseUint(string memory input) internal pure returns (bool success, uint256 value) {
return _tryParseUintUncheckedBounds(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseUint-string-uint256-uint256} that returns false if the parsing fails because of an invalid
* character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseUint(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, uint256 value) {
if (end > bytes(input).length || begin > end) return (false, 0);
return _tryParseUintUncheckedBounds(input, begin, end);
}
/**
* @dev Implementation of {tryParseUint} that does not check bounds. Caller should make sure that
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
*/
function _tryParseUintUncheckedBounds(
string memory input,
uint256 begin,
uint256 end
) private pure returns (bool success, uint256 value) {
bytes memory buffer = bytes(input);
uint256 result = 0;
for (uint256 i = begin; i < end; ++i) {
uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));
if (chr > 9) return (false, 0);
result *= 10;
result += chr;
}
return (true, result);
}
/**
* @dev Parse a decimal string and returns the value as a `int256`.
*
* Requirements:
* - The string must be formatted as `[-+]?[0-9]*`
* - The result must fit in an `int256` type.
*/
function parseInt(string memory input) internal pure returns (int256) {
return parseInt(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseInt-string} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `[-+]?[0-9]*`
* - The result must fit in an `int256` type.
*/
function parseInt(string memory input, uint256 begin, uint256 end) internal pure returns (int256) {
(bool success, int256 value) = tryParseInt(input, begin, end);
if (!success) revert StringsInvalidChar();
return value;
}
/**
* @dev Variant of {parseInt-string} that returns false if the parsing fails because of an invalid character or if
* the result does not fit in a `int256`.
*
* NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.
*/
function tryParseInt(string memory input) internal pure returns (bool success, int256 value) {
return _tryParseIntUncheckedBounds(input, 0, bytes(input).length);
}
uint256 private constant ABS_MIN_INT256 = 2 ** 255;
/**
* @dev Variant of {parseInt-string-uint256-uint256} that returns false if the parsing fails because of an invalid
* character or if the result does not fit in a `int256`.
*
* NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.
*/
function tryParseInt(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, int256 value) {
if (end > bytes(input).length || begin > end) return (false, 0);
return _tryParseIntUncheckedBounds(input, begin, end);
}
/**
* @dev Implementation of {tryParseInt} that does not check bounds. Caller should make sure that
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
*/
function _tryParseIntUncheckedBounds(
string memory input,
uint256 begin,
uint256 end
) private pure returns (bool success, int256 value) {
bytes memory buffer = bytes(input);
// Check presence of a negative sign.
bytes1 sign = begin == end ? bytes1(0) : bytes1(_unsafeReadBytesOffset(buffer, begin)); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
bool positiveSign = sign == bytes1("+");
bool negativeSign = sign == bytes1("-");
uint256 offset = (positiveSign || negativeSign).toUint();
(bool absSuccess, uint256 absValue) = tryParseUint(input, begin + offset, end);
if (absSuccess && absValue < ABS_MIN_INT256) {
return (true, negativeSign ? -int256(absValue) : int256(absValue));
} else if (absSuccess && negativeSign && absValue == ABS_MIN_INT256) {
return (true, type(int256).min);
} else return (false, 0);
}
/**
* @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as a `uint256`.
*
* Requirements:
* - The string must be formatted as `(0x)?[0-9a-fA-F]*`
* - The result must fit in an `uint256` type.
*/
function parseHexUint(string memory input) internal pure returns (uint256) {
return parseHexUint(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseHexUint} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `(0x)?[0-9a-fA-F]*`
* - The result must fit in an `uint256` type.
*/
function parseHexUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {
(bool success, uint256 value) = tryParseHexUint(input, begin, end);
if (!success) revert StringsInvalidChar();
return value;
}
/**
* @dev Variant of {parseHexUint-string} that returns false if the parsing fails because of an invalid character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseHexUint(string memory input) internal pure returns (bool success, uint256 value) {
return _tryParseHexUintUncheckedBounds(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseHexUint-string-uint256-uint256} that returns false if the parsing fails because of an
* invalid character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseHexUint(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, uint256 value) {
if (end > bytes(input).length || begin > end) return (false, 0);
return _tryParseHexUintUncheckedBounds(input, begin, end);
}
/**
* @dev Implementation of {tryParseHexUint} that does not check bounds. Caller should make sure that
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
*/
function _tryParseHexUintUncheckedBounds(
string memory input,
uint256 begin,
uint256 end
) private pure returns (bool success, uint256 value) {
bytes memory buffer = bytes(input);
// skip 0x prefix if present
bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(buffer, begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
uint256 offset = hasPrefix.toUint() * 2;
uint256 result = 0;
for (uint256 i = begin + offset; i < end; ++i) {
uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));
if (chr > 15) return (false, 0);
result *= 16;
unchecked {
// Multiplying by 16 is equivalent to a shift of 4 bits (with additional overflow check).
// This guaratees that adding a value < 16 will not cause an overflow, hence the unchecked.
result += chr;
}
}
return (true, result);
}
/**
* @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as an `address`.
*
* Requirements:
* - The string must be formatted as `(0x)?[0-9a-fA-F]{40}`
*/
function parseAddress(string memory input) internal pure returns (address) {
return parseAddress(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseAddress} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `(0x)?[0-9a-fA-F]{40}`
*/
function parseAddress(string memory input, uint256 begin, uint256 end) internal pure returns (address) {
(bool success, address value) = tryParseAddress(input, begin, end);
if (!success) revert StringsInvalidAddressFormat();
return value;
}
/**
* @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly
* formatted address. See {parseAddress} requirements.
*/
function tryParseAddress(string memory input) internal pure returns (bool success, address value) {
return tryParseAddress(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly
* formatted address. See {parseAddress} requirements.
*/
function tryParseAddress(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, address value) {
if (end > bytes(input).length || begin > end) return (false, address(0));
bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(bytes(input), begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
uint256 expectedLength = 40 + hasPrefix.toUint() * 2;
// check that input is the correct length
if (end - begin == expectedLength) {
// length guarantees that this does not overflow, and value is at most type(uint160).max
(bool s, uint256 v) = _tryParseHexUintUncheckedBounds(input, begin, end);
return (s, address(uint160(v)));
} else {
return (false, address(0));
}
}
function _tryParseChr(bytes1 chr) private pure returns (uint8) {
uint8 value = uint8(chr);
// Try to parse `chr`:
// - Case 1: [0-9]
// - Case 2: [a-f]
// - Case 3: [A-F]
// - otherwise not supported
unchecked {
if (value > 47 && value < 58) value -= 48;
else if (value > 96 && value < 103) value -= 87;
else if (value > 64 && value < 71) value -= 55;
else return type(uint8).max;
}
return value;
}
/**
* @dev Reads a bytes32 from a bytes array without bounds checking.
*
* NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the
* assembly block as such would prevent some optimizations.
*/
function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {
// This is not memory safe in the general case, but all calls to this private function are within bounds.
assembly ("memory-safe") {
value := mload(add(buffer, add(0x20, offset)))
}
}
}
// File: @openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol
// OpenZeppelin Contracts (last updated v5.1.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 ERC165Upgradeable is Initializable, IERC165 {
function __ERC165_init() internal onlyInitializing {
}
function __ERC165_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// File: @openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol
// OpenZeppelin Contracts (last updated v5.1.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 ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721, IERC721Metadata, IERC721Errors {
using Strings for uint256;
/// @custom:storage-location erc7201:openzeppelin.storage.ERC721
struct ERC721Storage {
// Token name
string _name;
// Token symbol
string _symbol;
mapping(uint256 tokenId => address) _owners;
mapping(address owner => uint256) _balances;
mapping(uint256 tokenId => address) _tokenApprovals;
mapping(address owner => mapping(address operator => bool)) _operatorApprovals;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC721")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant ERC721StorageLocation = 0x80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079300;
function _getERC721Storage() private pure returns (ERC721Storage storage $) {
assembly {
$.slot := ERC721StorageLocation
}
}
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing {
__ERC721_init_unchained(name_, symbol_);
}
function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
ERC721Storage storage $ = _getERC721Storage();
$._name = name_;
$._symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual returns (uint256) {
ERC721Storage storage $ = _getERC721Storage();
if (owner == address(0)) {
revert ERC721InvalidOwner(address(0));
}
return $._balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual returns (address) {
return _requireOwned(tokenId);
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual returns (string memory) {
ERC721Storage storage $ = _getERC721Storage();
return $._name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual returns (string memory) {
ERC721Storage storage $ = _getERC721Storage();
return $._symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual returns (string memory) {
_requireOwned(tokenId);
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual {
_approve(to, tokenId, _msgSender());
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual returns (address) {
_requireOwned(tokenId);
return _getApproved(tokenId);
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {
ERC721Storage storage $ = _getERC721Storage();
return $._operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(address from, address to, uint256 tokenId) public virtual {
if (to == address(0)) {
revert ERC721InvalidReceiver(address(0));
}
// Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists
// (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.
address previousOwner = _update(to, tokenId, _msgSender());
if (previousOwner != from) {
revert ERC721IncorrectOwner(from, tokenId, previousOwner);
}
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) public {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {
transferFrom(from, to, tokenId);
ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);
}
/**
* @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
*
* IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the
* core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances
* consistent with ownership. The invariant to preserve is that for any address `a` the value returned by
* `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.
*/
function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
ERC721Storage storage $ = _getERC721Storage();
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) {
ERC721Storage storage $ = _getERC721Storage();
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 {
ERC721Storage storage $ = _getERC721Storage();
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) {
ERC721Storage storage $ = _getERC721Storage();
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 {
ERC721Storage storage $ = _getERC721Storage();
// 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 {
ERC721Storage storage $ = _getERC721Storage();
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-upgradeable/token/ERC721/extensions/ERC721BurnableUpgradeable.sol
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Burnable.sol)
pragma solidity ^0.8.20;
/**
* @title ERC-721 Burnable Token
* @dev ERC-721 Token that can be burned (destroyed).
*/
abstract contract ERC721BurnableUpgradeable is Initializable, ContextUpgradeable, ERC721Upgradeable {
function __ERC721Burnable_init() internal onlyInitializing {
}
function __ERC721Burnable_init_unchained() internal onlyInitializing {
}
/**
* @dev Burns `tokenId`. See {ERC721-_burn}.
*
* Requirements:
*
* - The caller must own `tokenId` or be an approved operator.
*/
function burn(uint256 tokenId) public virtual {
// 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.
_update(address(0), tokenId, _msgSender());
}
}
// File: @openzeppelin/contracts/interfaces/IERC165.sol
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)
pragma solidity ^0.8.20;
// File: @openzeppelin/contracts/interfaces/IERC721.sol
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol)
pragma solidity ^0.8.20;
// File: @openzeppelin/contracts/interfaces/IERC4906.sol
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4906.sol)
pragma solidity ^0.8.20;
/// @title ERC-721 Metadata Update Extension
interface IERC4906 is IERC165, IERC721 {
/// @dev This event emits when the metadata of a token is changed.
/// So that the third-party platforms such as NFT market could
/// timely update the images and related attributes of the NFT.
event MetadataUpdate(uint256 _tokenId);
/// @dev This event emits when the metadata of a range of tokens is changed.
/// So that the third-party platforms such as NFT market could
/// timely update the images and related attributes of the NFTs.
event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);
}
// File: @openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721URIStorage.sol)
pragma solidity ^0.8.20;
/**
* @dev ERC-721 token with storage based token URI management.
*/
abstract contract ERC721URIStorageUpgradeable is Initializable, IERC4906, ERC721Upgradeable {
using Strings for uint256;
// Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only
// defines events and does not include any external function.
bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906);
/// @custom:storage-location erc7201:openzeppelin.storage.ERC721URIStorage
struct ERC721URIStorageStorage {
// Optional mapping for token URIs
mapping(uint256 tokenId => string) _tokenURIs;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC721URIStorage")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant ERC721URIStorageStorageLocation = 0x0542a41881ee128a365a727b282c86fa859579490b9bb45aab8503648c8e7900;
function _getERC721URIStorageStorage() private pure returns (ERC721URIStorageStorage storage $) {
assembly {
$.slot := ERC721URIStorageStorageLocation
}
}
function __ERC721URIStorage_init() internal onlyInitializing {
}
function __ERC721URIStorage_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Upgradeable, IERC165) returns (bool) {
return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
ERC721URIStorageStorage storage $ = _getERC721URIStorageStorage();
_requireOwned(tokenId);
string memory _tokenURI = $._tokenURIs[tokenId];
string memory base = _baseURI();
// If there is no base URI, return the token URI.
if (bytes(base).length == 0) {
return _tokenURI;
}
// If both are set, concatenate the baseURI and tokenURI (via string.concat).
if (bytes(_tokenURI).length > 0) {
return string.concat(base, _tokenURI);
}
return super.tokenURI(tokenId);
}
/**
* @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
*
* Emits {MetadataUpdate}.
*/
function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {
ERC721URIStorageStorage storage $ = _getERC721URIStorageStorage();
$._tokenURIs[tokenId] = _tokenURI;
emit MetadataUpdate(tokenId);
}
}
// File: @openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
/// @custom:storage-location erc7201:openzeppelin.storage.Ownable
struct OwnableStorage {
address _owner;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;
function _getOwnableStorage() private pure returns (OwnableStorage storage $) {
assembly {
$.slot := OwnableStorageLocation
}
}
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
function __Ownable_init(address initialOwner) internal onlyInitializing {
__Ownable_init_unchained(initialOwner);
}
function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
OwnableStorage storage $ = _getOwnableStorage();
return $._owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
OwnableStorage storage $ = _getOwnableStorage();
address oldOwner = $._owner;
$._owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File: contracts/btc-uni.sol
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity ^0.8.22;
contract BTCUNIZoomMascot is Initializable, ERC721Upgradeable, ERC721URIStorageUpgradeable, ERC721BurnableUpgradeable, OwnableUpgradeable {
uint256 private _nextTokenId;
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
function initialize(address initialOwner) public initializer {
__ERC721_init("BTC/UNI zoomMascot", "BUNIzoom");
__ERC721URIStorage_init();
__ERC721Burnable_init();
__Ownable_init(initialOwner);
}
function safeMint(address to, string memory uri)
public
onlyOwner
returns (uint256)
{
uint256 tokenId = _nextTokenId++;
_safeMint(to, tokenId);
_setTokenURI(tokenId, uri);
return tokenId;
}
// The following functions are overrides required by Solidity.
function tokenURI(uint256 tokenId)
public
view
override(ERC721Upgradeable, ERC721URIStorageUpgradeable)
returns (string memory)
{
return super.tokenURI(tokenId);
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721Upgradeable, ERC721URIStorageUpgradeable)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"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":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"initialOwner","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"string","name":"uri","type":"string"}],"name":"safeMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"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":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405234801561000f575f5ffd5b5061001e61002360201b60201c565b610183565b5f61003261012160201b60201c565b9050805f0160089054906101000a900460ff161561007c576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff8016815f015f9054906101000a900467ffffffffffffffff1667ffffffffffffffff161461011e5767ffffffffffffffff815f015f6101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055507fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d267ffffffffffffffff604051610115919061016a565b60405180910390a15b50565b5f7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00905090565b5f67ffffffffffffffff82169050919050565b61016481610148565b82525050565b5f60208201905061017d5f83018461015b565b92915050565b612b4c806101905f395ff3fe608060405234801561000f575f5ffd5b506004361061011f575f3560e01c8063715018a6116100ab578063c4d66de81161006f578063c4d66de8146102ef578063c87b56dd1461030b578063d204c45e1461033b578063e985e9c51461036b578063f2fde38b1461039b5761011f565b8063715018a6146102715780638da5cb5b1461027b57806395d89b4114610299578063a22cb465146102b7578063b88d4fde146102d35761011f565b806323b872dd116100f257806323b872dd146101bd57806342842e0e146101d957806342966c68146101f55780636352211e1461021157806370a08231146102415761011f565b806301ffc9a71461012357806306fdde0314610153578063081812fc14610171578063095ea7b3146101a1575b5f5ffd5b61013d60048036038101906101389190611f9d565b6103b7565b60405161014a9190611fe2565b60405180910390f35b61015b6103c8565b6040516101689190612085565b60405180910390f35b61018b600480360381019061018691906120d8565b610465565b6040516101989190612142565b60405180910390f35b6101bb60048036038101906101b69190612185565b610480565b005b6101d760048036038101906101d291906121c3565b610496565b005b6101f360048036038101906101ee91906121c3565b610595565b005b61020f600480360381019061020a91906120d8565b6105b4565b005b61022b600480360381019061022691906120d8565b6105ca565b6040516102389190612142565b60405180910390f35b61025b60048036038101906102569190612213565b6105db565b604051610268919061224d565b60405180910390f35b61027961069f565b005b6102836106b2565b6040516102909190612142565b60405180910390f35b6102a16106e7565b6040516102ae9190612085565b60405180910390f35b6102d160048036038101906102cc9190612290565b610785565b005b6102ed60048036038101906102e891906123fa565b61079b565b005b61030960048036038101906103049190612213565b6107c0565b005b610325600480360381019061032091906120d8565b6109c5565b6040516103329190612085565b60405180910390f35b61035560048036038101906103509190612518565b6109d7565b604051610362919061224d565b60405180910390f35b61038560048036038101906103809190612572565b610a16565b6040516103929190611fe2565b60405180910390f35b6103b560048036038101906103b09190612213565b610ab2565b005b5f6103c182610b36565b9050919050565b60605f6103d3610b96565b9050805f0180546103e3906125dd565b80601f016020809104026020016040519081016040528092919081815260200182805461040f906125dd565b801561045a5780601f106104315761010080835404028352916020019161045a565b820191905f5260205f20905b81548152906001019060200180831161043d57829003601f168201915b505050505091505090565b5f61046f82610bbd565b5061047982610c43565b9050919050565b610492828261048d610c8a565b610c91565b5050565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610506575f6040517f64a0ae920000000000000000000000000000000000000000000000000000000081526004016104fd9190612142565b60405180910390fd5b5f6105198383610514610c8a565b610ca3565b90508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461058f578382826040517f64283d7b0000000000000000000000000000000000000000000000000000000081526004016105869392919061260d565b60405180910390fd5b50505050565b6105af83838360405180602001604052805f81525061079b565b505050565b6105c65f826105c1610c8a565b610ca3565b5050565b5f6105d482610bbd565b9050919050565b5f5f6105e5610b96565b90505f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610657575f6040517f89c62b6400000000000000000000000000000000000000000000000000000000815260040161064e9190612142565b60405180910390fd5b806003015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054915050919050565b6106a7610ec0565b6106b05f610f47565b565b5f5f6106bc611018565b9050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691505090565b60605f6106f2610b96565b9050806001018054610703906125dd565b80601f016020809104026020016040519081016040528092919081815260200182805461072f906125dd565b801561077a5780601f106107515761010080835404028352916020019161077a565b820191905f5260205f20905b81548152906001019060200180831161075d57829003601f168201915b505050505091505090565b610797610790610c8a565b838361103f565b5050565b6107a6848484610496565b6107ba6107b1610c8a565b858585856111b6565b50505050565b5f6107c9611362565b90505f815f0160089054906101000a900460ff161590505f825f015f9054906101000a900467ffffffffffffffff1690505f5f8267ffffffffffffffff161480156108115750825b90505f60018367ffffffffffffffff1614801561084457505f3073ffffffffffffffffffffffffffffffffffffffff163b145b905081158015610852575080155b15610889576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001855f015f6101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555083156108d6576001855f0160086101000a81548160ff0219169083151502179055505b61094a6040518060400160405280601281526020017f4254432f554e49207a6f6f6d4d6173636f7400000000000000000000000000008152506040518060400160405280600881526020017f42554e497a6f6f6d000000000000000000000000000000000000000000000000815250611389565b61095261139f565b61095a6113a9565b610963866113b3565b83156109bd575f855f0160086101000a81548160ff0219169083151502179055507fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d260016040516109b49190612697565b60405180910390a15b505050505050565b60606109d0826113c7565b9050919050565b5f6109e0610ec0565b5f5f5f8154809291906109f2906126dd565b919050559050610a0284826114e1565b610a0c81846114fe565b8091505092915050565b5f5f610a20610b96565b9050806005015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1691505092915050565b610aba610ec0565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610b2a575f6040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610b219190612142565b60405180910390fd5b610b3381610f47565b50565b5f634906490660e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610b8f5750610b8e82611565565b5b9050919050565b5f7f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079300905090565b5f5f610bc883611646565b90505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610c3a57826040517f7e273289000000000000000000000000000000000000000000000000000000008152600401610c31919061224d565b60405180910390fd5b80915050919050565b5f5f610c4d610b96565b9050806004015f8481526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b5f33905090565b610c9e838383600161168d565b505050565b5f5f610cad610b96565b90505f610cb985611646565b90505f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614610cfa57610cf981858761185a565b5b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610d8757610d395f865f5f61168d565b6001826003015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825403925050819055505b5f73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614610e08576001826003015f8873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055505b85826002015f8781526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550848673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a480925050509392505050565b610ec8610c8a565b73ffffffffffffffffffffffffffffffffffffffff16610ee66106b2565b73ffffffffffffffffffffffffffffffffffffffff1614610f4557610f09610c8a565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610f3c9190612142565b60405180910390fd5b565b5f610f50611018565b90505f815f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082825f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3505050565b5f7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300905090565b5f611048610b96565b90505f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036110ba57826040517f5b08ba180000000000000000000000000000000000000000000000000000000081526004016110b19190612142565b60405180910390fd5b81816005015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31846040516111a89190611fe2565b60405180910390a350505050565b5f8373ffffffffffffffffffffffffffffffffffffffff163b111561135b578273ffffffffffffffffffffffffffffffffffffffff1663150b7a02868685856040518563ffffffff1660e01b81526004016112149493929190612776565b6020604051808303815f875af192505050801561124f57506040513d601f19601f8201168201806040525081019061124c91906127d4565b60015b6112d0573d805f811461127d576040519150601f19603f3d011682016040523d82523d5f602084013e611282565b606091505b505f8151036112c857836040517f64a0ae920000000000000000000000000000000000000000000000000000000081526004016112bf9190612142565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461135957836040517f64a0ae920000000000000000000000000000000000000000000000000000000081526004016113509190612142565b60405180910390fd5b505b5050505050565b5f7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00905090565b61139161191d565b61139b828261195d565b5050565b6113a761191d565b565b6113b161191d565b565b6113bb61191d565b6113c481611998565b50565b60605f6113d2611a1c565b90506113dd83610bbd565b505f815f015f8581526020019081526020015f2080546113fc906125dd565b80601f0160208091040260200160405190810160405280929190818152602001828054611428906125dd565b80156114735780601f1061144a57610100808354040283529160200191611473565b820191905f5260205f20905b81548152906001019060200180831161145657829003601f168201915b505050505090505f611483611a43565b90505f815103611498578193505050506114dc565b5f825111156114cd5780826040516020016114b4929190612839565b60405160208183030381529060405293505050506114dc565b6114d685611a59565b93505050505b919050565b6114fa828260405180602001604052805f815250611abf565b5050565b5f611507611a1c565b905081815f015f8581526020019081526020015f20908161152891906129f3565b507ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce783604051611558919061224d565b60405180910390a1505050565b5f7f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061162f57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061163f575061163e82611ae2565b5b9050919050565b5f5f611650610b96565b9050806002015f8481526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b5f611696610b96565b905081806116d057505f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611802575f6116df85610bbd565b90505f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561174957508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b801561175c575061175a8185610a16565b155b1561179e57836040517fa9fbf51f0000000000000000000000000000000000000000000000000000000081526004016117959190612142565b60405180910390fd5b821561180057848673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b84816004015f8681526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050505050565b611865838383611b4b565b611918575f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036118d957806040517f7e2732890000000000000000000000000000000000000000000000000000000081526004016118d0919061224d565b60405180910390fd5b81816040517f177e802f00000000000000000000000000000000000000000000000000000000815260040161190f929190612ac2565b60405180910390fd5b505050565b611925611c0b565b61195b576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b61196561191d565b5f61196e610b96565b905082815f01908161198091906129f3565b508181600101908161199291906129f3565b50505050565b6119a061191d565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611a10575f6040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401611a079190612142565b60405180910390fd5b611a1981610f47565b50565b5f7f0542a41881ee128a365a727b282c86fa859579490b9bb45aab8503648c8e7900905090565b606060405180602001604052805f815250905090565b6060611a6482610bbd565b505f611a6e611a43565b90505f815111611a8c5760405180602001604052805f815250611ab7565b80611a9684611c29565b604051602001611aa7929190612839565b6040516020818303038152906040525b915050919050565b611ac98383611cf3565b611add611ad4610c8a565b5f8585856111b6565b505050565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c0257508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480611bc35750611bc28484610a16565b5b80611c0157508273ffffffffffffffffffffffffffffffffffffffff16611be983610c43565b73ffffffffffffffffffffffffffffffffffffffff16145b5b90509392505050565b5f611c14611362565b5f0160089054906101000a900460ff16905090565b60605f6001611c3784611de6565b0190505f8167ffffffffffffffff811115611c5557611c546122d6565b5b6040519080825280601f01601f191660200182016040528015611c875781602001600182028036833780820191505090505b5090505f82602001820190505b600115611ce8578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581611cdd57611cdc612ae9565b5b0494505f8503611c94575b819350505050919050565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611d63575f6040517f64a0ae92000000000000000000000000000000000000000000000000000000008152600401611d5a9190612142565b60405180910390fd5b5f611d6f83835f610ca3565b90505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611de1575f6040517f73c6ac6e000000000000000000000000000000000000000000000000000000008152600401611dd89190612142565b60405180910390fd5b505050565b5f5f5f90507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310611e42577a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008381611e3857611e37612ae9565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310611e7f576d04ee2d6d415b85acef81000000008381611e7557611e74612ae9565b5b0492506020810190505b662386f26fc100008310611eae57662386f26fc100008381611ea457611ea3612ae9565b5b0492506010810190505b6305f5e1008310611ed7576305f5e1008381611ecd57611ecc612ae9565b5b0492506008810190505b6127108310611efc576127108381611ef257611ef1612ae9565b5b0492506004810190505b60648310611f1f5760648381611f1557611f14612ae9565b5b0492506002810190505b600a8310611f2e576001810190505b80915050919050565b5f604051905090565b5f5ffd5b5f5ffd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611f7c81611f48565b8114611f86575f5ffd5b50565b5f81359050611f9781611f73565b92915050565b5f60208284031215611fb257611fb1611f40565b5b5f611fbf84828501611f89565b91505092915050565b5f8115159050919050565b611fdc81611fc8565b82525050565b5f602082019050611ff55f830184611fd3565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f5b83811015612032578082015181840152602081019050612017565b5f8484015250505050565b5f601f19601f8301169050919050565b5f61205782611ffb565b6120618185612005565b9350612071818560208601612015565b61207a8161203d565b840191505092915050565b5f6020820190508181035f83015261209d818461204d565b905092915050565b5f819050919050565b6120b7816120a5565b81146120c1575f5ffd5b50565b5f813590506120d2816120ae565b92915050565b5f602082840312156120ed576120ec611f40565b5b5f6120fa848285016120c4565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61212c82612103565b9050919050565b61213c81612122565b82525050565b5f6020820190506121555f830184612133565b92915050565b61216481612122565b811461216e575f5ffd5b50565b5f8135905061217f8161215b565b92915050565b5f5f6040838503121561219b5761219a611f40565b5b5f6121a885828601612171565b92505060206121b9858286016120c4565b9150509250929050565b5f5f5f606084860312156121da576121d9611f40565b5b5f6121e786828701612171565b93505060206121f886828701612171565b9250506040612209868287016120c4565b9150509250925092565b5f6020828403121561222857612227611f40565b5b5f61223584828501612171565b91505092915050565b612247816120a5565b82525050565b5f6020820190506122605f83018461223e565b92915050565b61226f81611fc8565b8114612279575f5ffd5b50565b5f8135905061228a81612266565b92915050565b5f5f604083850312156122a6576122a5611f40565b5b5f6122b385828601612171565b92505060206122c48582860161227c565b9150509250929050565b5f5ffd5b5f5ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61230c8261203d565b810181811067ffffffffffffffff8211171561232b5761232a6122d6565b5b80604052505050565b5f61233d611f37565b90506123498282612303565b919050565b5f67ffffffffffffffff821115612368576123676122d6565b5b6123718261203d565b9050602081019050919050565b828183375f83830152505050565b5f61239e6123998461234e565b612334565b9050828152602081018484840111156123ba576123b96122d2565b5b6123c584828561237e565b509392505050565b5f82601f8301126123e1576123e06122ce565b5b81356123f184826020860161238c565b91505092915050565b5f5f5f5f6080858703121561241257612411611f40565b5b5f61241f87828801612171565b945050602061243087828801612171565b9350506040612441878288016120c4565b925050606085013567ffffffffffffffff81111561246257612461611f44565b5b61246e878288016123cd565b91505092959194509250565b5f67ffffffffffffffff821115612494576124936122d6565b5b61249d8261203d565b9050602081019050919050565b5f6124bc6124b78461247a565b612334565b9050828152602081018484840111156124d8576124d76122d2565b5b6124e384828561237e565b509392505050565b5f82601f8301126124ff576124fe6122ce565b5b813561250f8482602086016124aa565b91505092915050565b5f5f6040838503121561252e5761252d611f40565b5b5f61253b85828601612171565b925050602083013567ffffffffffffffff81111561255c5761255b611f44565b5b612568858286016124eb565b9150509250929050565b5f5f6040838503121561258857612587611f40565b5b5f61259585828601612171565b92505060206125a685828601612171565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806125f457607f821691505b602082108103612607576126066125b0565b5b50919050565b5f6060820190506126205f830186612133565b61262d602083018561223e565b61263a6040830184612133565b949350505050565b5f819050919050565b5f67ffffffffffffffff82169050919050565b5f819050919050565b5f61268161267c61267784612642565b61265e565b61264b565b9050919050565b61269181612667565b82525050565b5f6020820190506126aa5f830184612688565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6126e7826120a5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612719576127186126b0565b5b600182019050919050565b5f81519050919050565b5f82825260208201905092915050565b5f61274882612724565b612752818561272e565b9350612762818560208601612015565b61276b8161203d565b840191505092915050565b5f6080820190506127895f830187612133565b6127966020830186612133565b6127a3604083018561223e565b81810360608301526127b5818461273e565b905095945050505050565b5f815190506127ce81611f73565b92915050565b5f602082840312156127e9576127e8611f40565b5b5f6127f6848285016127c0565b91505092915050565b5f81905092915050565b5f61281382611ffb565b61281d81856127ff565b935061282d818560208601612015565b80840191505092915050565b5f6128448285612809565b91506128508284612809565b91508190509392505050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026128b87fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8261287d565b6128c2868361287d565b95508019841693508086168417925050509392505050565b5f6128f46128ef6128ea846120a5565b61265e565b6120a5565b9050919050565b5f819050919050565b61290d836128da565b612921612919826128fb565b848454612889565b825550505050565b5f5f905090565b612938612929565b612943818484612904565b505050565b5b818110156129665761295b5f82612930565b600181019050612949565b5050565b601f8211156129ab5761297c8161285c565b6129858461286e565b81016020851015612994578190505b6129a86129a08561286e565b830182612948565b50505b505050565b5f82821c905092915050565b5f6129cb5f19846008026129b0565b1980831691505092915050565b5f6129e383836129bc565b9150826002028217905092915050565b6129fc82611ffb565b67ffffffffffffffff811115612a1557612a146122d6565b5b612a1f82546125dd565b612a2a82828561296a565b5f60209050601f831160018114612a5b575f8415612a49578287015190505b612a5385826129d8565b865550612aba565b601f198416612a698661285c565b5f5b82811015612a9057848901518255600182019150602085019450602081019050612a6b565b86831015612aad5784890151612aa9601f8916826129bc565b8355505b6001600288020188555050505b505050505050565b5f604082019050612ad55f830185612133565b612ae2602083018461223e565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffdfea2646970667358221220edc02b9b175dc3b3fa9c3e29cc8a8b9c5e27d78ac808fa829ee17a94db16f6a764736f6c634300081c0033
Deployed Bytecode
0x608060405234801561000f575f5ffd5b506004361061011f575f3560e01c8063715018a6116100ab578063c4d66de81161006f578063c4d66de8146102ef578063c87b56dd1461030b578063d204c45e1461033b578063e985e9c51461036b578063f2fde38b1461039b5761011f565b8063715018a6146102715780638da5cb5b1461027b57806395d89b4114610299578063a22cb465146102b7578063b88d4fde146102d35761011f565b806323b872dd116100f257806323b872dd146101bd57806342842e0e146101d957806342966c68146101f55780636352211e1461021157806370a08231146102415761011f565b806301ffc9a71461012357806306fdde0314610153578063081812fc14610171578063095ea7b3146101a1575b5f5ffd5b61013d60048036038101906101389190611f9d565b6103b7565b60405161014a9190611fe2565b60405180910390f35b61015b6103c8565b6040516101689190612085565b60405180910390f35b61018b600480360381019061018691906120d8565b610465565b6040516101989190612142565b60405180910390f35b6101bb60048036038101906101b69190612185565b610480565b005b6101d760048036038101906101d291906121c3565b610496565b005b6101f360048036038101906101ee91906121c3565b610595565b005b61020f600480360381019061020a91906120d8565b6105b4565b005b61022b600480360381019061022691906120d8565b6105ca565b6040516102389190612142565b60405180910390f35b61025b60048036038101906102569190612213565b6105db565b604051610268919061224d565b60405180910390f35b61027961069f565b005b6102836106b2565b6040516102909190612142565b60405180910390f35b6102a16106e7565b6040516102ae9190612085565b60405180910390f35b6102d160048036038101906102cc9190612290565b610785565b005b6102ed60048036038101906102e891906123fa565b61079b565b005b61030960048036038101906103049190612213565b6107c0565b005b610325600480360381019061032091906120d8565b6109c5565b6040516103329190612085565b60405180910390f35b61035560048036038101906103509190612518565b6109d7565b604051610362919061224d565b60405180910390f35b61038560048036038101906103809190612572565b610a16565b6040516103929190611fe2565b60405180910390f35b6103b560048036038101906103b09190612213565b610ab2565b005b5f6103c182610b36565b9050919050565b60605f6103d3610b96565b9050805f0180546103e3906125dd565b80601f016020809104026020016040519081016040528092919081815260200182805461040f906125dd565b801561045a5780601f106104315761010080835404028352916020019161045a565b820191905f5260205f20905b81548152906001019060200180831161043d57829003601f168201915b505050505091505090565b5f61046f82610bbd565b5061047982610c43565b9050919050565b610492828261048d610c8a565b610c91565b5050565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610506575f6040517f64a0ae920000000000000000000000000000000000000000000000000000000081526004016104fd9190612142565b60405180910390fd5b5f6105198383610514610c8a565b610ca3565b90508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461058f578382826040517f64283d7b0000000000000000000000000000000000000000000000000000000081526004016105869392919061260d565b60405180910390fd5b50505050565b6105af83838360405180602001604052805f81525061079b565b505050565b6105c65f826105c1610c8a565b610ca3565b5050565b5f6105d482610bbd565b9050919050565b5f5f6105e5610b96565b90505f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610657575f6040517f89c62b6400000000000000000000000000000000000000000000000000000000815260040161064e9190612142565b60405180910390fd5b806003015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054915050919050565b6106a7610ec0565b6106b05f610f47565b565b5f5f6106bc611018565b9050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691505090565b60605f6106f2610b96565b9050806001018054610703906125dd565b80601f016020809104026020016040519081016040528092919081815260200182805461072f906125dd565b801561077a5780601f106107515761010080835404028352916020019161077a565b820191905f5260205f20905b81548152906001019060200180831161075d57829003601f168201915b505050505091505090565b610797610790610c8a565b838361103f565b5050565b6107a6848484610496565b6107ba6107b1610c8a565b858585856111b6565b50505050565b5f6107c9611362565b90505f815f0160089054906101000a900460ff161590505f825f015f9054906101000a900467ffffffffffffffff1690505f5f8267ffffffffffffffff161480156108115750825b90505f60018367ffffffffffffffff1614801561084457505f3073ffffffffffffffffffffffffffffffffffffffff163b145b905081158015610852575080155b15610889576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001855f015f6101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555083156108d6576001855f0160086101000a81548160ff0219169083151502179055505b61094a6040518060400160405280601281526020017f4254432f554e49207a6f6f6d4d6173636f7400000000000000000000000000008152506040518060400160405280600881526020017f42554e497a6f6f6d000000000000000000000000000000000000000000000000815250611389565b61095261139f565b61095a6113a9565b610963866113b3565b83156109bd575f855f0160086101000a81548160ff0219169083151502179055507fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d260016040516109b49190612697565b60405180910390a15b505050505050565b60606109d0826113c7565b9050919050565b5f6109e0610ec0565b5f5f5f8154809291906109f2906126dd565b919050559050610a0284826114e1565b610a0c81846114fe565b8091505092915050565b5f5f610a20610b96565b9050806005015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1691505092915050565b610aba610ec0565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610b2a575f6040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610b219190612142565b60405180910390fd5b610b3381610f47565b50565b5f634906490660e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610b8f5750610b8e82611565565b5b9050919050565b5f7f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079300905090565b5f5f610bc883611646565b90505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610c3a57826040517f7e273289000000000000000000000000000000000000000000000000000000008152600401610c31919061224d565b60405180910390fd5b80915050919050565b5f5f610c4d610b96565b9050806004015f8481526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b5f33905090565b610c9e838383600161168d565b505050565b5f5f610cad610b96565b90505f610cb985611646565b90505f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614610cfa57610cf981858761185a565b5b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610d8757610d395f865f5f61168d565b6001826003015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825403925050819055505b5f73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614610e08576001826003015f8873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055505b85826002015f8781526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550848673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a480925050509392505050565b610ec8610c8a565b73ffffffffffffffffffffffffffffffffffffffff16610ee66106b2565b73ffffffffffffffffffffffffffffffffffffffff1614610f4557610f09610c8a565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610f3c9190612142565b60405180910390fd5b565b5f610f50611018565b90505f815f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082825f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3505050565b5f7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300905090565b5f611048610b96565b90505f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036110ba57826040517f5b08ba180000000000000000000000000000000000000000000000000000000081526004016110b19190612142565b60405180910390fd5b81816005015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31846040516111a89190611fe2565b60405180910390a350505050565b5f8373ffffffffffffffffffffffffffffffffffffffff163b111561135b578273ffffffffffffffffffffffffffffffffffffffff1663150b7a02868685856040518563ffffffff1660e01b81526004016112149493929190612776565b6020604051808303815f875af192505050801561124f57506040513d601f19601f8201168201806040525081019061124c91906127d4565b60015b6112d0573d805f811461127d576040519150601f19603f3d011682016040523d82523d5f602084013e611282565b606091505b505f8151036112c857836040517f64a0ae920000000000000000000000000000000000000000000000000000000081526004016112bf9190612142565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461135957836040517f64a0ae920000000000000000000000000000000000000000000000000000000081526004016113509190612142565b60405180910390fd5b505b5050505050565b5f7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00905090565b61139161191d565b61139b828261195d565b5050565b6113a761191d565b565b6113b161191d565b565b6113bb61191d565b6113c481611998565b50565b60605f6113d2611a1c565b90506113dd83610bbd565b505f815f015f8581526020019081526020015f2080546113fc906125dd565b80601f0160208091040260200160405190810160405280929190818152602001828054611428906125dd565b80156114735780601f1061144a57610100808354040283529160200191611473565b820191905f5260205f20905b81548152906001019060200180831161145657829003601f168201915b505050505090505f611483611a43565b90505f815103611498578193505050506114dc565b5f825111156114cd5780826040516020016114b4929190612839565b60405160208183030381529060405293505050506114dc565b6114d685611a59565b93505050505b919050565b6114fa828260405180602001604052805f815250611abf565b5050565b5f611507611a1c565b905081815f015f8581526020019081526020015f20908161152891906129f3565b507ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce783604051611558919061224d565b60405180910390a1505050565b5f7f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061162f57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061163f575061163e82611ae2565b5b9050919050565b5f5f611650610b96565b9050806002015f8481526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b5f611696610b96565b905081806116d057505f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611802575f6116df85610bbd565b90505f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561174957508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b801561175c575061175a8185610a16565b155b1561179e57836040517fa9fbf51f0000000000000000000000000000000000000000000000000000000081526004016117959190612142565b60405180910390fd5b821561180057848673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b84816004015f8681526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050505050565b611865838383611b4b565b611918575f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036118d957806040517f7e2732890000000000000000000000000000000000000000000000000000000081526004016118d0919061224d565b60405180910390fd5b81816040517f177e802f00000000000000000000000000000000000000000000000000000000815260040161190f929190612ac2565b60405180910390fd5b505050565b611925611c0b565b61195b576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b61196561191d565b5f61196e610b96565b905082815f01908161198091906129f3565b508181600101908161199291906129f3565b50505050565b6119a061191d565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611a10575f6040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401611a079190612142565b60405180910390fd5b611a1981610f47565b50565b5f7f0542a41881ee128a365a727b282c86fa859579490b9bb45aab8503648c8e7900905090565b606060405180602001604052805f815250905090565b6060611a6482610bbd565b505f611a6e611a43565b90505f815111611a8c5760405180602001604052805f815250611ab7565b80611a9684611c29565b604051602001611aa7929190612839565b6040516020818303038152906040525b915050919050565b611ac98383611cf3565b611add611ad4610c8a565b5f8585856111b6565b505050565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b5f5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c0257508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480611bc35750611bc28484610a16565b5b80611c0157508273ffffffffffffffffffffffffffffffffffffffff16611be983610c43565b73ffffffffffffffffffffffffffffffffffffffff16145b5b90509392505050565b5f611c14611362565b5f0160089054906101000a900460ff16905090565b60605f6001611c3784611de6565b0190505f8167ffffffffffffffff811115611c5557611c546122d6565b5b6040519080825280601f01601f191660200182016040528015611c875781602001600182028036833780820191505090505b5090505f82602001820190505b600115611ce8578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581611cdd57611cdc612ae9565b5b0494505f8503611c94575b819350505050919050565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611d63575f6040517f64a0ae92000000000000000000000000000000000000000000000000000000008152600401611d5a9190612142565b60405180910390fd5b5f611d6f83835f610ca3565b90505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611de1575f6040517f73c6ac6e000000000000000000000000000000000000000000000000000000008152600401611dd89190612142565b60405180910390fd5b505050565b5f5f5f90507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310611e42577a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008381611e3857611e37612ae9565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310611e7f576d04ee2d6d415b85acef81000000008381611e7557611e74612ae9565b5b0492506020810190505b662386f26fc100008310611eae57662386f26fc100008381611ea457611ea3612ae9565b5b0492506010810190505b6305f5e1008310611ed7576305f5e1008381611ecd57611ecc612ae9565b5b0492506008810190505b6127108310611efc576127108381611ef257611ef1612ae9565b5b0492506004810190505b60648310611f1f5760648381611f1557611f14612ae9565b5b0492506002810190505b600a8310611f2e576001810190505b80915050919050565b5f604051905090565b5f5ffd5b5f5ffd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611f7c81611f48565b8114611f86575f5ffd5b50565b5f81359050611f9781611f73565b92915050565b5f60208284031215611fb257611fb1611f40565b5b5f611fbf84828501611f89565b91505092915050565b5f8115159050919050565b611fdc81611fc8565b82525050565b5f602082019050611ff55f830184611fd3565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f5b83811015612032578082015181840152602081019050612017565b5f8484015250505050565b5f601f19601f8301169050919050565b5f61205782611ffb565b6120618185612005565b9350612071818560208601612015565b61207a8161203d565b840191505092915050565b5f6020820190508181035f83015261209d818461204d565b905092915050565b5f819050919050565b6120b7816120a5565b81146120c1575f5ffd5b50565b5f813590506120d2816120ae565b92915050565b5f602082840312156120ed576120ec611f40565b5b5f6120fa848285016120c4565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61212c82612103565b9050919050565b61213c81612122565b82525050565b5f6020820190506121555f830184612133565b92915050565b61216481612122565b811461216e575f5ffd5b50565b5f8135905061217f8161215b565b92915050565b5f5f6040838503121561219b5761219a611f40565b5b5f6121a885828601612171565b92505060206121b9858286016120c4565b9150509250929050565b5f5f5f606084860312156121da576121d9611f40565b5b5f6121e786828701612171565b93505060206121f886828701612171565b9250506040612209868287016120c4565b9150509250925092565b5f6020828403121561222857612227611f40565b5b5f61223584828501612171565b91505092915050565b612247816120a5565b82525050565b5f6020820190506122605f83018461223e565b92915050565b61226f81611fc8565b8114612279575f5ffd5b50565b5f8135905061228a81612266565b92915050565b5f5f604083850312156122a6576122a5611f40565b5b5f6122b385828601612171565b92505060206122c48582860161227c565b9150509250929050565b5f5ffd5b5f5ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61230c8261203d565b810181811067ffffffffffffffff8211171561232b5761232a6122d6565b5b80604052505050565b5f61233d611f37565b90506123498282612303565b919050565b5f67ffffffffffffffff821115612368576123676122d6565b5b6123718261203d565b9050602081019050919050565b828183375f83830152505050565b5f61239e6123998461234e565b612334565b9050828152602081018484840111156123ba576123b96122d2565b5b6123c584828561237e565b509392505050565b5f82601f8301126123e1576123e06122ce565b5b81356123f184826020860161238c565b91505092915050565b5f5f5f5f6080858703121561241257612411611f40565b5b5f61241f87828801612171565b945050602061243087828801612171565b9350506040612441878288016120c4565b925050606085013567ffffffffffffffff81111561246257612461611f44565b5b61246e878288016123cd565b91505092959194509250565b5f67ffffffffffffffff821115612494576124936122d6565b5b61249d8261203d565b9050602081019050919050565b5f6124bc6124b78461247a565b612334565b9050828152602081018484840111156124d8576124d76122d2565b5b6124e384828561237e565b509392505050565b5f82601f8301126124ff576124fe6122ce565b5b813561250f8482602086016124aa565b91505092915050565b5f5f6040838503121561252e5761252d611f40565b5b5f61253b85828601612171565b925050602083013567ffffffffffffffff81111561255c5761255b611f44565b5b612568858286016124eb565b9150509250929050565b5f5f6040838503121561258857612587611f40565b5b5f61259585828601612171565b92505060206125a685828601612171565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806125f457607f821691505b602082108103612607576126066125b0565b5b50919050565b5f6060820190506126205f830186612133565b61262d602083018561223e565b61263a6040830184612133565b949350505050565b5f819050919050565b5f67ffffffffffffffff82169050919050565b5f819050919050565b5f61268161267c61267784612642565b61265e565b61264b565b9050919050565b61269181612667565b82525050565b5f6020820190506126aa5f830184612688565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6126e7826120a5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612719576127186126b0565b5b600182019050919050565b5f81519050919050565b5f82825260208201905092915050565b5f61274882612724565b612752818561272e565b9350612762818560208601612015565b61276b8161203d565b840191505092915050565b5f6080820190506127895f830187612133565b6127966020830186612133565b6127a3604083018561223e565b81810360608301526127b5818461273e565b905095945050505050565b5f815190506127ce81611f73565b92915050565b5f602082840312156127e9576127e8611f40565b5b5f6127f6848285016127c0565b91505092915050565b5f81905092915050565b5f61281382611ffb565b61281d81856127ff565b935061282d818560208601612015565b80840191505092915050565b5f6128448285612809565b91506128508284612809565b91508190509392505050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026128b87fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8261287d565b6128c2868361287d565b95508019841693508086168417925050509392505050565b5f6128f46128ef6128ea846120a5565b61265e565b6120a5565b9050919050565b5f819050919050565b61290d836128da565b612921612919826128fb565b848454612889565b825550505050565b5f5f905090565b612938612929565b612943818484612904565b505050565b5b818110156129665761295b5f82612930565b600181019050612949565b5050565b601f8211156129ab5761297c8161285c565b6129858461286e565b81016020851015612994578190505b6129a86129a08561286e565b830182612948565b50505b505050565b5f82821c905092915050565b5f6129cb5f19846008026129b0565b1980831691505092915050565b5f6129e383836129bc565b9150826002028217905092915050565b6129fc82611ffb565b67ffffffffffffffff811115612a1557612a146122d6565b5b612a1f82546125dd565b612a2a82828561296a565b5f60209050601f831160018114612a5b575f8415612a49578287015190505b612a5385826129d8565b865550612aba565b601f198416612a698661285c565b5f5b82811015612a9057848901518255600182019150602085019450602081019050612a6b565b86831015612aad5784890151612aa9601f8916826129bc565b8355505b6001600288020188555050505b505050505050565b5f604082019050612ad55f830185612133565b612ae2602083018461223e565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffdfea2646970667358221220edc02b9b175dc3b3fa9c3e29cc8a8b9c5e27d78ac808fa829ee17a94db16f6a764736f6c634300081c0033
Deployed Bytecode Sourcemap
142364:1346:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;143473:234;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;117960:149;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;119248:158;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;119067:115;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;119975:588;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;120634:134;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;133735:318;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;117773:120;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;117440:271;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;141342:103;;;:::i;:::-;;140607:147;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;118178:153;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;119478:146;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;120839:236;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;142663;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;143247:218;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;142907:262;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;119695:213;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;141600:220;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;143473:234;143634:4;143663:36;143687:11;143663:23;:36::i;:::-;143656:43;;143473:234;;;:::o;117960:149::-;118005:13;118031:23;118057:19;:17;:19::i;:::-;118031:45;;118094:1;:7;;118087:14;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;117960:149;:::o;119248:158::-;119315:7;119335:22;119349:7;119335:13;:22::i;:::-;;119377:21;119390:7;119377:12;:21::i;:::-;119370:28;;119248:158;;;:::o;119067:115::-;119139:35;119148:2;119152:7;119161:12;:10;:12::i;:::-;119139:8;:35::i;:::-;119067:115;;:::o;119975:588::-;120084:1;120070:16;;:2;:16;;;120066:89;;120140:1;120110:33;;;;;;;;;;;:::i;:::-;;;;;;;;120066:89;120376:21;120400:34;120408:2;120412:7;120421:12;:10;:12::i;:::-;120400:7;:34::i;:::-;120376:58;;120466:4;120449:21;;:13;:21;;;120445:111;;120515:4;120521:7;120530:13;120494:50;;;;;;;;;;;;;:::i;:::-;;;;;;;;120445:111;120055:508;119975:588;;;:::o;120634:134::-;120721:39;120738:4;120744:2;120748:7;120721:39;;;;;;;;;;;;:16;:39::i;:::-;120634:134;;;:::o;133735:318::-;134003:42;134019:1;134023:7;134032:12;:10;:12::i;:::-;134003:7;:42::i;:::-;;133735:318;:::o;117773:120::-;117836:7;117863:22;117877:7;117863:13;:22::i;:::-;117856:29;;117773:120;;;:::o;117440:271::-;117503:7;117523:23;117549:19;:17;:19::i;:::-;117523:45;;117600:1;117583:19;;:5;:19;;;117579:89;;117653:1;117626:30;;;;;;;;;;;:::i;:::-;;;;;;;;117579:89;117685:1;:11;;:18;117697:5;117685:18;;;;;;;;;;;;;;;;117678:25;;;117440:271;;;:::o;141342:103::-;140493:13;:11;:13::i;:::-;141407:30:::1;141434:1;141407:18;:30::i;:::-;141342:103::o:0;140607:147::-;140653:7;140673:24;140700:20;:18;:20::i;:::-;140673:47;;140738:1;:8;;;;;;;;;;;;140731:15;;;140607:147;:::o;118178:153::-;118225:13;118251:23;118277:19;:17;:19::i;:::-;118251:45;;118314:1;:9;;118307:16;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;118178:153;:::o;119478:146::-;119564:52;119583:12;:10;:12::i;:::-;119597:8;119607;119564:18;:52::i;:::-;119478:146;;:::o;120839:236::-;120953:31;120966:4;120972:2;120976:7;120953:12;:31::i;:::-;120995:72;121029:12;:10;:12::i;:::-;121043:4;121049:2;121053:7;121062:4;120995:33;:72::i;:::-;120839:236;;;;:::o;142663:::-;20784:30;20817:26;:24;:26::i;:::-;20784:59;;20908:19;20931:1;:15;;;;;;;;;;;;20930:16;20908:38;;20957:18;20978:1;:14;;;;;;;;;;;;20957:35;;21343:17;21378:1;21363:11;:16;;;:34;;;;;21383:14;21363:34;21343:54;;21408:17;21443:1;21428:11;:16;;;:50;;;;;21477:1;21456:4;21448:25;;;:30;21428:50;21408:70;;21496:12;21495:13;:30;;;;;21513:12;21512:13;21495:30;21491:93;;;21549:23;;;;;;;;;;;;;;21491:93;21611:1;21594;:14;;;:18;;;;;;;;;;;;;;;;;;21627:14;21623:69;;;21676:4;21658:1;:15;;;:22;;;;;;;;;;;;;;;;;;21623:69;142735:47:::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;::::0;:13:::1;:47::i;:::-;142793:25;:23;:25::i;:::-;142829:23;:21;:23::i;:::-;142863:28;142878:12;142863:14;:28::i;:::-;21718:14:::0;21714:104;;;21767:5;21749:1;:15;;;:23;;;;;;;;;;;;;;;;;;21792:14;21804:1;21792:14;;;;;;:::i;:::-;;;;;;;;21714:104;20716:1109;;;;;142663:236;:::o;143247:218::-;143396:13;143434:23;143449:7;143434:14;:23::i;:::-;143427:30;;143247:218;;;:::o;142907:262::-;143009:7;140493:13;:11;:13::i;:::-;143034:15:::1;143052:12;;:14;;;;;;;;;:::i;:::-;;;;;143034:32;;143077:22;143087:2;143091:7;143077:9;:22::i;:::-;143110:26;143123:7;143132:3;143110:12;:26::i;:::-;143154:7;143147:14;;;142907:262:::0;;;;:::o;119695:213::-;119783:4;119800:23;119826:19;:17;:19::i;:::-;119800:45;;119863:1;:20;;:27;119884:5;119863:27;;;;;;;;;;;;;;;:37;119891:8;119863:37;;;;;;;;;;;;;;;;;;;;;;;;;119856:44;;;119695:213;;;;:::o;141600:220::-;140493:13;:11;:13::i;:::-;141705:1:::1;141685:22;;:8;:22;;::::0;141681:93:::1;;141759:1;141731:31;;;;;;;;;;;:::i;:::-;;;;;;;;141681:93;141784:28;141803:8;141784:18;:28::i;:::-;141600:220:::0;:::o;136820:::-;136933:4;135895:10;135888:18;;136957:35;;;:11;:35;;;;:75;;;;136996:36;137020:11;136996:23;:36::i;:::-;136957:75;136950:82;;136820:220;;;:::o;116322:160::-;116373:23;116443:21;116433:31;;116322:160;:::o;132709:247::-;132772:7;132792:13;132808:17;132817:7;132808:8;:17::i;:::-;132792:33;;132857:1;132840:19;;:5;:19;;;132836:90;;132906:7;132883:31;;;;;;;;;;;:::i;:::-;;;;;;;;132836:90;132943:5;132936:12;;;132709:247;;;:::o;121896:187::-;121966:7;121986:23;122012:19;:17;:19::i;:::-;121986:45;;122049:1;:17;;:26;122067:7;122049:26;;;;;;;;;;;;;;;;;;;;;122042:33;;;121896:187;;;:::o;26553:98::-;26606:7;26633:10;26626:17;;26553:98;:::o;130825:122::-;130906:33;130915:2;130919:7;130928:4;130934;130906:8;:33::i;:::-;130825:122;;;:::o;124973:886::-;125059:7;125079:23;125105:19;:17;:19::i;:::-;125079:45;;125135:12;125150:17;125159:7;125150:8;:17::i;:::-;125135:32;;125246:1;125230:18;;:4;:18;;;125226:88;;125265:37;125282:4;125288;125294:7;125265:16;:37::i;:::-;125226:88;125377:1;125361:18;;:4;:18;;;125357:265;;125479:48;125496:1;125500:7;125517:1;125521:5;125479:8;:48::i;:::-;125594:1;125573;:11;;:17;125585:4;125573:17;;;;;;;;;;;;;;;;:22;;;;;;;;;;;125357:265;125652:1;125638:16;;:2;:16;;;125634:113;;125719:1;125700;:11;;:15;125712:2;125700:15;;;;;;;;;;;;;;;;:20;;;;;;;;;;;125634:113;125780:2;125759:1;:9;;:18;125769:7;125759:18;;;;;;;;;;;;:23;;;;;;;;;;;;;;;;;;125819:7;125815:2;125800:27;;125809:4;125800:27;;;;;;;;;;;;125847:4;125840:11;;;;124973:886;;;;;:::o;140832:166::-;140903:12;:10;:12::i;:::-;140892:23;;:7;:5;:7::i;:::-;:23;;;140888:103;;140966:12;:10;:12::i;:::-;140939:40;;;;;;;;;;;:::i;:::-;;;;;;;;140888:103;140832:166::o;141980:253::-;142054:24;142081:20;:18;:20::i;:::-;142054:47;;142112:16;142131:1;:8;;;;;;;;;;;;142112:27;;142161:8;142150:1;:8;;;:19;;;;;;;;;;;;;;;;;;142216:8;142185:40;;142206:8;142185:40;;;;;;;;;;;;142043:190;;141980:253;:::o;139315:163::-;139367:24;139438:22;139428:32;;139315:163;:::o;132090:376::-;132194:23;132220:19;:17;:19::i;:::-;132194:45;;132274:1;132254:22;;:8;:22;;;132250:93;;132322:8;132300:31;;;;;;;;;;;:::i;:::-;;;;;;;;132250:93;132393:8;132353:1;:20;;:27;132374:5;132353:27;;;;;;;;;;;;;;;:37;132381:8;132353:37;;;;;;;;;;;;;;;;:48;;;;;;;;;;;;;;;;;;132439:8;132417:41;;132432:5;132417:41;;;132449:8;132417:41;;;;;;:::i;:::-;;;;;;;;132183:283;132090:376;;;:::o;15519:948::-;15723:1;15706:2;:14;;;:18;15702:758;;;15761:2;15745:36;;;15782:8;15792:4;15798:7;15807:4;15745:67;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;15741:708;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16125:1;16108:6;:13;:18;16104:330;;16250:2;16214:39;;;;;;;;;;;:::i;:::-;;;;;;;;16104:330;16384:6;16378:13;16369:6;16365:2;16361:15;16354:38;15741:708;15870:41;;;15860:51;;;:6;:51;;;;15856:185;;16018:2;15982:39;;;;;;;;;;;:::i;:::-;;;;;;;;15856:185;15813:243;15702:758;15519:948;;;;;:::o;25480:174::-;25538:30;25615:21;25605:31;;25480:174;:::o;116606:151::-;23622:20;:18;:20::i;:::-;116710:39:::1;116734:5;116741:7;116710:23;:39::i;:::-;116606:151:::0;;:::o;136595:69::-;23622:20;:18;:20::i;:::-;136595:69::o;133403:67::-;23622:20;:18;:20::i;:::-;133403:67::o;139991:129::-;23622:20;:18;:20::i;:::-;140074:38:::1;140099:12;140074:24;:38::i;:::-;139991:129:::0;:::o;137111:687::-;137184:13;137210:33;137246:29;:27;:29::i;:::-;137210:65;;137286:22;137300:7;137286:13;:22::i;:::-;;137321:23;137347:1;:12;;:21;137360:7;137347:21;;;;;;;;;;;137321:47;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;137379:18;137400:10;:8;:10::i;:::-;137379:31;;137508:1;137492:4;137486:18;:23;137482:72;;137533:9;137526:16;;;;;;;137482:72;137681:1;137661:9;137655:23;:27;137651:97;;;137720:4;137726:9;137706:30;;;;;;;;;:::i;:::-;;;;;;;;;;;;;137699:37;;;;;;;137651:97;137767:23;137782:7;137767:14;:23::i;:::-;137760:30;;;;;137111:687;;;;:::o;126893:102::-;126961:26;126971:2;126975:7;126961:26;;;;;;;;;;;;:9;:26::i;:::-;126893:102;;:::o;137924:248::-;138016:33;138052:29;:27;:29::i;:::-;138016:65;;138116:9;138092:1;:12;;:21;138105:7;138092:21;;;;;;;;;;;:33;;;;;;:::i;:::-;;138141:23;138156:7;138141:23;;;;;;:::i;:::-;;;;;;;;138005:167;137924:248;;:::o;117060:316::-;117173:4;117225:25;117210:40;;;:11;:40;;;;:105;;;;117282:33;117267:48;;;:11;:48;;;;117210:105;:158;;;;117332:36;117356:11;117332:23;:36::i;:::-;117210:158;117190:178;;117060:316;;;:::o;121600:175::-;121666:7;121686:23;121712:19;:17;:19::i;:::-;121686:45;;121749:1;:9;;:18;121759:7;121749:18;;;;;;;;;;;;;;;;;;;;;121742:25;;;121600:175;;;:::o;131135:736::-;131240:23;131266:19;:17;:19::i;:::-;131240:45;;131353:9;:31;;;;131382:1;131366:18;;:4;:18;;;;131353:31;131349:471;;;131401:13;131417:22;131431:7;131417:13;:22::i;:::-;131401:38;;131586:1;131570:18;;:4;:18;;;;:35;;;;;131601:4;131592:13;;:5;:13;;;;131570:35;:69;;;;;131610:29;131627:5;131634:4;131610:16;:29::i;:::-;131609:30;131570:69;131566:144;;;131689:4;131667:27;;;;;;;;;;;:::i;:::-;;;;;;;;131566:144;131730:9;131726:83;;;131785:7;131781:2;131765:28;;131774:5;131765:28;;;;;;;;;;;;131726:83;131386:434;131349:471;131861:2;131832:1;:17;;:26;131850:7;131832:26;;;;;;;;;;;;:31;;;;;;;;;;;;;;;;;;131229:642;131135:736;;;;:::o;123122:376::-;123235:38;123249:5;123256:7;123265;123235:13;:38::i;:::-;123230:261;;123311:1;123294:19;;:5;:19;;;123290:190;;123364:7;123341:31;;;;;;;;;;;:::i;:::-;;;;;;;;123290:190;123447:7;123456;123420:44;;;;;;;;;;;;:::i;:::-;;;;;;;;123230:261;123122:376;;;:::o;23782:145::-;23850:17;:15;:17::i;:::-;23845:75;;23891:17;;;;;;;;;;;;;;23845:75;23782:145::o;116765:223::-;23622:20;:18;:20::i;:::-;116879:23:::1;116905:19;:17;:19::i;:::-;116879:45;;116945:5;116935:1;:7;;:15;;;;;;:::i;:::-;;116973:7;116961:1;:9;;:19;;;;;;:::i;:::-;;116868:120;116765:223:::0;;:::o;140128:240::-;23622:20;:18;:20::i;:::-;140249:1:::1;140225:26;;:12;:26;;::::0;140221:97:::1;;140303:1;140275:31;;;;;;;;;;;:::i;:::-;;;;;;;;140221:97;140328:32;140347:12;140328:18;:32::i;:::-;140128:240:::0;:::o;136397:190::-;136458:33;136538:31;136528:41;;136397:190;:::o;118911:94::-;118962:13;118988:9;;;;;;;;;;;;;;118911:94;:::o;118402:260::-;118466:13;118492:22;118506:7;118492:13;:22::i;:::-;;118527:21;118551:10;:8;:10::i;:::-;118527:34;;118603:1;118585:7;118579:21;:25;:75;;;;;;;;;;;;;;;;;118621:7;118630:18;:7;:16;:18::i;:::-;118607:42;;;;;;;;;:::i;:::-;;;;;;;;;;;;;118579:75;118572:82;;;118402:260;;;:::o;127222:210::-;127317:18;127323:2;127327:7;127317:5;:18::i;:::-;127346:78;127380:12;:10;:12::i;:::-;127402:1;127406:2;127410:7;127419:4;127346:33;:78::i;:::-;127222:210;;;:::o;114825:148::-;114901:4;114940:25;114925:40;;;:11;:40;;;;114918:47;;114825:148;;;:::o;122403:276::-;122506:4;122562:1;122543:21;;:7;:21;;;;:128;;;;;122591:7;122582:16;;:5;:16;;;:52;;;;122602:32;122619:5;122626:7;122602:16;:32::i;:::-;122582:52;:88;;;;122663:7;122638:32;;:21;122651:7;122638:12;:21::i;:::-;:32;;;122582:88;122543:128;122523:148;;122403:276;;;;;:::o;25222:122::-;25272:4;25296:26;:24;:26::i;:::-;:40;;;;;;;;;;;;25289:47;;25222:122;:::o;97591:650::-;97647:13;97698:14;97735:1;97715:17;97726:5;97715:10;:17::i;:::-;:21;97698:38;;97751:20;97785:6;97774:18;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;97751:41;;97807:11;97904:6;97900:2;97896:15;97888:6;97884:28;97877:35;;97941:254;97948:4;97941:254;;;97973:5;;;;;;;;98079:10;98074:2;98067:5;98063:14;98058:32;98053:3;98045:46;98137:2;98128:11;;;;;;:::i;:::-;;;;;98171:1;98162:5;:10;97941:254;98158:21;97941:254;98216:6;98209:13;;;;;97591:650;;;:::o;126195:335::-;126277:1;126263:16;;:2;:16;;;126259:89;;126333:1;126303:33;;;;;;;;;;;:::i;:::-;;;;;;;;126259:89;126358:21;126382:32;126390:2;126394:7;126411:1;126382:7;:32::i;:::-;126358:56;;126454:1;126429:27;;:13;:27;;;126425:98;;126508:1;126480:31;;;;;;;;;;;:::i;:::-;;;;;;;;126425:98;126248:282;126195:335;;:::o;90918:948::-;90971:7;90991:14;91008:1;90991:18;;91058:8;91049:5;:17;91045:106;;91096:8;91087:17;;;;;;:::i;:::-;;;;;91133:2;91123:12;;;;91045:106;91178:8;91169:5;:17;91165:106;;91216:8;91207:17;;;;;;:::i;:::-;;;;;91253:2;91243:12;;;;91165:106;91298:8;91289:5;:17;91285:106;;91336:8;91327:17;;;;;;:::i;:::-;;;;;91373:2;91363:12;;;;91285:106;91418:7;91409:5;:16;91405:103;;91455:7;91446:16;;;;;;:::i;:::-;;;;;91491:1;91481:11;;;;91405:103;91535:7;91526:5;:16;91522:103;;91572:7;91563:16;;;;;;:::i;:::-;;;;;91608:1;91598:11;;;;91522:103;91652:7;91643:5;:16;91639:103;;91689:7;91680:16;;;;;;:::i;:::-;;;;;91725:1;91715:11;;;;91639:103;91769:7;91760:5;:16;91756:68;;91807:1;91797:11;;;;91756:68;91852:6;91845:13;;;90918:948;;;:::o;7:75:1:-;40:6;73:2;67:9;57:19;;7:75;:::o;88:117::-;197:1;194;187:12;211:117;320:1;317;310:12;334:149;370:7;410:66;403:5;399:78;388:89;;334:149;;;:::o;489:120::-;561:23;578:5;561:23;:::i;:::-;554:5;551:34;541:62;;599:1;596;589:12;541:62;489:120;:::o;615:137::-;660:5;698:6;685:20;676:29;;714:32;740:5;714:32;:::i;:::-;615:137;;;;:::o;758:327::-;816:6;865:2;853:9;844:7;840:23;836:32;833:119;;;871:79;;:::i;:::-;833:119;991:1;1016:52;1060:7;1051:6;1040:9;1036:22;1016:52;:::i;:::-;1006:62;;962:116;758:327;;;;:::o;1091:90::-;1125:7;1168:5;1161:13;1154:21;1143:32;;1091:90;;;:::o;1187:109::-;1268:21;1283:5;1268:21;:::i;:::-;1263:3;1256:34;1187:109;;:::o;1302:210::-;1389:4;1427:2;1416:9;1412:18;1404:26;;1440:65;1502:1;1491:9;1487:17;1478:6;1440:65;:::i;:::-;1302:210;;;;:::o;1518:99::-;1570:6;1604:5;1598:12;1588:22;;1518:99;;;:::o;1623:169::-;1707:11;1741:6;1736:3;1729:19;1781:4;1776:3;1772:14;1757:29;;1623:169;;;;:::o;1798:248::-;1880:1;1890:113;1904:6;1901:1;1898:13;1890:113;;;1989:1;1984:3;1980:11;1974:18;1970:1;1965:3;1961:11;1954:39;1926:2;1923:1;1919:10;1914:15;;1890:113;;;2037:1;2028:6;2023:3;2019:16;2012:27;1860:186;1798:248;;;:::o;2052:102::-;2093:6;2144:2;2140:7;2135:2;2128:5;2124:14;2120:28;2110:38;;2052:102;;;:::o;2160:377::-;2248:3;2276:39;2309:5;2276:39;:::i;:::-;2331:71;2395:6;2390:3;2331:71;:::i;:::-;2324:78;;2411:65;2469:6;2464:3;2457:4;2450:5;2446:16;2411:65;:::i;:::-;2501:29;2523:6;2501:29;:::i;:::-;2496:3;2492:39;2485:46;;2252:285;2160:377;;;;:::o;2543:313::-;2656:4;2694:2;2683:9;2679:18;2671:26;;2743:9;2737:4;2733:20;2729:1;2718:9;2714:17;2707:47;2771:78;2844:4;2835:6;2771:78;:::i;:::-;2763:86;;2543:313;;;;:::o;2862:77::-;2899:7;2928:5;2917:16;;2862:77;;;:::o;2945:122::-;3018:24;3036:5;3018:24;:::i;:::-;3011:5;3008:35;2998:63;;3057:1;3054;3047:12;2998:63;2945:122;:::o;3073:139::-;3119:5;3157:6;3144:20;3135:29;;3173:33;3200:5;3173:33;:::i;:::-;3073:139;;;;:::o;3218:329::-;3277:6;3326:2;3314:9;3305:7;3301:23;3297:32;3294:119;;;3332:79;;:::i;:::-;3294:119;3452:1;3477:53;3522:7;3513:6;3502:9;3498:22;3477:53;:::i;:::-;3467:63;;3423:117;3218:329;;;;:::o;3553:126::-;3590:7;3630:42;3623:5;3619:54;3608:65;;3553:126;;;:::o;3685:96::-;3722:7;3751:24;3769:5;3751:24;:::i;:::-;3740:35;;3685:96;;;:::o;3787:118::-;3874:24;3892:5;3874:24;:::i;:::-;3869:3;3862:37;3787:118;;:::o;3911:222::-;4004:4;4042:2;4031:9;4027:18;4019:26;;4055:71;4123:1;4112:9;4108:17;4099:6;4055:71;:::i;:::-;3911:222;;;;:::o;4139:122::-;4212:24;4230:5;4212:24;:::i;:::-;4205:5;4202:35;4192:63;;4251:1;4248;4241:12;4192:63;4139:122;:::o;4267:139::-;4313:5;4351:6;4338:20;4329:29;;4367:33;4394:5;4367:33;:::i;:::-;4267:139;;;;:::o;4412:474::-;4480:6;4488;4537:2;4525:9;4516:7;4512:23;4508:32;4505:119;;;4543:79;;:::i;:::-;4505:119;4663:1;4688:53;4733:7;4724:6;4713:9;4709:22;4688:53;:::i;:::-;4678:63;;4634:117;4790:2;4816:53;4861:7;4852:6;4841:9;4837:22;4816:53;:::i;:::-;4806:63;;4761:118;4412:474;;;;;:::o;4892:619::-;4969:6;4977;4985;5034:2;5022:9;5013:7;5009:23;5005:32;5002:119;;;5040:79;;:::i;:::-;5002:119;5160:1;5185:53;5230:7;5221:6;5210:9;5206:22;5185:53;:::i;:::-;5175:63;;5131:117;5287:2;5313:53;5358:7;5349:6;5338:9;5334:22;5313:53;:::i;:::-;5303:63;;5258:118;5415:2;5441:53;5486:7;5477:6;5466:9;5462:22;5441:53;:::i;:::-;5431:63;;5386:118;4892:619;;;;;:::o;5517:329::-;5576:6;5625:2;5613:9;5604:7;5600:23;5596:32;5593:119;;;5631:79;;:::i;:::-;5593:119;5751:1;5776:53;5821:7;5812:6;5801:9;5797:22;5776:53;:::i;:::-;5766:63;;5722:117;5517:329;;;;:::o;5852:118::-;5939:24;5957:5;5939:24;:::i;:::-;5934:3;5927:37;5852:118;;:::o;5976:222::-;6069:4;6107:2;6096:9;6092:18;6084:26;;6120:71;6188:1;6177:9;6173:17;6164:6;6120:71;:::i;:::-;5976:222;;;;:::o;6204:116::-;6274:21;6289:5;6274:21;:::i;:::-;6267:5;6264:32;6254:60;;6310:1;6307;6300:12;6254:60;6204:116;:::o;6326:133::-;6369:5;6407:6;6394:20;6385:29;;6423:30;6447:5;6423:30;:::i;:::-;6326:133;;;;:::o;6465:468::-;6530:6;6538;6587:2;6575:9;6566:7;6562:23;6558:32;6555:119;;;6593:79;;:::i;:::-;6555:119;6713:1;6738:53;6783:7;6774:6;6763:9;6759:22;6738:53;:::i;:::-;6728:63;;6684:117;6840:2;6866:50;6908:7;6899:6;6888:9;6884:22;6866:50;:::i;:::-;6856:60;;6811:115;6465:468;;;;;:::o;6939:117::-;7048:1;7045;7038:12;7062:117;7171:1;7168;7161:12;7185:180;7233:77;7230:1;7223:88;7330:4;7327:1;7320:15;7354:4;7351:1;7344:15;7371:281;7454:27;7476:4;7454:27;:::i;:::-;7446:6;7442:40;7584:6;7572:10;7569:22;7548:18;7536:10;7533:34;7530:62;7527:88;;;7595:18;;:::i;:::-;7527:88;7635:10;7631:2;7624:22;7414:238;7371:281;;:::o;7658:129::-;7692:6;7719:20;;:::i;:::-;7709:30;;7748:33;7776:4;7768:6;7748:33;:::i;:::-;7658:129;;;:::o;7793:307::-;7854:4;7944:18;7936:6;7933:30;7930:56;;;7966:18;;:::i;:::-;7930:56;8004:29;8026:6;8004:29;:::i;:::-;7996:37;;8088:4;8082;8078:15;8070:23;;7793:307;;;:::o;8106:148::-;8204:6;8199:3;8194;8181:30;8245:1;8236:6;8231:3;8227:16;8220:27;8106:148;;;:::o;8260:423::-;8337:5;8362:65;8378:48;8419:6;8378:48;:::i;:::-;8362:65;:::i;:::-;8353:74;;8450:6;8443:5;8436:21;8488:4;8481:5;8477:16;8526:3;8517:6;8512:3;8508:16;8505:25;8502:112;;;8533:79;;:::i;:::-;8502:112;8623:54;8670:6;8665:3;8660;8623:54;:::i;:::-;8343:340;8260:423;;;;;:::o;8702:338::-;8757:5;8806:3;8799:4;8791:6;8787:17;8783:27;8773:122;;8814:79;;:::i;:::-;8773:122;8931:6;8918:20;8956:78;9030:3;9022:6;9015:4;9007:6;9003:17;8956:78;:::i;:::-;8947:87;;8763:277;8702:338;;;;:::o;9046:943::-;9141:6;9149;9157;9165;9214:3;9202:9;9193:7;9189:23;9185:33;9182:120;;;9221:79;;:::i;:::-;9182:120;9341:1;9366:53;9411:7;9402:6;9391:9;9387:22;9366:53;:::i;:::-;9356:63;;9312:117;9468:2;9494:53;9539:7;9530:6;9519:9;9515:22;9494:53;:::i;:::-;9484:63;;9439:118;9596:2;9622:53;9667:7;9658:6;9647:9;9643:22;9622:53;:::i;:::-;9612:63;;9567:118;9752:2;9741:9;9737:18;9724:32;9783:18;9775:6;9772:30;9769:117;;;9805:79;;:::i;:::-;9769:117;9910:62;9964:7;9955:6;9944:9;9940:22;9910:62;:::i;:::-;9900:72;;9695:287;9046:943;;;;;;;:::o;9995:308::-;10057:4;10147:18;10139:6;10136:30;10133:56;;;10169:18;;:::i;:::-;10133:56;10207:29;10229:6;10207:29;:::i;:::-;10199:37;;10291:4;10285;10281:15;10273:23;;9995:308;;;:::o;10309:425::-;10387:5;10412:66;10428:49;10470:6;10428:49;:::i;:::-;10412:66;:::i;:::-;10403:75;;10501:6;10494:5;10487:21;10539:4;10532:5;10528:16;10577:3;10568:6;10563:3;10559:16;10556:25;10553:112;;;10584:79;;:::i;:::-;10553:112;10674:54;10721:6;10716:3;10711;10674:54;:::i;:::-;10393:341;10309:425;;;;;:::o;10754:340::-;10810:5;10859:3;10852:4;10844:6;10840:17;10836:27;10826:122;;10867:79;;:::i;:::-;10826:122;10984:6;10971:20;11009:79;11084:3;11076:6;11069:4;11061:6;11057:17;11009:79;:::i;:::-;11000:88;;10816:278;10754:340;;;;:::o;11100:654::-;11178:6;11186;11235:2;11223:9;11214:7;11210:23;11206:32;11203:119;;;11241:79;;:::i;:::-;11203:119;11361:1;11386:53;11431:7;11422:6;11411:9;11407:22;11386:53;:::i;:::-;11376:63;;11332:117;11516:2;11505:9;11501:18;11488:32;11547:18;11539:6;11536:30;11533:117;;;11569:79;;:::i;:::-;11533:117;11674:63;11729:7;11720:6;11709:9;11705:22;11674:63;:::i;:::-;11664:73;;11459:288;11100:654;;;;;:::o;11760:474::-;11828:6;11836;11885:2;11873:9;11864:7;11860:23;11856:32;11853:119;;;11891:79;;:::i;:::-;11853:119;12011:1;12036:53;12081:7;12072:6;12061:9;12057:22;12036:53;:::i;:::-;12026:63;;11982:117;12138:2;12164:53;12209:7;12200:6;12189:9;12185:22;12164:53;:::i;:::-;12154:63;;12109:118;11760:474;;;;;:::o;12240:180::-;12288:77;12285:1;12278:88;12385:4;12382:1;12375:15;12409:4;12406:1;12399:15;12426:320;12470:6;12507:1;12501:4;12497:12;12487:22;;12554:1;12548:4;12544:12;12575:18;12565:81;;12631:4;12623:6;12619:17;12609:27;;12565:81;12693:2;12685:6;12682:14;12662:18;12659:38;12656:84;;12712:18;;:::i;:::-;12656:84;12477:269;12426:320;;;:::o;12752:442::-;12901:4;12939:2;12928:9;12924:18;12916:26;;12952:71;13020:1;13009:9;13005:17;12996:6;12952:71;:::i;:::-;13033:72;13101:2;13090:9;13086:18;13077:6;13033:72;:::i;:::-;13115;13183:2;13172:9;13168:18;13159:6;13115:72;:::i;:::-;12752:442;;;;;;:::o;13200:85::-;13245:7;13274:5;13263:16;;13200:85;;;:::o;13291:101::-;13327:7;13367:18;13360:5;13356:30;13345:41;;13291:101;;;:::o;13398:60::-;13426:3;13447:5;13440:12;;13398:60;;;:::o;13464:156::-;13521:9;13554:60;13571:42;13580:32;13606:5;13580:32;:::i;:::-;13571:42;:::i;:::-;13554:60;:::i;:::-;13541:73;;13464:156;;;:::o;13626:145::-;13720:44;13758:5;13720:44;:::i;:::-;13715:3;13708:57;13626:145;;:::o;13777:236::-;13877:4;13915:2;13904:9;13900:18;13892:26;;13928:78;14003:1;13992:9;13988:17;13979:6;13928:78;:::i;:::-;13777:236;;;;:::o;14019:180::-;14067:77;14064:1;14057:88;14164:4;14161:1;14154:15;14188:4;14185:1;14178:15;14205:233;14244:3;14267:24;14285:5;14267:24;:::i;:::-;14258:33;;14313:66;14306:5;14303:77;14300:103;;14383:18;;:::i;:::-;14300:103;14430:1;14423:5;14419:13;14412:20;;14205:233;;;:::o;14444:98::-;14495:6;14529:5;14523:12;14513:22;;14444:98;;;:::o;14548:168::-;14631:11;14665:6;14660:3;14653:19;14705:4;14700:3;14696:14;14681:29;;14548:168;;;;:::o;14722:373::-;14808:3;14836:38;14868:5;14836:38;:::i;:::-;14890:70;14953:6;14948:3;14890:70;:::i;:::-;14883:77;;14969:65;15027:6;15022:3;15015:4;15008:5;15004:16;14969:65;:::i;:::-;15059:29;15081:6;15059:29;:::i;:::-;15054:3;15050:39;15043:46;;14812:283;14722:373;;;;:::o;15101:640::-;15296:4;15334:3;15323:9;15319:19;15311:27;;15348:71;15416:1;15405:9;15401:17;15392:6;15348:71;:::i;:::-;15429:72;15497:2;15486:9;15482:18;15473:6;15429:72;:::i;:::-;15511;15579:2;15568:9;15564:18;15555:6;15511:72;:::i;:::-;15630:9;15624:4;15620:20;15615:2;15604:9;15600:18;15593:48;15658:76;15729:4;15720:6;15658:76;:::i;:::-;15650:84;;15101:640;;;;;;;:::o;15747:141::-;15803:5;15834:6;15828:13;15819:22;;15850:32;15876:5;15850:32;:::i;:::-;15747:141;;;;:::o;15894:349::-;15963:6;16012:2;16000:9;15991:7;15987:23;15983:32;15980:119;;;16018:79;;:::i;:::-;15980:119;16138:1;16163:63;16218:7;16209:6;16198:9;16194:22;16163:63;:::i;:::-;16153:73;;16109:127;15894:349;;;;:::o;16249:148::-;16351:11;16388:3;16373:18;;16249:148;;;;:::o;16403:390::-;16509:3;16537:39;16570:5;16537:39;:::i;:::-;16592:89;16674:6;16669:3;16592:89;:::i;:::-;16585:96;;16690:65;16748:6;16743:3;16736:4;16729:5;16725:16;16690:65;:::i;:::-;16780:6;16775:3;16771:16;16764:23;;16513:280;16403:390;;;;:::o;16799:435::-;16979:3;17001:95;17092:3;17083:6;17001:95;:::i;:::-;16994:102;;17113:95;17204:3;17195:6;17113:95;:::i;:::-;17106:102;;17225:3;17218:10;;16799:435;;;;;:::o;17240:141::-;17289:4;17312:3;17304:11;;17335:3;17332:1;17325:14;17369:4;17366:1;17356:18;17348:26;;17240:141;;;:::o;17387:93::-;17424:6;17471:2;17466;17459:5;17455:14;17451:23;17441:33;;17387:93;;;:::o;17486:107::-;17530:8;17580:5;17574:4;17570:16;17549:37;;17486:107;;;;:::o;17599:393::-;17668:6;17718:1;17706:10;17702:18;17741:97;17771:66;17760:9;17741:97;:::i;:::-;17859:39;17889:8;17878:9;17859:39;:::i;:::-;17847:51;;17931:4;17927:9;17920:5;17916:21;17907:30;;17980:4;17970:8;17966:19;17959:5;17956:30;17946:40;;17675:317;;17599:393;;;;;:::o;17998:142::-;18048:9;18081:53;18099:34;18108:24;18126:5;18108:24;:::i;:::-;18099:34;:::i;:::-;18081:53;:::i;:::-;18068:66;;17998:142;;;:::o;18146:75::-;18189:3;18210:5;18203:12;;18146:75;;;:::o;18227:269::-;18337:39;18368:7;18337:39;:::i;:::-;18398:91;18447:41;18471:16;18447:41;:::i;:::-;18439:6;18432:4;18426:11;18398:91;:::i;:::-;18392:4;18385:105;18303:193;18227:269;;;:::o;18502:73::-;18547:3;18568:1;18561:8;;18502:73;:::o;18581:189::-;18658:32;;:::i;:::-;18699:65;18757:6;18749;18743:4;18699:65;:::i;:::-;18634:136;18581:189;;:::o;18776:186::-;18836:120;18853:3;18846:5;18843:14;18836:120;;;18907:39;18944:1;18937:5;18907:39;:::i;:::-;18880:1;18873:5;18869:13;18860:22;;18836:120;;;18776:186;;:::o;18968:543::-;19069:2;19064:3;19061:11;19058:446;;;19103:38;19135:5;19103:38;:::i;:::-;19187:29;19205:10;19187:29;:::i;:::-;19177:8;19173:44;19370:2;19358:10;19355:18;19352:49;;;19391:8;19376:23;;19352:49;19414:80;19470:22;19488:3;19470:22;:::i;:::-;19460:8;19456:37;19443:11;19414:80;:::i;:::-;19073:431;;19058:446;18968:543;;;:::o;19517:117::-;19571:8;19621:5;19615:4;19611:16;19590:37;;19517:117;;;;:::o;19640:169::-;19684:6;19717:51;19765:1;19761:6;19753:5;19750:1;19746:13;19717:51;:::i;:::-;19713:56;19798:4;19792;19788:15;19778:25;;19691:118;19640:169;;;;:::o;19814:295::-;19890:4;20036:29;20061:3;20055:4;20036:29;:::i;:::-;20028:37;;20098:3;20095:1;20091:11;20085:4;20082:21;20074:29;;19814:295;;;;:::o;20114:1395::-;20231:37;20264:3;20231:37;:::i;:::-;20333:18;20325:6;20322:30;20319:56;;;20355:18;;:::i;:::-;20319:56;20399:38;20431:4;20425:11;20399:38;:::i;:::-;20484:67;20544:6;20536;20530:4;20484:67;:::i;:::-;20578:1;20602:4;20589:17;;20634:2;20626:6;20623:14;20651:1;20646:618;;;;21308:1;21325:6;21322:77;;;21374:9;21369:3;21365:19;21359:26;21350:35;;21322:77;21425:67;21485:6;21478:5;21425:67;:::i;:::-;21419:4;21412:81;21281:222;20616:887;;20646:618;20698:4;20694:9;20686:6;20682:22;20732:37;20764:4;20732:37;:::i;:::-;20791:1;20805:208;20819:7;20816:1;20813:14;20805:208;;;20898:9;20893:3;20889:19;20883:26;20875:6;20868:42;20949:1;20941:6;20937:14;20927:24;;20996:2;20985:9;20981:18;20968:31;;20842:4;20839:1;20835:12;20830:17;;20805:208;;;21041:6;21032:7;21029:19;21026:179;;;21099:9;21094:3;21090:19;21084:26;21142:48;21184:4;21176:6;21172:17;21161:9;21142:48;:::i;:::-;21134:6;21127:64;21049:156;21026:179;21251:1;21247;21239:6;21235:14;21231:22;21225:4;21218:36;20653:611;;;20616:887;;20206:1303;;;20114:1395;;:::o;21515:332::-;21636:4;21674:2;21663:9;21659:18;21651:26;;21687:71;21755:1;21744:9;21740:17;21731:6;21687:71;:::i;:::-;21768:72;21836:2;21825:9;21821:18;21812:6;21768:72;:::i;:::-;21515:332;;;;;:::o;21853:180::-;21901:77;21898:1;21891:88;21998:4;21995:1;21988:15;22022:4;22019:1;22012:15
Swarm Source
ipfs://edc02b9b175dc3b3fa9c3e29cc8a8b9c5e27d78ac808fa829ee17a94db16f6a7
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.