More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 62 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Choice | 9416663 | 13 hrs ago | IN | 0 APE | 0.00230108 | ||||
Choice | 9416657 | 13 hrs ago | IN | 0 APE | 0.00117484 | ||||
Choice | 9416655 | 13 hrs ago | IN | 0 APE | 0.00117545 | ||||
Choice | 9416649 | 13 hrs ago | IN | 0 APE | 0.00117331 | ||||
Choice | 9416644 | 13 hrs ago | IN | 0 APE | 0.00117636 | ||||
Choice | 9416640 | 13 hrs ago | IN | 0 APE | 0.00161167 | ||||
Register | 9416625 | 13 hrs ago | IN | 0 APE | 0.00445685 | ||||
Choice | 9033941 | 6 days ago | IN | 0 APE | 0.00185482 | ||||
Register | 9033932 | 6 days ago | IN | 0 APE | 0.00445685 | ||||
Choice | 9033924 | 6 days ago | IN | 0 APE | 0.00185543 | ||||
Choice | 9033911 | 6 days ago | IN | 0 APE | 0.00161167 | ||||
Register | 9033907 | 6 days ago | IN | 0 APE | 0.00445685 | ||||
Choice | 9033889 | 6 days ago | IN | 0 APE | 0.00185482 | ||||
Register | 9033870 | 6 days ago | IN | 0 APE | 0.00445685 | ||||
Choice | 9013338 | 7 days ago | IN | 0 APE | 0.00185634 | ||||
Choice | 9013320 | 7 days ago | IN | 0 APE | 0.00160892 | ||||
Register | 9013309 | 7 days ago | IN | 0 APE | 0.00445655 | ||||
Choice | 9013301 | 7 days ago | IN | 0 APE | 0.00185695 | ||||
Register | 9013276 | 7 days ago | IN | 0 APE | 0.00445655 | ||||
Choice | 9007148 | 7 days ago | IN | 0 APE | 0.00179327 | ||||
Choice | 9007146 | 7 days ago | IN | 0 APE | 0.00117301 | ||||
Choice | 9007141 | 7 days ago | IN | 0 APE | 0.0011134 | ||||
Choice | 9007138 | 7 days ago | IN | 0 APE | 0.00117606 | ||||
Choice | 9007136 | 7 days ago | IN | 0 APE | 0.00161136 | ||||
Register | 9007125 | 7 days ago | IN | 0 APE | 0.00445655 |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
NftGame
Compiler Version
v0.8.26+commit.8a97fa7a
Contract Source Code (Solidity)
/** *Submitted for verification at apescan.io on 2025-01-30 */ // 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/utils/Context.sol // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } } // File: @openzeppelin/contracts/utils/Panic.sol // OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol) pragma solidity ^0.8.20; /** * @dev Helper library for emitting standardized panic codes. * * ```solidity * contract Example { * using Panic for uint256; * * // Use any of the declared internal constants * function foo() { Panic.GENERIC.panic(); } * * // Alternatively * function foo() { Panic.panic(Panic.GENERIC); } * } * ``` * * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil]. * * _Available since v5.1._ */ // slither-disable-next-line unused-state library Panic { /// @dev generic / unspecified error uint256 internal constant GENERIC = 0x00; /// @dev used by the assert() builtin uint256 internal constant ASSERT = 0x01; /// @dev arithmetic underflow or overflow uint256 internal constant UNDER_OVERFLOW = 0x11; /// @dev division or modulo by zero uint256 internal constant DIVISION_BY_ZERO = 0x12; /// @dev enum conversion error uint256 internal constant ENUM_CONVERSION_ERROR = 0x21; /// @dev invalid encoding in storage uint256 internal constant STORAGE_ENCODING_ERROR = 0x22; /// @dev empty array pop uint256 internal constant EMPTY_ARRAY_POP = 0x31; /// @dev array out of bounds access uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32; /// @dev resource error (too large allocation or too large array) uint256 internal constant RESOURCE_ERROR = 0x41; /// @dev calling invalid internal function uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51; /// @dev Reverts with a panic code. Recommended to use with /// the internal constants with predefined codes. function panic(uint256 code) internal pure { assembly ("memory-safe") { mstore(0x00, 0x4e487b71) mstore(0x20, code) revert(0x1c, 0x24) } } } // File: @openzeppelin/contracts/utils/math/SafeCast.sol // OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol) // This file was procedurally generated from scripts/generate/templates/SafeCast.js. pragma solidity ^0.8.20; /** * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such an operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeCast { /** * @dev Value doesn't fit in an uint of `bits` size. */ error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value); /** * @dev An int value doesn't fit in an uint of `bits` size. */ error SafeCastOverflowedIntToUint(int256 value); /** * @dev Value doesn't fit in an int of `bits` size. */ error SafeCastOverflowedIntDowncast(uint8 bits, int256 value); /** * @dev An uint value doesn't fit in an int of `bits` size. */ error SafeCastOverflowedUintToInt(uint256 value); /** * @dev Returns the downcasted uint248 from uint256, reverting on * overflow (when the input is greater than largest uint248). * * Counterpart to Solidity's `uint248` operator. * * Requirements: * * - input must fit into 248 bits */ function toUint248(uint256 value) internal pure returns (uint248) { if (value > type(uint248).max) { revert SafeCastOverflowedUintDowncast(248, value); } return uint248(value); } /** * @dev Returns the downcasted uint240 from uint256, reverting on * overflow (when the input is greater than largest uint240). * * Counterpart to Solidity's `uint240` operator. * * Requirements: * * - input must fit into 240 bits */ function toUint240(uint256 value) internal pure returns (uint240) { if (value > type(uint240).max) { revert SafeCastOverflowedUintDowncast(240, value); } return uint240(value); } /** * @dev Returns the downcasted uint232 from uint256, reverting on * overflow (when the input is greater than largest uint232). * * Counterpart to Solidity's `uint232` operator. * * Requirements: * * - input must fit into 232 bits */ function toUint232(uint256 value) internal pure returns (uint232) { if (value > type(uint232).max) { revert SafeCastOverflowedUintDowncast(232, value); } return uint232(value); } /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). * * Counterpart to Solidity's `uint224` operator. * * Requirements: * * - input must fit into 224 bits */ function toUint224(uint256 value) internal pure returns (uint224) { if (value > type(uint224).max) { revert SafeCastOverflowedUintDowncast(224, value); } return uint224(value); } /** * @dev Returns the downcasted uint216 from uint256, reverting on * overflow (when the input is greater than largest uint216). * * Counterpart to Solidity's `uint216` operator. * * Requirements: * * - input must fit into 216 bits */ function toUint216(uint256 value) internal pure returns (uint216) { if (value > type(uint216).max) { revert SafeCastOverflowedUintDowncast(216, value); } return uint216(value); } /** * @dev Returns the downcasted uint208 from uint256, reverting on * overflow (when the input is greater than largest uint208). * * Counterpart to Solidity's `uint208` operator. * * Requirements: * * - input must fit into 208 bits */ function toUint208(uint256 value) internal pure returns (uint208) { if (value > type(uint208).max) { revert SafeCastOverflowedUintDowncast(208, value); } return uint208(value); } /** * @dev Returns the downcasted uint200 from uint256, reverting on * overflow (when the input is greater than largest uint200). * * Counterpart to Solidity's `uint200` operator. * * Requirements: * * - input must fit into 200 bits */ function toUint200(uint256 value) internal pure returns (uint200) { if (value > type(uint200).max) { revert SafeCastOverflowedUintDowncast(200, value); } return uint200(value); } /** * @dev Returns the downcasted uint192 from uint256, reverting on * overflow (when the input is greater than largest uint192). * * Counterpart to Solidity's `uint192` operator. * * Requirements: * * - input must fit into 192 bits */ function toUint192(uint256 value) internal pure returns (uint192) { if (value > type(uint192).max) { revert SafeCastOverflowedUintDowncast(192, value); } return uint192(value); } /** * @dev Returns the downcasted uint184 from uint256, reverting on * overflow (when the input is greater than largest uint184). * * Counterpart to Solidity's `uint184` operator. * * Requirements: * * - input must fit into 184 bits */ function toUint184(uint256 value) internal pure returns (uint184) { if (value > type(uint184).max) { revert SafeCastOverflowedUintDowncast(184, value); } return uint184(value); } /** * @dev Returns the downcasted uint176 from uint256, reverting on * overflow (when the input is greater than largest uint176). * * Counterpart to Solidity's `uint176` operator. * * Requirements: * * - input must fit into 176 bits */ function toUint176(uint256 value) internal pure returns (uint176) { if (value > type(uint176).max) { revert SafeCastOverflowedUintDowncast(176, value); } return uint176(value); } /** * @dev Returns the downcasted uint168 from uint256, reverting on * overflow (when the input is greater than largest uint168). * * Counterpart to Solidity's `uint168` operator. * * Requirements: * * - input must fit into 168 bits */ function toUint168(uint256 value) internal pure returns (uint168) { if (value > type(uint168).max) { revert SafeCastOverflowedUintDowncast(168, value); } return uint168(value); } /** * @dev Returns the downcasted uint160 from uint256, reverting on * overflow (when the input is greater than largest uint160). * * Counterpart to Solidity's `uint160` operator. * * Requirements: * * - input must fit into 160 bits */ function toUint160(uint256 value) internal pure returns (uint160) { if (value > type(uint160).max) { revert SafeCastOverflowedUintDowncast(160, value); } return uint160(value); } /** * @dev Returns the downcasted uint152 from uint256, reverting on * overflow (when the input is greater than largest uint152). * * Counterpart to Solidity's `uint152` operator. * * Requirements: * * - input must fit into 152 bits */ function toUint152(uint256 value) internal pure returns (uint152) { if (value > type(uint152).max) { revert SafeCastOverflowedUintDowncast(152, value); } return uint152(value); } /** * @dev Returns the downcasted uint144 from uint256, reverting on * overflow (when the input is greater than largest uint144). * * Counterpart to Solidity's `uint144` operator. * * Requirements: * * - input must fit into 144 bits */ function toUint144(uint256 value) internal pure returns (uint144) { if (value > type(uint144).max) { revert SafeCastOverflowedUintDowncast(144, value); } return uint144(value); } /** * @dev Returns the downcasted uint136 from uint256, reverting on * overflow (when the input is greater than largest uint136). * * Counterpart to Solidity's `uint136` operator. * * Requirements: * * - input must fit into 136 bits */ function toUint136(uint256 value) internal pure returns (uint136) { if (value > type(uint136).max) { revert SafeCastOverflowedUintDowncast(136, value); } return uint136(value); } /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { if (value > type(uint128).max) { revert SafeCastOverflowedUintDowncast(128, value); } return uint128(value); } /** * @dev Returns the downcasted uint120 from uint256, reverting on * overflow (when the input is greater than largest uint120). * * Counterpart to Solidity's `uint120` operator. * * Requirements: * * - input must fit into 120 bits */ function toUint120(uint256 value) internal pure returns (uint120) { if (value > type(uint120).max) { revert SafeCastOverflowedUintDowncast(120, value); } return uint120(value); } /** * @dev Returns the downcasted uint112 from uint256, reverting on * overflow (when the input is greater than largest uint112). * * Counterpart to Solidity's `uint112` operator. * * Requirements: * * - input must fit into 112 bits */ function toUint112(uint256 value) internal pure returns (uint112) { if (value > type(uint112).max) { revert SafeCastOverflowedUintDowncast(112, value); } return uint112(value); } /** * @dev Returns the downcasted uint104 from uint256, reverting on * overflow (when the input is greater than largest uint104). * * Counterpart to Solidity's `uint104` operator. * * Requirements: * * - input must fit into 104 bits */ function toUint104(uint256 value) internal pure returns (uint104) { if (value > type(uint104).max) { revert SafeCastOverflowedUintDowncast(104, value); } return uint104(value); } /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). * * Counterpart to Solidity's `uint96` operator. * * Requirements: * * - input must fit into 96 bits */ function toUint96(uint256 value) internal pure returns (uint96) { if (value > type(uint96).max) { revert SafeCastOverflowedUintDowncast(96, value); } return uint96(value); } /** * @dev Returns the downcasted uint88 from uint256, reverting on * overflow (when the input is greater than largest uint88). * * Counterpart to Solidity's `uint88` operator. * * Requirements: * * - input must fit into 88 bits */ function toUint88(uint256 value) internal pure returns (uint88) { if (value > type(uint88).max) { revert SafeCastOverflowedUintDowncast(88, value); } return uint88(value); } /** * @dev Returns the downcasted uint80 from uint256, reverting on * overflow (when the input is greater than largest uint80). * * Counterpart to Solidity's `uint80` operator. * * Requirements: * * - input must fit into 80 bits */ function toUint80(uint256 value) internal pure returns (uint80) { if (value > type(uint80).max) { revert SafeCastOverflowedUintDowncast(80, value); } return uint80(value); } /** * @dev Returns the downcasted uint72 from uint256, reverting on * overflow (when the input is greater than largest uint72). * * Counterpart to Solidity's `uint72` operator. * * Requirements: * * - input must fit into 72 bits */ function toUint72(uint256 value) internal pure returns (uint72) { if (value > type(uint72).max) { revert SafeCastOverflowedUintDowncast(72, value); } return uint72(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { if (value > type(uint64).max) { revert SafeCastOverflowedUintDowncast(64, value); } return uint64(value); } /** * @dev Returns the downcasted uint56 from uint256, reverting on * overflow (when the input is greater than largest uint56). * * Counterpart to Solidity's `uint56` operator. * * Requirements: * * - input must fit into 56 bits */ function toUint56(uint256 value) internal pure returns (uint56) { if (value > type(uint56).max) { revert SafeCastOverflowedUintDowncast(56, value); } return uint56(value); } /** * @dev Returns the downcasted uint48 from uint256, reverting on * overflow (when the input is greater than largest uint48). * * Counterpart to Solidity's `uint48` operator. * * Requirements: * * - input must fit into 48 bits */ function toUint48(uint256 value) internal pure returns (uint48) { if (value > type(uint48).max) { revert SafeCastOverflowedUintDowncast(48, value); } return uint48(value); } /** * @dev Returns the downcasted uint40 from uint256, reverting on * overflow (when the input is greater than largest uint40). * * Counterpart to Solidity's `uint40` operator. * * Requirements: * * - input must fit into 40 bits */ function toUint40(uint256 value) internal pure returns (uint40) { if (value > type(uint40).max) { revert SafeCastOverflowedUintDowncast(40, value); } return uint40(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { if (value > type(uint32).max) { revert SafeCastOverflowedUintDowncast(32, value); } return uint32(value); } /** * @dev Returns the downcasted uint24 from uint256, reverting on * overflow (when the input is greater than largest uint24). * * Counterpart to Solidity's `uint24` operator. * * Requirements: * * - input must fit into 24 bits */ function toUint24(uint256 value) internal pure returns (uint24) { if (value > type(uint24).max) { revert SafeCastOverflowedUintDowncast(24, value); } return uint24(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { if (value > type(uint16).max) { revert SafeCastOverflowedUintDowncast(16, value); } return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits */ function toUint8(uint256 value) internal pure returns (uint8) { if (value > type(uint8).max) { revert SafeCastOverflowedUintDowncast(8, value); } return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. */ function toUint256(int256 value) internal pure returns (uint256) { if (value < 0) { revert SafeCastOverflowedIntToUint(value); } return uint256(value); } /** * @dev Returns the downcasted int248 from int256, reverting on * overflow (when the input is less than smallest int248 or * greater than largest int248). * * Counterpart to Solidity's `int248` operator. * * Requirements: * * - input must fit into 248 bits */ function toInt248(int256 value) internal pure returns (int248 downcasted) { downcasted = int248(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(248, value); } } /** * @dev Returns the downcasted int240 from int256, reverting on * overflow (when the input is less than smallest int240 or * greater than largest int240). * * Counterpart to Solidity's `int240` operator. * * Requirements: * * - input must fit into 240 bits */ function toInt240(int256 value) internal pure returns (int240 downcasted) { downcasted = int240(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(240, value); } } /** * @dev Returns the downcasted int232 from int256, reverting on * overflow (when the input is less than smallest int232 or * greater than largest int232). * * Counterpart to Solidity's `int232` operator. * * Requirements: * * - input must fit into 232 bits */ function toInt232(int256 value) internal pure returns (int232 downcasted) { downcasted = int232(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(232, value); } } /** * @dev Returns the downcasted int224 from int256, reverting on * overflow (when the input is less than smallest int224 or * greater than largest int224). * * Counterpart to Solidity's `int224` operator. * * Requirements: * * - input must fit into 224 bits */ function toInt224(int256 value) internal pure returns (int224 downcasted) { downcasted = int224(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(224, value); } } /** * @dev Returns the downcasted int216 from int256, reverting on * overflow (when the input is less than smallest int216 or * greater than largest int216). * * Counterpart to Solidity's `int216` operator. * * Requirements: * * - input must fit into 216 bits */ function toInt216(int256 value) internal pure returns (int216 downcasted) { downcasted = int216(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(216, value); } } /** * @dev Returns the downcasted int208 from int256, reverting on * overflow (when the input is less than smallest int208 or * greater than largest int208). * * Counterpart to Solidity's `int208` operator. * * Requirements: * * - input must fit into 208 bits */ function toInt208(int256 value) internal pure returns (int208 downcasted) { downcasted = int208(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(208, value); } } /** * @dev Returns the downcasted int200 from int256, reverting on * overflow (when the input is less than smallest int200 or * greater than largest int200). * * Counterpart to Solidity's `int200` operator. * * Requirements: * * - input must fit into 200 bits */ function toInt200(int256 value) internal pure returns (int200 downcasted) { downcasted = int200(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(200, value); } } /** * @dev Returns the downcasted int192 from int256, reverting on * overflow (when the input is less than smallest int192 or * greater than largest int192). * * Counterpart to Solidity's `int192` operator. * * Requirements: * * - input must fit into 192 bits */ function toInt192(int256 value) internal pure returns (int192 downcasted) { downcasted = int192(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(192, value); } } /** * @dev Returns the downcasted int184 from int256, reverting on * overflow (when the input is less than smallest int184 or * greater than largest int184). * * Counterpart to Solidity's `int184` operator. * * Requirements: * * - input must fit into 184 bits */ function toInt184(int256 value) internal pure returns (int184 downcasted) { downcasted = int184(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(184, value); } } /** * @dev Returns the downcasted int176 from int256, reverting on * overflow (when the input is less than smallest int176 or * greater than largest int176). * * Counterpart to Solidity's `int176` operator. * * Requirements: * * - input must fit into 176 bits */ function toInt176(int256 value) internal pure returns (int176 downcasted) { downcasted = int176(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(176, value); } } /** * @dev Returns the downcasted int168 from int256, reverting on * overflow (when the input is less than smallest int168 or * greater than largest int168). * * Counterpart to Solidity's `int168` operator. * * Requirements: * * - input must fit into 168 bits */ function toInt168(int256 value) internal pure returns (int168 downcasted) { downcasted = int168(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(168, value); } } /** * @dev Returns the downcasted int160 from int256, reverting on * overflow (when the input is less than smallest int160 or * greater than largest int160). * * Counterpart to Solidity's `int160` operator. * * Requirements: * * - input must fit into 160 bits */ function toInt160(int256 value) internal pure returns (int160 downcasted) { downcasted = int160(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(160, value); } } /** * @dev Returns the downcasted int152 from int256, reverting on * overflow (when the input is less than smallest int152 or * greater than largest int152). * * Counterpart to Solidity's `int152` operator. * * Requirements: * * - input must fit into 152 bits */ function toInt152(int256 value) internal pure returns (int152 downcasted) { downcasted = int152(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(152, value); } } /** * @dev Returns the downcasted int144 from int256, reverting on * overflow (when the input is less than smallest int144 or * greater than largest int144). * * Counterpart to Solidity's `int144` operator. * * Requirements: * * - input must fit into 144 bits */ function toInt144(int256 value) internal pure returns (int144 downcasted) { downcasted = int144(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(144, value); } } /** * @dev Returns the downcasted int136 from int256, reverting on * overflow (when the input is less than smallest int136 or * greater than largest int136). * * Counterpart to Solidity's `int136` operator. * * Requirements: * * - input must fit into 136 bits */ function toInt136(int256 value) internal pure returns (int136 downcasted) { downcasted = int136(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(136, value); } } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits */ function toInt128(int256 value) internal pure returns (int128 downcasted) { downcasted = int128(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(128, value); } } /** * @dev Returns the downcasted int120 from int256, reverting on * overflow (when the input is less than smallest int120 or * greater than largest int120). * * Counterpart to Solidity's `int120` operator. * * Requirements: * * - input must fit into 120 bits */ function toInt120(int256 value) internal pure returns (int120 downcasted) { downcasted = int120(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(120, value); } } /** * @dev Returns the downcasted int112 from int256, reverting on * overflow (when the input is less than smallest int112 or * greater than largest int112). * * Counterpart to Solidity's `int112` operator. * * Requirements: * * - input must fit into 112 bits */ function toInt112(int256 value) internal pure returns (int112 downcasted) { downcasted = int112(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(112, value); } } /** * @dev Returns the downcasted int104 from int256, reverting on * overflow (when the input is less than smallest int104 or * greater than largest int104). * * Counterpart to Solidity's `int104` operator. * * Requirements: * * - input must fit into 104 bits */ function toInt104(int256 value) internal pure returns (int104 downcasted) { downcasted = int104(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(104, value); } } /** * @dev Returns the downcasted int96 from int256, reverting on * overflow (when the input is less than smallest int96 or * greater than largest int96). * * Counterpart to Solidity's `int96` operator. * * Requirements: * * - input must fit into 96 bits */ function toInt96(int256 value) internal pure returns (int96 downcasted) { downcasted = int96(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(96, value); } } /** * @dev Returns the downcasted int88 from int256, reverting on * overflow (when the input is less than smallest int88 or * greater than largest int88). * * Counterpart to Solidity's `int88` operator. * * Requirements: * * - input must fit into 88 bits */ function toInt88(int256 value) internal pure returns (int88 downcasted) { downcasted = int88(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(88, value); } } /** * @dev Returns the downcasted int80 from int256, reverting on * overflow (when the input is less than smallest int80 or * greater than largest int80). * * Counterpart to Solidity's `int80` operator. * * Requirements: * * - input must fit into 80 bits */ function toInt80(int256 value) internal pure returns (int80 downcasted) { downcasted = int80(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(80, value); } } /** * @dev Returns the downcasted int72 from int256, reverting on * overflow (when the input is less than smallest int72 or * greater than largest int72). * * Counterpart to Solidity's `int72` operator. * * Requirements: * * - input must fit into 72 bits */ function toInt72(int256 value) internal pure returns (int72 downcasted) { downcasted = int72(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(72, value); } } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits */ function toInt64(int256 value) internal pure returns (int64 downcasted) { downcasted = int64(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(64, value); } } /** * @dev Returns the downcasted int56 from int256, reverting on * overflow (when the input is less than smallest int56 or * greater than largest int56). * * Counterpart to Solidity's `int56` operator. * * Requirements: * * - input must fit into 56 bits */ function toInt56(int256 value) internal pure returns (int56 downcasted) { downcasted = int56(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(56, value); } } /** * @dev Returns the downcasted int48 from int256, reverting on * overflow (when the input is less than smallest int48 or * greater than largest int48). * * Counterpart to Solidity's `int48` operator. * * Requirements: * * - input must fit into 48 bits */ function toInt48(int256 value) internal pure returns (int48 downcasted) { downcasted = int48(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(48, value); } } /** * @dev Returns the downcasted int40 from int256, reverting on * overflow (when the input is less than smallest int40 or * greater than largest int40). * * Counterpart to Solidity's `int40` operator. * * Requirements: * * - input must fit into 40 bits */ function toInt40(int256 value) internal pure returns (int40 downcasted) { downcasted = int40(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(40, value); } } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits */ function toInt32(int256 value) internal pure returns (int32 downcasted) { downcasted = int32(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(32, value); } } /** * @dev Returns the downcasted int24 from int256, reverting on * overflow (when the input is less than smallest int24 or * greater than largest int24). * * Counterpart to Solidity's `int24` operator. * * Requirements: * * - input must fit into 24 bits */ function toInt24(int256 value) internal pure returns (int24 downcasted) { downcasted = int24(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(24, value); } } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits */ function toInt16(int256 value) internal pure returns (int16 downcasted) { downcasted = int16(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(16, value); } } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits */ function toInt8(int256 value) internal pure returns (int8 downcasted) { downcasted = int8(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(8, value); } } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive if (value > uint256(type(int256).max)) { revert SafeCastOverflowedUintToInt(value); } return int256(value); } /** * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump. */ function toUint(bool b) internal pure returns (uint256 u) { assembly ("memory-safe") { u := iszero(iszero(b)) } } } // File: @openzeppelin/contracts/utils/math/Math.sol // OpenZeppelin Contracts (last updated v5.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/utils/introspection/ERC165.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 ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } } // File: @openzeppelin/contracts/token/ERC721/ERC721.sol // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.20; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors { using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; mapping(uint256 tokenId => address) private _owners; mapping(address owner => uint256) private _balances; mapping(uint256 tokenId => address) private _tokenApprovals; mapping(address owner => mapping(address operator => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual returns (uint256) { if (owner == address(0)) { revert ERC721InvalidOwner(address(0)); } return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual returns (address) { return _requireOwned(tokenId); } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual returns (string memory) { _requireOwned(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual { _approve(to, tokenId, _msgSender()); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual returns (address) { _requireOwned(tokenId); return _getApproved(tokenId); } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here. address previousOwner = _update(to, tokenId, _msgSender()); if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual { transferFrom(from, to, tokenId); ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist * * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`. */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted. */ function _getApproved(uint256 tokenId) internal view virtual returns (address) { return _tokenApprovals[tokenId]; } /** * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in * particular (ignoring whether it is owned by `owner`). * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) { return spender != address(0) && (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender); } /** * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner. * Reverts if: * - `spender` does not have approval from `owner` for `tokenId`. * - `spender` does not have approval to manage all of `owner`'s assets. * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual { if (!_isAuthorized(owner, spender, tokenId)) { if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } else { revert ERC721InsufficientApproval(spender, tokenId); } } } /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that * a uint256 would ever overflow from increments when these increments are bounded to uint128 values. * * WARNING: Increasing an account's balance using this function tends to be paired with an override of the * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership * remain consistent with one another. */ function _increaseBalance(address account, uint128 value) internal virtual { unchecked { _balances[account] += value; } } /** * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update. * * The `auth` argument is optional. If the value passed is non 0, then this function will check that * `auth` is either the owner of the token, or approved to operate on the token (by the owner). * * Emits a {Transfer} event. * * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}. */ function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) { address from = _ownerOf(tokenId); // Perform (optional) operator check if (auth != address(0)) { _checkAuthorized(from, auth, tokenId); } // Execute the update if (from != address(0)) { // Clear approval. No need to re-authorize or emit the Approval event _approve(address(0), tokenId, address(0), false); unchecked { _balances[from] -= 1; } } if (to != address(0)) { unchecked { _balances[to] += 1; } } _owners[tokenId] = to; emit Transfer(from, to, tokenId); return from; } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner != address(0)) { revert ERC721InvalidSender(address(0)); } } /** * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual { _mint(to, tokenId); ERC721Utils.checkOnERC721Received(_msgSender(), address(0), to, tokenId, data); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal { address previousOwner = _update(address(0), tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } else if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients * are aware of the ERC-721 standard to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is like {safeTransferFrom} in the sense that it invokes * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `tokenId` token must exist and be owned by `from`. * - `to` cannot be the zero address. * - `from` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer(address from, address to, uint256 tokenId) internal { _safeTransfer(from, to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual { _transfer(from, to, tokenId); ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data); } /** * @dev Approve `to` to operate on `tokenId` * * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is * either the owner of the token, or approved to operate on all tokens held by this owner. * * Emits an {Approval} event. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address to, uint256 tokenId, address auth) internal { _approve(to, tokenId, auth, true); } /** * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not * emitted in the context of transfers. */ function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual { // Avoid reading the owner unless necessary if (emitEvent || auth != address(0)) { address owner = _requireOwned(tokenId); // We do not use _isAuthorized because single-token approvals should not be able to call approve if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) { revert ERC721InvalidApprover(auth); } if (emitEvent) { emit Approval(owner, to, tokenId); } } _tokenApprovals[tokenId] = to; } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Requirements: * - operator can't be the address zero. * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { if (operator == address(0)) { revert ERC721InvalidOperator(operator); } _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned). * Returns the owner. * * Overrides to ownership logic should be done to {_ownerOf}. */ function _requireOwned(uint256 tokenId) internal view returns (address) { address owner = _ownerOf(tokenId); if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } return owner; } } // File: GameMingles.sol pragma solidity ^0.8.18; ////////////////////// Custom Errors ////////////////////// error NftGame__NotOwner(); error NftGame__GameHasStarted(); error NftGame__GameHasNotStarted(); error NftGame__NoNftPrizeSet(); error NftGame__NftPrizeSet(); error NftGame__NftNotOwned(); error NftGame__NftIdRegistered(); error NftGame__NftIsDead(); error NftGame__NoSurvivors(); error NftGame__NoUsersRegistered(); error NftGame__NoNFTsPlayersAddress(); error NftGame__MingleNotOwned(); error NftGame__GameIsPaused(); error NftGame__AlreadyASurvivor(); error NftGame__MingleCannotRevive(); error NftGame__IncorrectAmount(); error NftGame__NextRoundNotAvailable(); error NftGame__GameMustBePaused(); contract NftGame { ////////////////////// Variables ////////////////////// // Owner of contract address address private immutable i_owner; // Cost of registry uint256 private gameCost; // bool variables, GAME STATUS AND GAME PAUSED bool private gameStatus; bool private gamePaused; bool private nextRoundAvailable; // Adress of NFTS that are playing - we use the mingles nft address private nftAddressPlayer; // mapping to user struct mapping(uint256 => User) private users; // Arrays for final battle, registered and lost players uint256[] private finalBattle; uint256[] private mingles; uint256[] private registros; uint256[] private jugadoresPerdidos; // Address and id of prize nft address private nftAddress; uint256 private nftId; ////////////////////// Events ////////////////////// event BalanceWithdrawn(uint256 amount); event GameStarted(); event GameEnded(); event Survivors(uint256[]); event WinnerSelected(uint256 winner); event NFTPrizeSet(address nftAddress, uint256 nftId); event NFTsSetForPlay(address nftAddressPlayer); event FailedAdventure(); event MayahuelRevivedYou(uint256); ////////////////////// Game Struct: User ////////////////////// struct User { uint256 nftId; bool status; bytes32 location; uint256 wormLvl; uint256 stage; bool revive; } ////////////////////// creation of contract to set the Owner ////////////////////// constructor() { i_owner = msg.sender; } ////////////////////// Modifiers ////////////////////// modifier onlyOwner() { if (msg.sender != i_owner) revert NftGame__NotOwner(); _; } modifier gameHasStarted() { if (gameStatus == false) revert NftGame__GameHasNotStarted(); _; } modifier notPaused(){ if (gamePaused == true) revert NftGame__GameIsPaused(); _; } modifier noContract { // this won't allow external contracts to interact with this contract require(tx.origin == msg.sender, "No contracts allowed"); _; } ////////////////////////////////////////////////////////////////////// ////////////////////// OnlyOwner Game Functions ////////////////////// ////////////////////// Start game function function gameStarted(address _nftAddress, uint256 _nftId, address _nftAddressPlayer, uint256 _gameCost) external onlyOwner noContract { if (gameStatus == true) revert NftGame__GameHasStarted(); if (nftAddress != address(0)) revert NftGame__NftPrizeSet(); if (ERC721(_nftAddress).ownerOf(_nftId) != i_owner) revert NftGame__NftNotOwned(); gameCost = _gameCost; nftAddress = _nftAddress; nftId = _nftId; nftAddressPlayer = _nftAddressPlayer; ERC721 nft = ERC721(nftAddress); nft.transferFrom(msg.sender, address(this), _nftId); gameStatus = true; emit GameStarted(); emit NFTPrizeSet(nftAddress, nftId); emit NFTsSetForPlay(nftAddressPlayer); } ////////////////////// Activate Pause Game function pauseGame() external onlyOwner noContract { gamePaused = !gamePaused; } ////////////////////// Activate or pause Next round function ToggleNextRound() external onlyOwner noContract { nextRoundAvailable = !nextRoundAvailable; } ////////////////////// Activate Failed Adventure/Mision function ActiveAdventureFailed() external onlyOwner noContract { require(gamePaused == true, "Game must be paused"); ERC721 nft = ERC721(nftAddress); nft.transferFrom(address(this), i_owner, nftId); emit FailedAdventure(); for (uint256 i; i < registros.length; i++) { users[registros[i]].status = true; users[registros[i]].revive = true; users[registros[i]].stage = 0; users[registros[i]].location = ""; } delete finalBattle; delete registros; delete jugadoresPerdidos; delete mingles; gamePaused = false; nftAddress = address(0); nftId = 0; gameStatus = false; nftAddressPlayer = address(0); } //////////////////////////////////////////////////////////////////////////////////////////// ////////////////////// Registry and NextGame functions - Users/Gamers ////////////////////// ////////////////////// New registry function register(uint256 _nft, uint256 _wormLvl, bytes32 _location) external payable gameHasStarted notPaused noContract returns (bool) { if (ERC721(nftAddressPlayer).ownerOf(_nft) != msg.sender) revert NftGame__NftNotOwned(); if (users[_nft].nftId == _nft && users[_nft].status == true) revert NftGame__NftIdRegistered(); if (users[_nft].nftId == _nft && users[_nft].status == false) revert NftGame__NftIsDead(); if (msg.value < gameCost) revert NftGame__IncorrectAmount(); User memory user = User(_nft, true, _location, _wormLvl, 0, true); users[_nft] = user; registros.push(_nft); return true; } ////////////////////// Check if the registry must be new or give a life to the Mingle to play another game function nextRound(uint256 _nft, uint256 _wormLvl, bytes32 _location) external payable gameHasStarted notPaused noContract returns (bool) { if (nextRoundAvailable == false) revert NftGame__NextRoundNotAvailable(); if (ERC721(nftAddressPlayer).ownerOf(_nft) != msg.sender) revert NftGame__NftNotOwned(); if (msg.value < gameCost) revert NftGame__IncorrectAmount(); User memory user = users[_nft]; if (user.nftId == 0) { User memory newUser = User(_nft, true, _location, _wormLvl, 0, true); users[_nft] = newUser; registros.push(_nft); return true; } users[_nft].location = _location; registros.push(_nft); return true; } //////////////////////////////////////////////////////////////////////////// ////////////////////// Get game information functions ////////////////////// function getOwner() external view returns (address) { return i_owner; } ////////////////////// Get the user by Mingle ID function getUser(uint256 _nft) external view returns (User memory) { return users[_nft]; } ////////////////////// Get number of the dead Mingles function getCaidos() external view returns (uint256) { return jugadoresPerdidos.length; } function getNftsOfFallenMingles() external view returns (uint256[] memory) { return jugadoresPerdidos; } ////////////////////// Get Game Status function getGameStatus() external view returns (bool) { return gameStatus; } ////////////////////// Get Game Status function getGamePausedStatus() external view returns (bool) { return gamePaused; } ////////////////////// Get Game Status function getNextRoundAvailable() external view returns (bool) { return nextRoundAvailable; } ////////////////////// Get NFT Prize contract and ID function getPrizeInfo() external view returns (address, uint256) { if (nftAddress == address(0)) revert NftGame__NoNftPrizeSet(); if (nftId == 0) revert NftGame__NoNftPrizeSet(); return (nftAddress, nftId); } ////////////////////// Get the address of the NFTs playing function getPlayingNFTsAddress() external view gameHasStarted returns (address) { if (nftAddressPlayer == address(0)) revert NftGame__NoNFTsPlayersAddress(); return nftAddressPlayer; } ////////////////////// Get all registered users function getAllRegisteredUsers() external view gameHasStarted returns (uint256[] memory) { if (registros.length == 0) revert NftGame__NoUsersRegistered(); return registros; } ////////////////////// Get the amount of users registered function getAmountOfRegisteredUsers() external view gameHasStarted returns (uint256) { if (registros.length == 0) revert NftGame__NoUsersRegistered(); return registros.length; } ////////////////////// Get the array of survivors who enter the raffle for NFT prize function getSurvivors() external view gameHasStarted returns (uint256[] memory) { if (finalBattle.length == 0) revert NftGame__NoSurvivors(); return finalBattle; } ////////////////////// Get the length of the survivors array - Number of participants in th raffle function getSurvivorsLength() external view gameHasStarted returns (uint256) { return finalBattle.length; } ////////////////////// Get the array of survivors who enter the raffle for NFT prize function getMinglesForRaffle() external view gameHasStarted returns (uint256[] memory) { if (finalBattle.length == 0) revert NftGame__NoSurvivors(); return mingles; } ////////////////////// Get the length of the survivors array - Number of participants in th raffle function getMinglesForRaffleLength() external view gameHasStarted returns (uint256) { return mingles.length; } //////////////////////////////////////////////////////////////////// ////////////////////// Revive Mingle function ////////////////////// ////////////////////// Trigger random chance to revive function reviveMingle(uint256 _nft) private gameHasStarted returns (bool) { if (ERC721(nftAddressPlayer).ownerOf(_nft) != msg.sender) revert NftGame__MingleNotOwned(); if (users[_nft].revive == false) revert NftGame__MingleCannotRevive(); bytes32 deadLocation = 0x6465616400000000000000000000000000000000000000000000000000000000; User storage mingle = users[_nft]; uint256 yourChanceToRevive = mingle.wormLvl; uint256 decition = randomchoices() + 1; if (decition <= yourChanceToRevive) { mingle.status = true; mingle.revive = false; emit MayahuelRevivedYou(_nft); return true; } else { mingle.revive = false; mingle.status = false; mingle.location = deadLocation; jugadoresPerdidos.push(_nft); return false; } } //////////////////////////////////////////////////////////////////////////// ////////////////////// Battle to dead Mingle function ////////////////////// ////////////////////// Trigger random choice to survive function choice(uint256 _nft, bytes32 _location, uint256 num) external gameHasStarted notPaused noContract returns (bool){ if (ERC721(nftAddressPlayer).ownerOf(_nft) != msg.sender) revert NftGame__MingleNotOwned(); if (users[_nft].status = false) revert NftGame__NftIsDead(); if (users[_nft].stage == 6) revert NftGame__AlreadyASurvivor(); User storage mingle = users[_nft]; bytes32 deadLocation = 0x6465616400000000000000000000000000000000000000000000000000000000; uint256 randomNumber = randomchoices() + 1; if (randomNumber > num) { mingle.status = true; mingle.location = _location; mingle.stage ++; if (mingle.stage == 6){ finalBattle.push(_nft); } return true; } else if (randomNumber <= num && mingle.revive == true) { return reviveMingle(_nft); } else if (randomNumber <= num && mingle.revive == false) { mingle.status = false; mingle.location = deadLocation; jugadoresPerdidos.push(_nft); return false; } return false; } //////////////////////////////////////////////////////////////////////////// ////////////////////// Battle to dead Mingle function ////////////////////// ////////////////////// Trigger random choice to survive function escapeChoice(uint256 _nft, bytes32 _location) external gameHasStarted noContract returns (bool){ if (ERC721(nftAddressPlayer).ownerOf(_nft) != msg.sender) revert NftGame__MingleNotOwned(); if (users[_nft].status = false) revert NftGame__NftIsDead(); require(gamePaused == true, "Game must be paused"); uint256 percentageToDie = 70; User storage mingle = users[_nft]; bytes32 deadLocation = 0x6465616400000000000000000000000000000000000000000000000000000000; uint256 randomNumer = randomchoices() + 1; if (randomNumer > percentageToDie) { mingle.status = true; mingle.location = _location; mingle.stage ++; mingles.push(_nft); return true; } else if (randomNumer <= percentageToDie && mingle.revive == true) { return reviveMingle(_nft); } else if (randomNumer <= percentageToDie && mingle.revive == false) { mingle.status = false; jugadoresPerdidos.push(_nft); mingle.location = deadLocation; return false; } return false; } ////////////////////// Trigger random choice to compare with "dead" function function randomchoices() private view returns (uint256) { uint256 num = 100; return uint256( keccak256( abi.encodePacked( blockhash(block.number - 1), block.timestamp, num ) ) ) % num; } /////////////////////////////////////////////////////////////////////// ////////////////////// Final Step game functions ////////////////////// ////////////////////// Mingle defeated the raven, enters to the survivors chamber for raffle, /*function survivor(uint256 _nft) private gameHasStarted notPaused returns (bool) { finalBattle.push(_nft); return true; } ////////////////////// Mingles will try to escape to earn prize function escape(uint256 _nft) private gameHasStarted returns (bool) { mingles.push(_nft); return true; }*/ ////////////////////// Select a winner and send prize (NFT) automatically to winner address function selectWinner() external gameHasStarted onlyOwner noContract returns (uint256) { //payable? require(gamePaused == true, "Game must be paused"); if (mingles.length == 0) revert NftGame__NoSurvivors(); ERC721 playerNft = ERC721(nftAddressPlayer); ERC721 prizeNft = ERC721(nftAddress); if (mingles.length == 1) { address onlyWinner = playerNft.ownerOf(mingles[0]); prizeNft.transferFrom(address(this), onlyWinner, nftId); uint256 winner1 = mingles[0]; emit WinnerSelected(winner1); return winner1; } uint256 winnerIndex = random() % mingles.length; uint256 winner = mingles[winnerIndex]; address winnerAddress = playerNft.ownerOf(winner); prizeNft.transferFrom(address(this), winnerAddress, nftId); emit WinnerSelected(winner); return winner; } ////////////////////// Random choice to trigger in winner function function random() private view returns (uint256) { return uint256( keccak256( abi.encodePacked( blockhash(block.number - 1), block.timestamp, mingles.length ) ) ); } ////////////////////// Reset game function resetGame() external gameHasStarted onlyOwner noContract { require(gamePaused == true, "Game must be paused"); for (uint256 i; i < registros.length; i++) { users[registros[i]].status = true; users[registros[i]].revive = true; users[registros[i]].stage = 0; users[registros[i]].location = ""; } delete finalBattle; delete jugadoresPerdidos; delete registros; delete mingles; gamePaused = false; nftAddress = address(0); nftId = 0; gameStatus = false; nftAddressPlayer = address(0); } ////////////////////// If no survivors left the game end as a failed adventure /* function AdventureFailed() external gameHasStarted onlyOwner { require(gamePaused == true, "Game must be paused"); nft.transferFrom(address(this), i_owner, nftId); for (uint256 i = 0; i < registros.length; i++) { users[registros[i]].status = false; users[registros[i]].stage = 0; } delete finalBattle; delete registros; caidos = 0; nftAddress = address(0); nftId = 0; gameStatus = false; nftAddressPlayer = address(0); emit FailedAdventure(); }*/ ////////////////////////////////////////////////////////////////////////// ////////////////////// OnlyOwner contract functions ////////////////////// function withdrawBalance() external onlyOwner { require(address(this).balance > 0, "No Balance to withdraw"); payable(i_owner).transfer(address(this).balance); emit BalanceWithdrawn(address(this).balance); } //////////////////////////////////////////////////////////////// ////////////////////// Contract functions ////////////////////// function getBalance() external view returns (uint256) { return address(this).balance; } //////////////////////////////////////////////////////////////// ////////////////////// Receive and Fallback ////////////////////// // Ether is sent to contract // is msg.data empty? // / \ // yes no // / \ // receive()? fallback() // / \ // yes no // / \ //receive() fallback() // Function to receive Ether. msg.data must be empty receive() external payable {} // Fallback function is called when msg.data is not empty fallback() external payable {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"NftGame__AlreadyASurvivor","type":"error"},{"inputs":[],"name":"NftGame__GameHasNotStarted","type":"error"},{"inputs":[],"name":"NftGame__GameHasStarted","type":"error"},{"inputs":[],"name":"NftGame__GameIsPaused","type":"error"},{"inputs":[],"name":"NftGame__IncorrectAmount","type":"error"},{"inputs":[],"name":"NftGame__MingleCannotRevive","type":"error"},{"inputs":[],"name":"NftGame__MingleNotOwned","type":"error"},{"inputs":[],"name":"NftGame__NextRoundNotAvailable","type":"error"},{"inputs":[],"name":"NftGame__NftIdRegistered","type":"error"},{"inputs":[],"name":"NftGame__NftIsDead","type":"error"},{"inputs":[],"name":"NftGame__NftNotOwned","type":"error"},{"inputs":[],"name":"NftGame__NftPrizeSet","type":"error"},{"inputs":[],"name":"NftGame__NoNFTsPlayersAddress","type":"error"},{"inputs":[],"name":"NftGame__NoNftPrizeSet","type":"error"},{"inputs":[],"name":"NftGame__NoSurvivors","type":"error"},{"inputs":[],"name":"NftGame__NoUsersRegistered","type":"error"},{"inputs":[],"name":"NftGame__NotOwner","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BalanceWithdrawn","type":"event"},{"anonymous":false,"inputs":[],"name":"FailedAdventure","type":"event"},{"anonymous":false,"inputs":[],"name":"GameEnded","type":"event"},{"anonymous":false,"inputs":[],"name":"GameStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"","type":"uint256"}],"name":"MayahuelRevivedYou","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"nftAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"nftId","type":"uint256"}],"name":"NFTPrizeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"nftAddressPlayer","type":"address"}],"name":"NFTsSetForPlay","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"","type":"uint256[]"}],"name":"Survivors","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"winner","type":"uint256"}],"name":"WinnerSelected","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"ActiveAdventureFailed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ToggleNextRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_nft","type":"uint256"},{"internalType":"bytes32","name":"_location","type":"bytes32"},{"internalType":"uint256","name":"num","type":"uint256"}],"name":"choice","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_nft","type":"uint256"},{"internalType":"bytes32","name":"_location","type":"bytes32"}],"name":"escapeChoice","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftAddress","type":"address"},{"internalType":"uint256","name":"_nftId","type":"uint256"},{"internalType":"address","name":"_nftAddressPlayer","type":"address"},{"internalType":"uint256","name":"_gameCost","type":"uint256"}],"name":"gameStarted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAllRegisteredUsers","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAmountOfRegisteredUsers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCaidos","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGamePausedStatus","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGameStatus","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMinglesForRaffle","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMinglesForRaffleLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNextRoundAvailable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNftsOfFallenMingles","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPlayingNFTsAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrizeInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSurvivors","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSurvivorsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_nft","type":"uint256"}],"name":"getUser","outputs":[{"components":[{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"bool","name":"status","type":"bool"},{"internalType":"bytes32","name":"location","type":"bytes32"},{"internalType":"uint256","name":"wormLvl","type":"uint256"},{"internalType":"uint256","name":"stage","type":"uint256"},{"internalType":"bool","name":"revive","type":"bool"}],"internalType":"struct NftGame.User","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_nft","type":"uint256"},{"internalType":"uint256","name":"_wormLvl","type":"uint256"},{"internalType":"bytes32","name":"_location","type":"bytes32"}],"name":"nextRound","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"pauseGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_nft","type":"uint256"},{"internalType":"uint256","name":"_wormLvl","type":"uint256"},{"internalType":"bytes32","name":"_location","type":"bytes32"}],"name":"register","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"resetGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"selectWinner","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60a0604052348015600e575f80fd5b50336080526080516125bb6100715f395f818161030f015281816106e201528181610af601528181610b7b01528181610c3201528181610e1c01528181610eaf015281816110030152818161108a01528181611157015261168f01526125bb5ff3fe60806040526004361061018a575f3560e01c806388150f46116100df578063b0467deb11610083578063c26681b211610060578063c26681b2146104f0578063c8f50fc414610504578063df4c9f5f14610517578063f2537e621461053657005b8063b0467deb146103cc578063bb472219146104c9578063be36a231146104dd57005b806397534760116100bc5780639753476014610347578063995dbf351461035b5780639c4cea561461037a578063a8d4bb751461039957005b806388150f46146102ed578063893d20e8146103015780639544d7d51461033357005b8063382396ee11610146578063507dfa5e11610123578063507dfa5e1461029557806354e464d9146102a95780635fd8c710146102c557806360cbae48146102d957005b8063382396ee14610256578063397388af1461026d578063499831f21461028157005b8063044c254e1461019357806306e9cf7c146101bd57806312065fe0146101e95780632476ef8e146102055780632879593a1461021957806333a99e041461024257005b3661019157005b005b34801561019e575f80fd5b506101a761054a565b6040516101b4919061236b565b60405180910390f35b3480156101c8575f80fd5b506101d16105eb565b6040516001600160a01b0390911681526020016101b4565b3480156101f4575f80fd5b50475b6040519081526020016101b4565b348015610210575f80fd5b506101a761065a565b348015610224575f80fd5b5060015462010000900460ff165b60405190151581526020016101b4565b34801561024d575f80fd5b506101f76106ae565b348015610261575f80fd5b5060015460ff16610232565b348015610278575f80fd5b506101a7610a4d565b34801561028c575f80fd5b50610191610aeb565b3480156102a0575f80fd5b50610191610b70565b3480156102b4575f80fd5b50600154610100900460ff16610232565b3480156102d0575f80fd5b50610191610e11565b3480156102e4575f80fd5b506006546101f7565b3480156102f8575f80fd5b506101f7610f2a565b34801561030c575f80fd5b507f00000000000000000000000000000000000000000000000000000000000000006101d1565b34801561033e575f80fd5b506101a7610f5a565b348015610352575f80fd5b50610191610ff8565b348015610366575f80fd5b506101916103753660046123c1565b61107f565b348015610385575f80fd5b50610232610394366004612406565b611357565b3480156103a4575f80fd5b506103ad6115f8565b604080516001600160a01b0390931683526020830191909152016101b4565b3480156103d7575f80fd5b5061047a6103e636600461242f565b6040805160c0810182525f80825260208201819052918101829052606081018290526080810182905260a0810191909152505f90815260026020818152604092839020835160c08101855281548152600182015460ff90811615159382019390935292810154938301939093526003830154606083015260048301546080830152600590920154909116151560a082015290565b6040516101b491905f60c0820190508251825260208301511515602083015260408301516040830152606083015160608301526080830151608083015260a0830151151560a083015292915050565b3480156104d4575f80fd5b5061019161165d565b6102326104eb366004612406565b611877565b3480156104fb575f80fd5b506101f7611af9565b610232610512366004612406565b611b29565b348015610522575f80fd5b50610232610531366004612446565b611df1565b348015610541575f80fd5b506101f7612064565b60015460609060ff1615155f03610574576040516337ec30ad60e11b815260040160405180910390fd5b6003545f0361059657604051636bee7d1360e11b815260040160405180910390fd5b60038054806020026020016040519081016040528092919081815260200182805480156105e057602002820191905f5260205f20905b8154815260200190600101908083116105cc575b505050505090505b90565b6001545f9060ff1615158103610614576040516337ec30ad60e11b815260040160405180910390fd5b600154630100000090046001600160a01b031661064357604051628d342760e31b815260040160405180910390fd5b50600154630100000090046001600160a01b031690565b606060068054806020026020016040519081016040528092919081815260200182805480156105e057602002820191905f5260205f20908154815260200190600101908083116105cc575050505050905090565b6001545f9060ff16151581036106d7576040516337ec30ad60e11b815260040160405180910390fd5b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146107205760405163eacd196360e01b815260040160405180910390fd5b3233146107485760405162461bcd60e51b815260040161073f90612466565b60405180910390fd5b60018054610100900460ff161515146107735760405162461bcd60e51b815260040161073f90612494565b6004545f0361079557604051636bee7d1360e11b815260040160405180910390fd5b6001805460075460045463010000009092046001600160a01b03908116939116919003610909575f826001600160a01b0316636352211e60045f815481106107df576107df6124c1565b905f5260205f2001546040518263ffffffff1660e01b815260040161080691815260200190565b602060405180830381865afa158015610821573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061084591906124d5565b6008546040516323b872dd60e01b81529192506001600160a01b038416916323b872dd9161087991309186916004016124f0565b5f604051808303815f87803b158015610890575f80fd5b505af11580156108a2573d5f803e3d5ffd5b505050505f60045f815481106108ba576108ba6124c1565b905f5260205f20015490507f5b8029a9910b8fcad05daba83c75f73f39307c65c013cab42074f6a1d9cc4fb9816040516108f691815260200190565b60405180910390a193506105e892505050565b6004545f906109166120b6565b6109209190612514565b90505f60048281548110610936576109366124c1565b5f9182526020822001546040516331a9108f60e11b8152600481018290529092506001600160a01b03861690636352211e90602401602060405180830381865afa158015610986573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109aa91906124d5565b6008546040516323b872dd60e01b81529192506001600160a01b038616916323b872dd916109de91309186916004016124f0565b5f604051808303815f87803b1580156109f5575f80fd5b505af1158015610a07573d5f803e3d5ffd5b505050507f5b8029a9910b8fcad05daba83c75f73f39307c65c013cab42074f6a1d9cc4fb982604051610a3c91815260200190565b60405180910390a150935050505090565b60015460609060ff1615155f03610a77576040516337ec30ad60e11b815260040160405180910390fd5b6005545f03610a99576040516328d1fe8960e21b815260040160405180910390fd5b60058054806020026020016040519081016040528092919081815260200182805480156105e057602002820191905f5260205f20908154815260200190600101908083116105cc575050505050905090565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b345760405163eacd196360e01b815260040160405180910390fd5b323314610b535760405162461bcd60e51b815260040161073f90612466565b6001805461ff001981166101009182900460ff1615909102179055565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610bb95760405163eacd196360e01b815260040160405180910390fd5b323314610bd85760405162461bcd60e51b815260040161073f90612466565b60018054610100900460ff16151514610c035760405162461bcd60e51b815260040161073f90612494565b6007546008546040516323b872dd60e01b81526001600160a01b039092169182916323b872dd91610c5b9130917f000000000000000000000000000000000000000000000000000000000000000091906004016124f0565b5f604051808303815f87803b158015610c72575f80fd5b505af1158015610c84573d5f803e3d5ffd5b50506040517f7ed4d19739fc569443e290d1ddacfcc2da645f2397d2356d6d7f4af9b529bb0492505f9150a15f5b600554811015610dbb57600160025f60058481548110610cd457610cd46124c1565b905f5260205f20015481526020019081526020015f206001015f6101000a81548160ff021916908315150217905550600160025f60058481548110610d1b57610d1b6124c1565b905f5260205f20015481526020019081526020015f206005015f6101000a81548160ff0219169083151502179055505f60025f60058481548110610d6157610d616124c1565b905f5260205f20015481526020019081526020015f20600401819055505f60025f60058481548110610d9557610d956124c1565b5f9182526020808320909101548352820192909252604001902060020155600101610cb2565b50610dc760035f612335565b610dd260055f612335565b610ddd60065f612335565b610de860045f612335565b5060018054600780546001600160a01b03191690555f60085562ff0001600160b81b0319169055565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610e5a5760405163eacd196360e01b815260040160405180910390fd5b5f4711610ea25760405162461bcd60e51b81526020600482015260166024820152754e6f2042616c616e636520746f20776974686472617760501b604482015260640161073f565b6040516001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016904780156108fc02915f818181858888f19350505050158015610ef4573d5f803e3d5ffd5b506040514781527f39f8b889424a1684bd36857c25ab79691ed71adf60bbeca32820cb4de3c5884c9060200160405180910390a1565b6001545f9060ff1615158103610f53576040516337ec30ad60e11b815260040160405180910390fd5b5060045490565b60015460609060ff1615155f03610f84576040516337ec30ad60e11b815260040160405180910390fd5b6003545f03610fa657604051636bee7d1360e11b815260040160405180910390fd5b60048054806020026020016040519081016040528092919081815260200182805480156105e057602002820191905f5260205f20908154815260200190600101908083116105cc575050505050905090565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146110415760405163eacd196360e01b815260040160405180910390fd5b3233146110605760405162461bcd60e51b815260040161073f90612466565b6001805462ff0000198116620100009182900460ff1615909102179055565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146110c85760405163eacd196360e01b815260040160405180910390fd5b3233146110e75760405162461bcd60e51b815260040161073f90612466565b6001805460ff161515900361110f5760405163c26b847960e01b815260040160405180910390fd5b6007546001600160a01b03161561113957604051631cd884f760e21b815260040160405180910390fd5b6040516331a9108f60e11b8152600481018490526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169190861690636352211e90602401602060405180830381865afa1580156111a1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111c591906124d5565b6001600160a01b0316146111ec57604051632ca0b21760e21b815260040160405180910390fd5b5f819055600780546001600160a01b038087166001600160a01b031990921682179092556008859055600180549285166301000000026301000000600160b81b0319909316929092179091556040516323b872dd60e01b815281906323b872dd9061125f903390309089906004016124f0565b5f604051808303815f87803b158015611276575f80fd5b505af1158015611288573d5f803e3d5ffd5b50506001805460ff19168117905550506040517f762f260439bb4be3ef6e4dc2786e2e7bd187d3d80b79057d7a424fe98563e335905f90a1600754600854604080516001600160a01b03909316835260208301919091527f2ac20e8e7908ca4f6e905c54ac2fe40c31c687b210db2a2718e3e54ccfe95711910160405180910390a160015460405163010000009091046001600160a01b031681527f8ba44fd790a24b8545295befc3b3fa0665718b04a4c76dfeeb5f64d2a01fca359060200160405180910390a15050505050565b6001545f9060ff1615158103611380576040516337ec30ad60e11b815260040160405180910390fd5b60018054610100900460ff16151590036113ad5760405163ddda073f60e01b815260040160405180910390fd5b3233146113cc5760405162461bcd60e51b815260040161073f90612466565b6001546040516331a9108f60e11b8152600481018690523391630100000090046001600160a01b031690636352211e90602401602060405180830381865afa15801561141a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061143e91906124d5565b6001600160a01b031614611465576040516305fe0a9b60e31b815260040160405180910390fd5b5f84815260026020526040902060018101805460ff19169055600401546006036114a257604051631f465d2360e21b815260040160405180910390fd5b5f84815260026020526040812090631919585960e21b906114c16120fa565b6114cc906001612547565b905084811115611550576001838101805460ff1916909117905560028301869055600483018054905f6114fe8361255a565b9190505550826004015460060361154457600380546001810182555f919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b018790555b600193505050506115f1565b8481111580156115695750600583015460ff1615156001145b15611581576115778761214b565b93505050506115f1565b8481111580156115965750600583015460ff16155b156115ea57506001808301805460ff191690556002909201556006805491820181555f9081527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f90910185905590506115f1565b5f93505050505b9392505050565b6007545f9081906001600160a01b03166116255760405163a79ee01960e01b815260040160405180910390fd5b6008545f036116475760405163a79ee01960e01b815260040160405180910390fd5b50506007546008546001600160a01b0390911691565b60015460ff1615155f03611684576040516337ec30ad60e11b815260040160405180910390fd5b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146116cd5760405163eacd196360e01b815260040160405180910390fd5b3233146116ec5760405162461bcd60e51b815260040161073f90612466565b60018054610100900460ff161515146117175760405162461bcd60e51b815260040161073f90612494565b5f5b60055481101561182257600160025f6005848154811061173b5761173b6124c1565b905f5260205f20015481526020019081526020015f206001015f6101000a81548160ff021916908315150217905550600160025f60058481548110611782576117826124c1565b905f5260205f20015481526020019081526020015f206005015f6101000a81548160ff0219169083151502179055505f60025f600584815481106117c8576117c86124c1565b905f5260205f20015481526020019081526020015f20600401819055505f60025f600584815481106117fc576117fc6124c1565b5f9182526020808320909101548352820192909252604001902060020155600101611719565b5061182e60035f612335565b61183960065f612335565b61184460055f612335565b61184f60045f612335565b60018054600780546001600160a01b03191690555f60085562ff0001600160b81b0319169055565b6001545f9060ff16151581036118a0576040516337ec30ad60e11b815260040160405180910390fd5b60018054610100900460ff16151590036118cd5760405163ddda073f60e01b815260040160405180910390fd5b3233146118ec5760405162461bcd60e51b815260040161073f90612466565b6001546040516331a9108f60e11b8152600481018690523391630100000090046001600160a01b031690636352211e90602401602060405180830381865afa15801561193a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061195e91906124d5565b6001600160a01b03161461198557604051632ca0b21760e21b815260040160405180910390fd5b5f84815260026020526040902054841480156119b657505f84815260026020526040902060019081015460ff161515145b156119d4576040516397e0f2c360e01b815260040160405180910390fd5b5f8481526002602052604090205484148015611a0157505f8481526002602052604090206001015460ff16155b15611a1f57604051637b5fd0a160e11b815260040160405180910390fd5b5f54341015611a41576040516302d1324b60e51b815260040160405180910390fd5b506040805160c08101825284815260016020808301828152838501868152606085018881525f6080870181815260a088018781528c8352600296879052988220975188559351878701805491151560ff1992831617905592519487019490945551600386015590516004850155935160059384018054911515919095161790935581548082018355919092527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0018490559392505050565b6001545f9060ff1615158103611b22576040516337ec30ad60e11b815260040160405180910390fd5b5060035490565b6001545f9060ff1615158103611b52576040516337ec30ad60e11b815260040160405180910390fd5b60018054610100900460ff1615159003611b7f5760405163ddda073f60e01b815260040160405180910390fd5b323314611b9e5760405162461bcd60e51b815260040161073f90612466565b60015462010000900460ff1615155f03611bcb576040516341b25dbd60e11b815260040160405180910390fd5b6001546040516331a9108f60e11b8152600481018690523391630100000090046001600160a01b031690636352211e90602401602060405180830381865afa158015611c19573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c3d91906124d5565b6001600160a01b031614611c6457604051632ca0b21760e21b815260040160405180910390fd5b5f54341015611c86576040516302d1324b60e51b815260040160405180910390fd5b5f848152600260208181526040808420815160c0810183528154808252600183015460ff9081161515958301959095529482015492810192909252600381015460608301526004810154608083015260050154909116151560a08201529103611da05750506040805160c08101825284815260016020808301828152838501868152606085018881525f6080870181815260a088018781528c8352600296879052988220975188559351878701805491151560ff1992831617905592519487019490945551600386015590516004850155935160059384018054911515919095161790935581548082018355919092527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0018490556115f1565b50505f838152600260208190526040822001919091556005805460018082018355919092527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0909101929092555090565b6001545f9060ff1615158103611e1a576040516337ec30ad60e11b815260040160405180910390fd5b323314611e395760405162461bcd60e51b815260040161073f90612466565b6001546040516331a9108f60e11b8152600481018590523391630100000090046001600160a01b031690636352211e90602401602060405180830381865afa158015611e87573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611eab91906124d5565b6001600160a01b031614611ed2576040516305fe0a9b60e31b815260040160405180910390fd5b5f838152600260205260409020600101805460ff1916905560018054610100900460ff16151514611f155760405162461bcd60e51b815260040161073f90612494565b5f838152600260205260408120604691631919585960e21b90611f366120fa565b611f41906001612547565b905083811115611fb9576001838101805460ff1916909117905560028301869055600483018054905f611f738361255a565b909155505060048054600181810183555f929092527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01889055945061205e9350505050565b838111158015611fd25750600583015460ff1615156001145b15611feb57611fe08761214b565b94505050505061205e565b8381111580156120005750600583015460ff16155b1561205657506001808301805460ff191690556006805491820181555f9081527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f909101879055600290920155915061205e9050565b5f9450505050505b92915050565b6001545f9060ff161515810361208d576040516337ec30ad60e11b815260040160405180910390fd5b6005545f036120af576040516328d1fe8960e21b815260040160405180910390fd5b5060055490565b5f6120c2600143612572565b600454604080519240602084015242908301526060820152608001604051602081830303815290604052805190602001205f1c905090565b5f606480612109600143612572565b6040805191406020830152429082015260608101839052608001604051602081830303815290604052805190602001205f1c6121459190612514565b91505090565b6001545f9060ff1615158103612174576040516337ec30ad60e11b815260040160405180910390fd5b6001546040516331a9108f60e11b8152600481018490523391630100000090046001600160a01b031690636352211e90602401602060405180830381865afa1580156121c2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906121e691906124d5565b6001600160a01b03161461220d576040516305fe0a9b60e31b815260040160405180910390fd5b5f8281526002602052604081206005015460ff1615159003612242576040516347ec4eb360e11b815260040160405180910390fd5b5f8281526002602052604081206003810154631919585960e21b926122656120fa565b612270906001612547565b90508181116122d5576001838101805460ff19908116909217905560058401805490911690556040518681527f4067ee0473f9807f7c9a4b0a644bf8609aa558211ffe27df218ebe848bc2b6889060200160405180910390a150600195945050505050565b505060058101805460ff19908116909155600180830180549092169091556002909101919091556006805491820181555f9081527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f909101929092555090565b5080545f8255905f5260205f20908101906123509190612353565b50565b5b80821115612367575f8155600101612354565b5090565b602080825282518282018190525f918401906040840190835b818110156123a2578351835260209384019390920191600101612384565b509095945050505050565b6001600160a01b0381168114612350575f80fd5b5f805f80608085870312156123d4575f80fd5b84356123df816123ad565b93506020850135925060408501356123f6816123ad565b9396929550929360600135925050565b5f805f60608486031215612418575f80fd5b505081359360208301359350604090920135919050565b5f6020828403121561243f575f80fd5b5035919050565b5f8060408385031215612457575f80fd5b50508035926020909101359150565b602080825260149082015273139bc818dbdb9d1c9858dd1cc8185b1b1bddd95960621b604082015260600190565b60208082526013908201527211d85b59481b5d5cdd081899481c185d5cd959606a1b604082015260600190565b634e487b7160e01b5f52603260045260245ffd5b5f602082840312156124e5575f80fd5b81516115f1816123ad565b6001600160a01b039384168152919092166020820152604081019190915260600190565b5f8261252e57634e487b7160e01b5f52601260045260245ffd5b500690565b634e487b7160e01b5f52601160045260245ffd5b8082018082111561205e5761205e612533565b5f6001820161256b5761256b612533565b5060010190565b8181038181111561205e5761205e61253356fea2646970667358221220100e2143a96376fed60d08bb36d5d8161ada99e66c0bbe4825ab77cca00a295f64736f6c634300081a0033
Deployed Bytecode
0x60806040526004361061018a575f3560e01c806388150f46116100df578063b0467deb11610083578063c26681b211610060578063c26681b2146104f0578063c8f50fc414610504578063df4c9f5f14610517578063f2537e621461053657005b8063b0467deb146103cc578063bb472219146104c9578063be36a231146104dd57005b806397534760116100bc5780639753476014610347578063995dbf351461035b5780639c4cea561461037a578063a8d4bb751461039957005b806388150f46146102ed578063893d20e8146103015780639544d7d51461033357005b8063382396ee11610146578063507dfa5e11610123578063507dfa5e1461029557806354e464d9146102a95780635fd8c710146102c557806360cbae48146102d957005b8063382396ee14610256578063397388af1461026d578063499831f21461028157005b8063044c254e1461019357806306e9cf7c146101bd57806312065fe0146101e95780632476ef8e146102055780632879593a1461021957806333a99e041461024257005b3661019157005b005b34801561019e575f80fd5b506101a761054a565b6040516101b4919061236b565b60405180910390f35b3480156101c8575f80fd5b506101d16105eb565b6040516001600160a01b0390911681526020016101b4565b3480156101f4575f80fd5b50475b6040519081526020016101b4565b348015610210575f80fd5b506101a761065a565b348015610224575f80fd5b5060015462010000900460ff165b60405190151581526020016101b4565b34801561024d575f80fd5b506101f76106ae565b348015610261575f80fd5b5060015460ff16610232565b348015610278575f80fd5b506101a7610a4d565b34801561028c575f80fd5b50610191610aeb565b3480156102a0575f80fd5b50610191610b70565b3480156102b4575f80fd5b50600154610100900460ff16610232565b3480156102d0575f80fd5b50610191610e11565b3480156102e4575f80fd5b506006546101f7565b3480156102f8575f80fd5b506101f7610f2a565b34801561030c575f80fd5b507f000000000000000000000000ca067e20db2cdef80d1c7130e5b71c42c03055296101d1565b34801561033e575f80fd5b506101a7610f5a565b348015610352575f80fd5b50610191610ff8565b348015610366575f80fd5b506101916103753660046123c1565b61107f565b348015610385575f80fd5b50610232610394366004612406565b611357565b3480156103a4575f80fd5b506103ad6115f8565b604080516001600160a01b0390931683526020830191909152016101b4565b3480156103d7575f80fd5b5061047a6103e636600461242f565b6040805160c0810182525f80825260208201819052918101829052606081018290526080810182905260a0810191909152505f90815260026020818152604092839020835160c08101855281548152600182015460ff90811615159382019390935292810154938301939093526003830154606083015260048301546080830152600590920154909116151560a082015290565b6040516101b491905f60c0820190508251825260208301511515602083015260408301516040830152606083015160608301526080830151608083015260a0830151151560a083015292915050565b3480156104d4575f80fd5b5061019161165d565b6102326104eb366004612406565b611877565b3480156104fb575f80fd5b506101f7611af9565b610232610512366004612406565b611b29565b348015610522575f80fd5b50610232610531366004612446565b611df1565b348015610541575f80fd5b506101f7612064565b60015460609060ff1615155f03610574576040516337ec30ad60e11b815260040160405180910390fd5b6003545f0361059657604051636bee7d1360e11b815260040160405180910390fd5b60038054806020026020016040519081016040528092919081815260200182805480156105e057602002820191905f5260205f20905b8154815260200190600101908083116105cc575b505050505090505b90565b6001545f9060ff1615158103610614576040516337ec30ad60e11b815260040160405180910390fd5b600154630100000090046001600160a01b031661064357604051628d342760e31b815260040160405180910390fd5b50600154630100000090046001600160a01b031690565b606060068054806020026020016040519081016040528092919081815260200182805480156105e057602002820191905f5260205f20908154815260200190600101908083116105cc575050505050905090565b6001545f9060ff16151581036106d7576040516337ec30ad60e11b815260040160405180910390fd5b336001600160a01b037f000000000000000000000000ca067e20db2cdef80d1c7130e5b71c42c030552916146107205760405163eacd196360e01b815260040160405180910390fd5b3233146107485760405162461bcd60e51b815260040161073f90612466565b60405180910390fd5b60018054610100900460ff161515146107735760405162461bcd60e51b815260040161073f90612494565b6004545f0361079557604051636bee7d1360e11b815260040160405180910390fd5b6001805460075460045463010000009092046001600160a01b03908116939116919003610909575f826001600160a01b0316636352211e60045f815481106107df576107df6124c1565b905f5260205f2001546040518263ffffffff1660e01b815260040161080691815260200190565b602060405180830381865afa158015610821573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061084591906124d5565b6008546040516323b872dd60e01b81529192506001600160a01b038416916323b872dd9161087991309186916004016124f0565b5f604051808303815f87803b158015610890575f80fd5b505af11580156108a2573d5f803e3d5ffd5b505050505f60045f815481106108ba576108ba6124c1565b905f5260205f20015490507f5b8029a9910b8fcad05daba83c75f73f39307c65c013cab42074f6a1d9cc4fb9816040516108f691815260200190565b60405180910390a193506105e892505050565b6004545f906109166120b6565b6109209190612514565b90505f60048281548110610936576109366124c1565b5f9182526020822001546040516331a9108f60e11b8152600481018290529092506001600160a01b03861690636352211e90602401602060405180830381865afa158015610986573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109aa91906124d5565b6008546040516323b872dd60e01b81529192506001600160a01b038616916323b872dd916109de91309186916004016124f0565b5f604051808303815f87803b1580156109f5575f80fd5b505af1158015610a07573d5f803e3d5ffd5b505050507f5b8029a9910b8fcad05daba83c75f73f39307c65c013cab42074f6a1d9cc4fb982604051610a3c91815260200190565b60405180910390a150935050505090565b60015460609060ff1615155f03610a77576040516337ec30ad60e11b815260040160405180910390fd5b6005545f03610a99576040516328d1fe8960e21b815260040160405180910390fd5b60058054806020026020016040519081016040528092919081815260200182805480156105e057602002820191905f5260205f20908154815260200190600101908083116105cc575050505050905090565b336001600160a01b037f000000000000000000000000ca067e20db2cdef80d1c7130e5b71c42c03055291614610b345760405163eacd196360e01b815260040160405180910390fd5b323314610b535760405162461bcd60e51b815260040161073f90612466565b6001805461ff001981166101009182900460ff1615909102179055565b336001600160a01b037f000000000000000000000000ca067e20db2cdef80d1c7130e5b71c42c03055291614610bb95760405163eacd196360e01b815260040160405180910390fd5b323314610bd85760405162461bcd60e51b815260040161073f90612466565b60018054610100900460ff16151514610c035760405162461bcd60e51b815260040161073f90612494565b6007546008546040516323b872dd60e01b81526001600160a01b039092169182916323b872dd91610c5b9130917f000000000000000000000000ca067e20db2cdef80d1c7130e5b71c42c030552991906004016124f0565b5f604051808303815f87803b158015610c72575f80fd5b505af1158015610c84573d5f803e3d5ffd5b50506040517f7ed4d19739fc569443e290d1ddacfcc2da645f2397d2356d6d7f4af9b529bb0492505f9150a15f5b600554811015610dbb57600160025f60058481548110610cd457610cd46124c1565b905f5260205f20015481526020019081526020015f206001015f6101000a81548160ff021916908315150217905550600160025f60058481548110610d1b57610d1b6124c1565b905f5260205f20015481526020019081526020015f206005015f6101000a81548160ff0219169083151502179055505f60025f60058481548110610d6157610d616124c1565b905f5260205f20015481526020019081526020015f20600401819055505f60025f60058481548110610d9557610d956124c1565b5f9182526020808320909101548352820192909252604001902060020155600101610cb2565b50610dc760035f612335565b610dd260055f612335565b610ddd60065f612335565b610de860045f612335565b5060018054600780546001600160a01b03191690555f60085562ff0001600160b81b0319169055565b336001600160a01b037f000000000000000000000000ca067e20db2cdef80d1c7130e5b71c42c03055291614610e5a5760405163eacd196360e01b815260040160405180910390fd5b5f4711610ea25760405162461bcd60e51b81526020600482015260166024820152754e6f2042616c616e636520746f20776974686472617760501b604482015260640161073f565b6040516001600160a01b037f000000000000000000000000ca067e20db2cdef80d1c7130e5b71c42c030552916904780156108fc02915f818181858888f19350505050158015610ef4573d5f803e3d5ffd5b506040514781527f39f8b889424a1684bd36857c25ab79691ed71adf60bbeca32820cb4de3c5884c9060200160405180910390a1565b6001545f9060ff1615158103610f53576040516337ec30ad60e11b815260040160405180910390fd5b5060045490565b60015460609060ff1615155f03610f84576040516337ec30ad60e11b815260040160405180910390fd5b6003545f03610fa657604051636bee7d1360e11b815260040160405180910390fd5b60048054806020026020016040519081016040528092919081815260200182805480156105e057602002820191905f5260205f20908154815260200190600101908083116105cc575050505050905090565b336001600160a01b037f000000000000000000000000ca067e20db2cdef80d1c7130e5b71c42c030552916146110415760405163eacd196360e01b815260040160405180910390fd5b3233146110605760405162461bcd60e51b815260040161073f90612466565b6001805462ff0000198116620100009182900460ff1615909102179055565b336001600160a01b037f000000000000000000000000ca067e20db2cdef80d1c7130e5b71c42c030552916146110c85760405163eacd196360e01b815260040160405180910390fd5b3233146110e75760405162461bcd60e51b815260040161073f90612466565b6001805460ff161515900361110f5760405163c26b847960e01b815260040160405180910390fd5b6007546001600160a01b03161561113957604051631cd884f760e21b815260040160405180910390fd5b6040516331a9108f60e11b8152600481018490526001600160a01b037f000000000000000000000000ca067e20db2cdef80d1c7130e5b71c42c030552981169190861690636352211e90602401602060405180830381865afa1580156111a1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111c591906124d5565b6001600160a01b0316146111ec57604051632ca0b21760e21b815260040160405180910390fd5b5f819055600780546001600160a01b038087166001600160a01b031990921682179092556008859055600180549285166301000000026301000000600160b81b0319909316929092179091556040516323b872dd60e01b815281906323b872dd9061125f903390309089906004016124f0565b5f604051808303815f87803b158015611276575f80fd5b505af1158015611288573d5f803e3d5ffd5b50506001805460ff19168117905550506040517f762f260439bb4be3ef6e4dc2786e2e7bd187d3d80b79057d7a424fe98563e335905f90a1600754600854604080516001600160a01b03909316835260208301919091527f2ac20e8e7908ca4f6e905c54ac2fe40c31c687b210db2a2718e3e54ccfe95711910160405180910390a160015460405163010000009091046001600160a01b031681527f8ba44fd790a24b8545295befc3b3fa0665718b04a4c76dfeeb5f64d2a01fca359060200160405180910390a15050505050565b6001545f9060ff1615158103611380576040516337ec30ad60e11b815260040160405180910390fd5b60018054610100900460ff16151590036113ad5760405163ddda073f60e01b815260040160405180910390fd5b3233146113cc5760405162461bcd60e51b815260040161073f90612466565b6001546040516331a9108f60e11b8152600481018690523391630100000090046001600160a01b031690636352211e90602401602060405180830381865afa15801561141a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061143e91906124d5565b6001600160a01b031614611465576040516305fe0a9b60e31b815260040160405180910390fd5b5f84815260026020526040902060018101805460ff19169055600401546006036114a257604051631f465d2360e21b815260040160405180910390fd5b5f84815260026020526040812090631919585960e21b906114c16120fa565b6114cc906001612547565b905084811115611550576001838101805460ff1916909117905560028301869055600483018054905f6114fe8361255a565b9190505550826004015460060361154457600380546001810182555f919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b018790555b600193505050506115f1565b8481111580156115695750600583015460ff1615156001145b15611581576115778761214b565b93505050506115f1565b8481111580156115965750600583015460ff16155b156115ea57506001808301805460ff191690556002909201556006805491820181555f9081527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f90910185905590506115f1565b5f93505050505b9392505050565b6007545f9081906001600160a01b03166116255760405163a79ee01960e01b815260040160405180910390fd5b6008545f036116475760405163a79ee01960e01b815260040160405180910390fd5b50506007546008546001600160a01b0390911691565b60015460ff1615155f03611684576040516337ec30ad60e11b815260040160405180910390fd5b336001600160a01b037f000000000000000000000000ca067e20db2cdef80d1c7130e5b71c42c030552916146116cd5760405163eacd196360e01b815260040160405180910390fd5b3233146116ec5760405162461bcd60e51b815260040161073f90612466565b60018054610100900460ff161515146117175760405162461bcd60e51b815260040161073f90612494565b5f5b60055481101561182257600160025f6005848154811061173b5761173b6124c1565b905f5260205f20015481526020019081526020015f206001015f6101000a81548160ff021916908315150217905550600160025f60058481548110611782576117826124c1565b905f5260205f20015481526020019081526020015f206005015f6101000a81548160ff0219169083151502179055505f60025f600584815481106117c8576117c86124c1565b905f5260205f20015481526020019081526020015f20600401819055505f60025f600584815481106117fc576117fc6124c1565b5f9182526020808320909101548352820192909252604001902060020155600101611719565b5061182e60035f612335565b61183960065f612335565b61184460055f612335565b61184f60045f612335565b60018054600780546001600160a01b03191690555f60085562ff0001600160b81b0319169055565b6001545f9060ff16151581036118a0576040516337ec30ad60e11b815260040160405180910390fd5b60018054610100900460ff16151590036118cd5760405163ddda073f60e01b815260040160405180910390fd5b3233146118ec5760405162461bcd60e51b815260040161073f90612466565b6001546040516331a9108f60e11b8152600481018690523391630100000090046001600160a01b031690636352211e90602401602060405180830381865afa15801561193a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061195e91906124d5565b6001600160a01b03161461198557604051632ca0b21760e21b815260040160405180910390fd5b5f84815260026020526040902054841480156119b657505f84815260026020526040902060019081015460ff161515145b156119d4576040516397e0f2c360e01b815260040160405180910390fd5b5f8481526002602052604090205484148015611a0157505f8481526002602052604090206001015460ff16155b15611a1f57604051637b5fd0a160e11b815260040160405180910390fd5b5f54341015611a41576040516302d1324b60e51b815260040160405180910390fd5b506040805160c08101825284815260016020808301828152838501868152606085018881525f6080870181815260a088018781528c8352600296879052988220975188559351878701805491151560ff1992831617905592519487019490945551600386015590516004850155935160059384018054911515919095161790935581548082018355919092527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0018490559392505050565b6001545f9060ff1615158103611b22576040516337ec30ad60e11b815260040160405180910390fd5b5060035490565b6001545f9060ff1615158103611b52576040516337ec30ad60e11b815260040160405180910390fd5b60018054610100900460ff1615159003611b7f5760405163ddda073f60e01b815260040160405180910390fd5b323314611b9e5760405162461bcd60e51b815260040161073f90612466565b60015462010000900460ff1615155f03611bcb576040516341b25dbd60e11b815260040160405180910390fd5b6001546040516331a9108f60e11b8152600481018690523391630100000090046001600160a01b031690636352211e90602401602060405180830381865afa158015611c19573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c3d91906124d5565b6001600160a01b031614611c6457604051632ca0b21760e21b815260040160405180910390fd5b5f54341015611c86576040516302d1324b60e51b815260040160405180910390fd5b5f848152600260208181526040808420815160c0810183528154808252600183015460ff9081161515958301959095529482015492810192909252600381015460608301526004810154608083015260050154909116151560a08201529103611da05750506040805160c08101825284815260016020808301828152838501868152606085018881525f6080870181815260a088018781528c8352600296879052988220975188559351878701805491151560ff1992831617905592519487019490945551600386015590516004850155935160059384018054911515919095161790935581548082018355919092527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0018490556115f1565b50505f838152600260208190526040822001919091556005805460018082018355919092527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0909101929092555090565b6001545f9060ff1615158103611e1a576040516337ec30ad60e11b815260040160405180910390fd5b323314611e395760405162461bcd60e51b815260040161073f90612466565b6001546040516331a9108f60e11b8152600481018590523391630100000090046001600160a01b031690636352211e90602401602060405180830381865afa158015611e87573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611eab91906124d5565b6001600160a01b031614611ed2576040516305fe0a9b60e31b815260040160405180910390fd5b5f838152600260205260409020600101805460ff1916905560018054610100900460ff16151514611f155760405162461bcd60e51b815260040161073f90612494565b5f838152600260205260408120604691631919585960e21b90611f366120fa565b611f41906001612547565b905083811115611fb9576001838101805460ff1916909117905560028301869055600483018054905f611f738361255a565b909155505060048054600181810183555f929092527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01889055945061205e9350505050565b838111158015611fd25750600583015460ff1615156001145b15611feb57611fe08761214b565b94505050505061205e565b8381111580156120005750600583015460ff16155b1561205657506001808301805460ff191690556006805491820181555f9081527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f909101879055600290920155915061205e9050565b5f9450505050505b92915050565b6001545f9060ff161515810361208d576040516337ec30ad60e11b815260040160405180910390fd5b6005545f036120af576040516328d1fe8960e21b815260040160405180910390fd5b5060055490565b5f6120c2600143612572565b600454604080519240602084015242908301526060820152608001604051602081830303815290604052805190602001205f1c905090565b5f606480612109600143612572565b6040805191406020830152429082015260608101839052608001604051602081830303815290604052805190602001205f1c6121459190612514565b91505090565b6001545f9060ff1615158103612174576040516337ec30ad60e11b815260040160405180910390fd5b6001546040516331a9108f60e11b8152600481018490523391630100000090046001600160a01b031690636352211e90602401602060405180830381865afa1580156121c2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906121e691906124d5565b6001600160a01b03161461220d576040516305fe0a9b60e31b815260040160405180910390fd5b5f8281526002602052604081206005015460ff1615159003612242576040516347ec4eb360e11b815260040160405180910390fd5b5f8281526002602052604081206003810154631919585960e21b926122656120fa565b612270906001612547565b90508181116122d5576001838101805460ff19908116909217905560058401805490911690556040518681527f4067ee0473f9807f7c9a4b0a644bf8609aa558211ffe27df218ebe848bc2b6889060200160405180910390a150600195945050505050565b505060058101805460ff19908116909155600180830180549092169091556002909101919091556006805491820181555f9081527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f909101929092555090565b5080545f8255905f5260205f20908101906123509190612353565b50565b5b80821115612367575f8155600101612354565b5090565b602080825282518282018190525f918401906040840190835b818110156123a2578351835260209384019390920191600101612384565b509095945050505050565b6001600160a01b0381168114612350575f80fd5b5f805f80608085870312156123d4575f80fd5b84356123df816123ad565b93506020850135925060408501356123f6816123ad565b9396929550929360600135925050565b5f805f60608486031215612418575f80fd5b505081359360208301359350604090920135919050565b5f6020828403121561243f575f80fd5b5035919050565b5f8060408385031215612457575f80fd5b50508035926020909101359150565b602080825260149082015273139bc818dbdb9d1c9858dd1cc8185b1b1bddd95960621b604082015260600190565b60208082526013908201527211d85b59481b5d5cdd081899481c185d5cd959606a1b604082015260600190565b634e487b7160e01b5f52603260045260245ffd5b5f602082840312156124e5575f80fd5b81516115f1816123ad565b6001600160a01b039384168152919092166020820152604081019190915260600190565b5f8261252e57634e487b7160e01b5f52601260045260245ffd5b500690565b634e487b7160e01b5f52601160045260245ffd5b8082018082111561205e5761205e612533565b5f6001820161256b5761256b612533565b5060010190565b8181038181111561205e5761205e61253356fea2646970667358221220100e2143a96376fed60d08bb36d5d8161ada99e66c0bbe4825ab77cca00a295f64736f6c634300081a0033
Deployed Bytecode Sourcemap
122701:18896:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;131354:186;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;130520:207;;;;;;;;;;;;;:::i;:::-;;;-1:-1:-1;;;;;794:32:1;;;776:51;;764:2;749:18;130520:207:0;630:203:1;140894:101:0;;;;;;;;;;-1:-1:-1;140966:21:0;140894:101;;;984:25:1;;;972:2;957:18;140894:101:0;838:177:1;129576:118:0;;;;;;;;;;;;;:::i;130036:106::-;;;;;;;;;;-1:-1:-1;130116:18:0;;;;;;;130036:106;;;1185:14:1;;1178:22;1160:41;;1148:2;1133:18;130036:106:0;1020:187:1;137540:949:0;;;;;;;;;;;;;:::i;129746:90::-;;;;;;;;;;-1:-1:-1;129818:10:0;;;;129746:90;;130788:197;;;;;;;;;;;;;:::i;126005:94::-;;;;;;;;;;;;;:::i;126349:812::-;;;;;;;;;;;;;:::i;129888:96::-;;;;;;;;;;-1:-1:-1;129966:10:0;;;;;;;129888:96;;140505:239;;;;;;;;;;;;;:::i;129465:103::-;;;;;;;;;;-1:-1:-1;129536:17:0;:24;129465:103;;132172:124;;;;;;;;;;;;;:::i;129147:85::-;;;;;;;;;;-1:-1:-1;129217:7:0;129147:85;;131871:189;;;;;;;;;;;;;:::i;126164:116::-;;;;;;;;;;;;;:::i;125180:769::-;;;;;;;;;;-1:-1:-1;125180:769:0;;;;;:::i;:::-;;:::i;133675:1212::-;;;;;;;;;;-1:-1:-1;133675:1212:0;;;;;:::i;:::-;;:::i;130208:240::-;;;;;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;;;;2645:32:1;;;2627:51;;2709:2;2694:18;;2687:34;;;;2600:18;130208:240:0;2453:274:1;129294:104:0;;;;;;;;;;-1:-1:-1;129294:104:0;;;;;:::i;:::-;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;129379:11:0;;;;:5;:11;;;;;;;;;129372:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;129294:104;;;;;;;3099:4:1;3141:3;3130:9;3126:19;3118:27;;3178:6;3172:13;3161:9;3154:32;3256:4;3248:6;3244:17;3238:24;3231:32;3224:40;3217:4;3206:9;3202:20;3195:70;3321:4;3313:6;3309:17;3303:24;3296:4;3285:9;3281:20;3274:54;3384:4;3376:6;3372:17;3366:24;3359:4;3348:9;3344:20;3337:54;3447:4;3439:6;3435:17;3429:24;3422:4;3411:9;3407:20;3400:54;3524:4;3516:6;3512:17;3506:24;3499:32;3492:40;3485:4;3474:9;3470:20;3463:70;2963:576;;;;;138972:660:0;;;;;;;;;;;;;:::i;127408:679::-;;;;;;:::i;:::-;;:::i;131652:121::-;;;;;;;;;;;;;:::i;128211:760::-;;;;;;:::i;:::-;;:::i;135122:1217::-;;;;;;;;;;-1:-1:-1;135122:1217:0;;;;;:::i;:::-;;:::i;131056:200::-;;;;;;;;;;;;;:::i;131354:186::-;124596:10;;131416:16;;124596:10;;:19;;:10;:19;124592:60;;124624:28;;-1:-1:-1;;;124624:28:0;;;;;;;;;;;124592:60;131449:11:::1;:18:::0;131471:1:::1;131449:23:::0;131445:58:::1;;131481:22;;-1:-1:-1::0;;;131481:22:0::1;;;;;;;;;;;131445:58;131521:11;131514:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;124663:1;131354:186:::0;:::o;130520:207::-;124596:10;;130591:7;;124596:10;;:19;;;;124592:60;;124624:28;;-1:-1:-1;;;124624:28:0;;;;;;;;;;;124592:60;130615:16:::1;::::0;;;::::1;-1:-1:-1::0;;;;;130615:16:0::1;130611:74;;130654:31;;-1:-1:-1::0;;;130654:31:0::1;;;;;;;;;;;130611:74;-1:-1:-1::0;130703:16:0::1;::::0;;;::::1;-1:-1:-1::0;;;;;130703:16:0::1;::::0;130520:207::o;129576:118::-;129633:16;129669:17;129662:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;129576:118;:::o;137540:949::-;124596:10;;137618:7;;124596:10;;:19;;;;124592:60;;124624:28;;-1:-1:-1;;;124624:28:0;;;;;;;;;;;124592:60;124478:10:::1;-1:-1:-1::0;;;;;124492:7:0::1;124478:21;;124474:53;;124508:19;;-1:-1:-1::0;;;124508:19:0::1;;;;;;;;;;;124474:53;124902:9:::2;124915:10;124902:23;124894:56;;;;-1:-1:-1::0;;;124894:56:0::2;;;;;;;:::i;:::-;;;;;;;;;137657:10:::3;::::0;;::::3;::::0;::::3;;;:18;;;137649:50;;;;-1:-1:-1::0;;;137649:50:0::3;;;;;;;:::i;:::-;137714:7;:14:::0;137732:1:::3;137714:19:::0;137710:54:::3;;137742:22;;-1:-1:-1::0;;;137742:22:0::3;;;;;;;;;;;137710:54;137803:16;::::0;;137856:10:::3;::::0;137884:7:::3;:14:::0;137803:16;;;::::3;-1:-1:-1::0;;;;;137803:16:0;;::::3;::::0;137856:10;::::3;::::0;137884:19;;137880:289:::3;;137920:18;137941:9;-1:-1:-1::0;;;;;137941:17:0::3;;137959:7;137967:1;137959:10;;;;;;;;:::i;:::-;;;;;;;;;137941:29;;;;;;;;;;;;;984:25:1::0;;972:2;957:18;;838:177;137941:29:0::3;;;;;;;;;;;;;;;;;;::::0;::::3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;138034:5;::::0;137985:55:::3;::::0;-1:-1:-1;;;137985:55:0;;137920:50;;-1:-1:-1;;;;;;137985:21:0;::::3;::::0;::::3;::::0;:55:::3;::::0;138015:4:::3;::::0;137920:50;;137985:55:::3;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::3;;;;;;;;;;;;::::0;::::3;;;;;;;;;138055:15;138073:7;138081:1;138073:10;;;;;;;;:::i;:::-;;;;;;;;;138055:28;;138103:23;138118:7;138103:23;;;;984:25:1::0;;972:2;957:18;;838:177;138103:23:0::3;;;;;;;;138150:7:::0;-1:-1:-1;138143:14:0::3;::::0;-1:-1:-1;;;138143:14:0::3;137880:289;138214:7;:14:::0;138181:19:::3;::::0;138203:8:::3;:6;:8::i;:::-;:25;;;;:::i;:::-;138181:47;;138239:14;138256:7;138264:11;138256:20;;;;;;;;:::i;:::-;;::::0;;;::::3;::::0;;::::3;::::0;138311:25:::3;::::0;-1:-1:-1;;;138311:25:0;;::::3;::::0;::::3;984::1::0;;;138256:20:0;;-1:-1:-1;;;;;;138311:17:0;::::3;::::0;::::3;::::0;957:18:1;;138311:25:0::3;;;;;;;;;;;;;;;;;::::0;::::3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;138399:5;::::0;138347:58:::3;::::0;-1:-1:-1;;;138347:58:0;;138287:49;;-1:-1:-1;;;;;;138347:21:0;::::3;::::0;::::3;::::0;:58:::3;::::0;138377:4:::3;::::0;138287:49;;138347:58:::3;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::3;;;;;;;;;;;;::::0;::::3;;;;;;;;;138423:22;138438:6;138423:22;;;;984:25:1::0;;972:2;957:18;;838:177;138423:22:0::3;;;;;;;;-1:-1:-1::0;138475:6:0;-1:-1:-1;;;;137540:949:0;:::o;130788:197::-;124596:10;;130859:16;;124596:10;;:19;;:10;:19;124592:60;;124624:28;;-1:-1:-1;;;124624:28:0;;;;;;;;;;;124592:60;130892:9:::1;:16:::0;130912:1:::1;130892:21:::0;130888:62:::1;;130922:28;;-1:-1:-1::0;;;130922:28:0::1;;;;;;;;;;;130888:62;130968:9;130961:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;130788:197:::0;:::o;126005:94::-;124478:10;-1:-1:-1;;;;;124492:7:0;124478:21;;124474:53;;124508:19;;-1:-1:-1;;;124508:19:0;;;;;;;;;;;124474:53;124902:9:::1;124915:10;124902:23;124894:56;;;;-1:-1:-1::0;;;124894:56:0::1;;;;;;;:::i;:::-;126081:10:::2;::::0;;-1:-1:-1;;126067:24:0;::::2;126081:10;::::0;;;::::2;;;126080:11;126067:24:::0;;::::2;;::::0;;126005:94::o;126349:812::-;124478:10;-1:-1:-1;;;;;124492:7:0;124478:21;;124474:53;;124508:19;;-1:-1:-1;;;124508:19:0;;;;;;;;;;;124474:53;124902:9:::1;124915:10;124902:23;124894:56;;;;-1:-1:-1::0;;;124894:56:0::1;;;;;;;:::i;:::-;126431:10:::2;::::0;;::::2;::::0;::::2;;;:18;;;126423:50;;;;-1:-1:-1::0;;;126423:50:0::2;;;;;;;:::i;:::-;126514:10;::::0;126577:5:::2;::::0;126536:47:::2;::::0;-1:-1:-1;;;126536:47:0;;-1:-1:-1;;;;;126514:10:0;;::::2;::::0;;;126536:16:::2;::::0;:47:::2;::::0;126561:4:::2;::::0;126568:7:::2;::::0;126577:5;126536:47:::2;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;-1:-1:-1::0;;126601:17:0::2;::::0;::::2;::::0;-1:-1:-1;126601:17:0;;-1:-1:-1;126601:17:0::2;126636:9;126631:243;126651:9;:16:::0;126647:20;::::2;126631:243;;;126718:4;126689:5;:19;126695:9;126705:1;126695:12;;;;;;;;:::i;:::-;;;;;;;;;126689:19;;;;;;;;;;;:26;;;:33;;;;;;;;;;;;;;;;;;126766:4;126737:5;:19;126743:9;126753:1;126743:12;;;;;;;;:::i;:::-;;;;;;;;;126737:19;;;;;;;;;;;:26;;;:33;;;;;;;;;;;;;;;;;;126813:1;126785:5;:19;126791:9;126801:1;126791:12;;;;;;;;:::i;:::-;;;;;;;;;126785:19;;;;;;;;;;;:25;;:29;;;;126829:33;:5;:19;126835:9;126845:1;126835:12;;;;;;;;:::i;:::-;;::::0;;;::::2;::::0;;;;;::::2;::::0;126829:19;;;::::2;::::0;;;;;;;;:28:::2;;:33:::0;126669:3:::2;;126631:243;;;-1:-1:-1::0;126886:18:0::2;126893:11;;126886:18;:::i;:::-;126915:16;126922:9;;126915:16;:::i;:::-;126942:24;126949:17;;126942:24;:::i;:::-;126977:14;126984:7;;126977:14;:::i;:::-;-1:-1:-1::0;127002:10:0::2;:18:::0;;127031:10:::2;:23:::0;;-1:-1:-1;;;;;;127031:23:0::2;::::0;;127015:5:::2;127065;:9:::0;-1:-1:-1;;;;;;127114:29:0;;;126349:812::o;140505:239::-;124478:10;-1:-1:-1;;;;;124492:7:0;124478:21;;124474:53;;124508:19;;-1:-1:-1;;;124508:19:0;;;;;;;;;;;124474:53;140594:1:::1;140570:21;:25;140562:60;;;::::0;-1:-1:-1;;;140562:60:0;;6243:2:1;140562:60:0::1;::::0;::::1;6225:21:1::0;6282:2;6262:18;;;6255:30;-1:-1:-1;;;6301:18:1;;;6294:52;6363:18;;140562:60:0::1;6041:346:1::0;140562:60:0::1;140633:48;::::0;-1:-1:-1;;;;;140641:7:0::1;140633:25;::::0;140659:21:::1;140633:48:::0;::::1;;;::::0;::::1;::::0;;;140659:21;140633:25;:48;::::1;;;;;;;;;;;;;::::0;::::1;;;;;-1:-1:-1::0;140697:39:0::1;::::0;140714:21:::1;984:25:1::0;;140697:39:0::1;::::0;972:2:1;957:18;140697:39:0::1;;;;;;;140505:239::o:0;132172:124::-;124596:10;;132247:7;;124596:10;;:19;;;;124592:60;;124624:28;;-1:-1:-1;;;124624:28:0;;;;;;;;;;;124592:60;-1:-1:-1;132274:7:0::1;:14:::0;132172:124;:::o;131871:189::-;124596:10;;131940:16;;124596:10;;:19;;:10;:19;124592:60;;124624:28;;-1:-1:-1;;;124624:28:0;;;;;;;;;;;124592:60;131973:11:::1;:18:::0;131995:1:::1;131973:23:::0;131969:58:::1;;132005:22;;-1:-1:-1::0;;;132005:22:0::1;;;;;;;;;;;131969:58;132045:7;132038:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;131871:189:::0;:::o;126164:116::-;124478:10;-1:-1:-1;;;;;124492:7:0;124478:21;;124474:53;;124508:19;;-1:-1:-1;;;124508:19:0;;;;;;;;;;;124474:53;124902:9:::1;124915:10;124902:23;124894:56;;;;-1:-1:-1::0;;;124894:56:0::1;;;;;;;:::i;:::-;126254:18:::2;::::0;;-1:-1:-1;;126232:40:0;::::2;126254:18:::0;;;;::::2;;;126253:19;126232:40:::0;;::::2;;::::0;;126164:116::o;125180:769::-;124478:10;-1:-1:-1;;;;;124492:7:0;124478:21;;124474:53;;124508:19;;-1:-1:-1;;;124508:19:0;;;;;;;;;;;124474:53;124902:9:::1;124915:10;124902:23;124894:56;;;;-1:-1:-1::0;;;124894:56:0::1;;;;;;;:::i;:::-;125330:10:::2;::::0;;::::2;;:18;;::::0;;125326:56:::2;;125357:25;;-1:-1:-1::0;;;125357:25:0::2;;;;;;;;;;;125326:56;125397:10;::::0;-1:-1:-1;;;;;125397:10:0::2;:24:::0;125393:59:::2;;125430:22;;-1:-1:-1::0;;;125430:22:0::2;;;;;;;;;;;125393:59;125467:35;::::0;-1:-1:-1;;;125467:35:0;;::::2;::::0;::::2;984:25:1::0;;;-1:-1:-1;;;;;125506:7:0::2;125467:46:::0;::::2;::::0;:27;;::::2;::::0;::::2;::::0;957:18:1;;125467:35:0::2;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;125467:46:0::2;;125463:81;;125522:22;;-1:-1:-1::0;;;125522:22:0::2;;;;;;;;;;;125463:81;125557:8;:20:::0;;;125588:10:::2;:24:::0;;-1:-1:-1;;;;;125588:24:0;;::::2;-1:-1:-1::0;;;;;;125588:24:0;;::::2;::::0;::::2;::::0;;;125623:5:::2;:14:::0;;;125588:24;125648:36;;;;::::2;::::0;::::2;-1:-1:-1::0;;;;;;125648:36:0;;::::2;::::0;;;::::2;::::0;;;125737:51:::2;::::0;-1:-1:-1;;;125737:51:0;;125588:24;;125737:16:::2;::::0;:51:::2;::::0;125754:10:::2;::::0;125774:4:::2;::::0;125631:6;;125737:51:::2;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;::::0;::::2;;;;;-1:-1:-1::0;;125812:4:0::2;125799:17:::0;;-1:-1:-1;;125799:17:0::2;::::0;::::2;::::0;;-1:-1:-1;;125834:13:0::2;::::0;::::2;::::0;125799:10:::2;::::0;125834:13:::2;125875:10;::::0;125887:5:::2;::::0;125863:30:::2;::::0;;-1:-1:-1;;;;;125875:10:0;;::::2;2627:51:1::0;;2709:2;2694:18;;2687:34;;;;125863:30:0::2;::::0;2600:18:1;125863:30:0::2;;;;;;;125924:16;::::0;125909:32:::2;::::0;125924:16;;;::::2;-1:-1:-1::0;;;;;125924:16:0::2;776:51:1::0;;125909:32:0::2;::::0;764:2:1;749:18;125909:32:0::2;;;;;;;125315:634;125180:769:::0;;;;:::o;133675:1212::-;124596:10;;133791:4;;124596:10;;:19;;;;124592:60;;124624:28;;-1:-1:-1;;;124624:28:0;;;;;;;;;;;124592:60;124715:10:::1;::::0;;::::1;::::0;::::1;;;:18;;::::0;;124711:54:::1;;124742:23;;-1:-1:-1::0;;;124742:23:0::1;;;;;;;;;;;124711:54;124902:9:::2;124915:10;124902:23;124894:56;;;;-1:-1:-1::0;;;124894:56:0::2;;;;;;;:::i;:::-;133818:16:::3;::::0;133811:38:::3;::::0;-1:-1:-1;;;133811:38:0;;::::3;::::0;::::3;984:25:1::0;;;133853:10:0::3;::::0;133818:16;;::::3;-1:-1:-1::0;;;;;133818:16:0::3;::::0;133811:32:::3;::::0;957:18:1;;133811:38:0::3;;;;;;;;;;;;;;;;;::::0;::::3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;133811:52:0::3;;133807:90;;133872:25;;-1:-1:-1::0;;;133872:25:0::3;;;;;;;;;;;133807:90;133933:5;133912:11:::0;;;:5:::3;:11;::::0;;;;:18:::3;::::0;::::3;:26:::0;;-1:-1:-1;;133912:26:0::3;::::0;;133982:17:::3;;::::0;134003:1:::3;133982:22:::0;133978:62:::3;;134013:27;;-1:-1:-1::0;;;134013:27:0::3;;;;;;;;;;;133978:62;134053:19;134075:11:::0;;;:5:::3;:11;::::0;;;;;-1:-1:-1;;;134120:66:0;134220:15:::3;:13;:15::i;:::-;:19;::::0;134238:1:::3;134220:19;:::i;:::-;134197:42;;134270:3;134255:12;:18;134251:596;;;134306:4;134290:13:::0;;::::3;:20:::0;;-1:-1:-1;;134290:20:0::3;::::0;;::::3;::::0;;134325:15:::3;::::0;::::3;:27:::0;;;134367:12:::3;::::0;::::3;:15:::0;;;134290:13:::3;134367:15;::::0;::::3;:::i;:::-;;;;;;134403:6;:12;;;134419:1;134403:17:::0;134399:79:::3;;134440:11;:22:::0;;::::3;::::0;::::3;::::0;;-1:-1:-1;134440:22:0;;;;;::::3;::::0;;;134399:79:::3;134499:4;134492:11;;;;;;;134251:596;134541:3;134525:12;:19;;:44;;;;-1:-1:-1::0;134548:13:0::3;::::0;::::3;::::0;::::3;;:21;;:13:::0;:21:::3;134525:44;134521:326;;;134595:18;134608:4;134595:12;:18::i;:::-;134588:25;;;;;;;134521:326;134653:3;134637:12;:19;;:45;;;;-1:-1:-1::0;134660:13:0::3;::::0;::::3;::::0;::::3;;:22;134637:45;134633:214;;;-1:-1:-1::0;134699:13:0::3;::::0;;::::3;:21:::0;;-1:-1:-1;;134699:21:0::3;::::0;;134735:15:::3;::::0;;::::3;:30:::0;134780:17:::3;:28:::0;;;;::::3;::::0;;134715:5:::3;134780:28:::0;;;;;;::::3;::::0;;;134715:5;-1:-1:-1;134823:12:0::3;;134633:214;134864:5;134857:12;;;;;124961:1;133675:1212:::0;;;;;:::o;130208:240::-;130288:10;;130255:7;;;;-1:-1:-1;;;;;130288:10:0;130284:61;;130321:24;;-1:-1:-1;;;130321:24:0;;;;;;;;;;;130284:61;130360:5;;130369:1;130360:10;130356:47;;130379:24;;-1:-1:-1;;;130379:24:0;;;;;;;;;;;130356:47;-1:-1:-1;;130422:10:0;;130434:5;;-1:-1:-1;;;;;130422:10:0;;;;130208:240::o;138972:660::-;124596:10;;;;:19;;:10;:19;124592:60;;124624:28;;-1:-1:-1;;;124624:28:0;;;;;;;;;;;124592:60;124478:10:::1;-1:-1:-1::0;;;;;124492:7:0::1;124478:21;;124474:53;;124508:19;;-1:-1:-1::0;;;124508:19:0::1;;;;;;;;;;;124474:53;124902:9:::2;124915:10;124902:23;124894:56;;;;-1:-1:-1::0;;;124894:56:0::2;;;;;;;:::i;:::-;139057:10:::3;::::0;;::::3;::::0;::::3;;;:18;;;139049:50;;;;-1:-1:-1::0;;;139049:50:0::3;;;;;;;:::i;:::-;139117:9;139112:243;139132:9;:16:::0;139128:20;::::3;139112:243;;;139199:4;139170:5;:19;139176:9;139186:1;139176:12;;;;;;;;:::i;:::-;;;;;;;;;139170:19;;;;;;;;;;;:26;;;:33;;;;;;;;;;;;;;;;;;139247:4;139218:5;:19;139224:9;139234:1;139224:12;;;;;;;;:::i;:::-;;;;;;;;;139218:19;;;;;;;;;;;:26;;;:33;;;;;;;;;;;;;;;;;;139294:1;139266:5;:19;139272:9;139282:1;139272:12;;;;;;;;:::i;:::-;;;;;;;;;139266:19;;;;;;;;;;;:25;;:29;;;;139310:33;:5;:19;139316:9;139326:1;139316:12;;;;;;;;:::i;:::-;;::::0;;;::::3;::::0;;;;;::::3;::::0;139310:19;;;::::3;::::0;;;;;;;;:28:::3;;:33:::0;139150:3:::3;;139112:243;;;-1:-1:-1::0;139367:18:0::3;139374:11;;139367:18;:::i;:::-;139396:24;139403:17;;139396:24;:::i;:::-;139431:16;139438:9;;139431:16;:::i;:::-;139458:14;139465:7;;139458:14;:::i;:::-;139483:10;:18:::0;;139512:10:::3;:23:::0;;-1:-1:-1;;;;;;139512:23:0::3;::::0;;139496:5:::3;139546;:9:::0;-1:-1:-1;;;;;;139595:29:0;;;138972:660::o;127408:679::-;124596:10;;127539:4;;124596:10;;:19;;;;124592:60;;124624:28;;-1:-1:-1;;;124624:28:0;;;;;;;;;;;124592:60;124715:10:::1;::::0;;::::1;::::0;::::1;;;:18;;::::0;;124711:54:::1;;124742:23;;-1:-1:-1::0;;;124742:23:0::1;;;;;;;;;;;124711:54;124902:9:::2;124915:10;124902:23;124894:56;;;;-1:-1:-1::0;;;124894:56:0::2;;;;;;;:::i;:::-;127567:16:::3;::::0;127560:38:::3;::::0;-1:-1:-1;;;127560:38:0;;::::3;::::0;::::3;984:25:1::0;;;127602:10:0::3;::::0;127567:16;;::::3;-1:-1:-1::0;;;;;127567:16:0::3;::::0;127560:32:::3;::::0;957:18:1;;127560:38:0::3;;;;;;;;;;;;;;;;;::::0;::::3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;127560:52:0::3;;127556:87;;127621:22;;-1:-1:-1::0;;;127621:22:0::3;;;;;;;;;;;127556:87;127658:11;::::0;;;:5:::3;:11;::::0;;;;:17;:25;::::3;:55:::0;::::3;;;-1:-1:-1::0;127687:11:0::3;::::0;;;:5:::3;:11;::::0;;;;:18:::3;::::0;;::::3;::::0;::::3;;:26;;;127658:55;127654:94;;;127722:26;;-1:-1:-1::0;;;127722:26:0::3;;;;;;;;;;;127654:94;127763:11;::::0;;;:5:::3;:11;::::0;;;;:17;:25;::::3;:56:::0;::::3;;;-1:-1:-1::0;127792:11:0::3;::::0;;;:5:::3;:11;::::0;;;;:18:::3;;::::0;::::3;;:27;127763:56;127759:89;;;127828:20;;-1:-1:-1::0;;;127828:20:0::3;;;;;;;;;;;127759:89;127875:8;;127863:9;:20;127859:60;;;127893:26;;-1:-1:-1::0;;;127893:26:0::3;;;;;;;;;;;127859:60;-1:-1:-1::0;127951:46:0::3;::::0;;::::3;::::0;::::3;::::0;;;;;127962:4:::3;127951:46;::::0;;::::3;::::0;;;;;;;;;;;;;;;127932:16:::3;127951:46:::0;;;;;;;;;;;;128008:11;;;:5:::3;:11:::0;;;;;;;:18;;;;;;;;::::3;::::0;;;::::3;;-1:-1:-1::0;;128008:18:0;;::::3;;::::0;;;;;;::::3;::::0;;;;;::::3;::::0;::::3;::::0;;;::::3;::::0;::::3;::::0;;;::::3;::::0;;::::3;::::0;;;::::3;;::::0;;;::::3;;::::0;;;128037:20;;;;::::3;::::0;;;;;;;::::3;::::0;;;127408:679;;;;;:::o;131652:121::-;124596:10;;131720:7;;124596:10;;:19;;;;124592:60;;124624:28;;-1:-1:-1;;;124624:28:0;;;;;;;;;;;124592:60;-1:-1:-1;131747:11:0::1;:18:::0;131652:121;:::o;128211:760::-;124596:10;;128343:4;;124596:10;;:19;;;;124592:60;;124624:28;;-1:-1:-1;;;124624:28:0;;;;;;;;;;;124592:60;124715:10:::1;::::0;;::::1;::::0;::::1;;;:18;;::::0;;124711:54:::1;;124742:23;;-1:-1:-1::0;;;124742:23:0::1;;;;;;;;;;;124711:54;124902:9:::2;124915:10;124902:23;124894:56;;;;-1:-1:-1::0;;;124894:56:0::2;;;;;;;:::i;:::-;128364:18:::3;::::0;;;::::3;;;:27;;128386:5;128364:27:::0;128360:72:::3;;128400:32;;-1:-1:-1::0;;;128400:32:0::3;;;;;;;;;;;128360:72;128454:16;::::0;128447:38:::3;::::0;-1:-1:-1;;;128447:38:0;;::::3;::::0;::::3;984:25:1::0;;;128489:10:0::3;::::0;128454:16;;::::3;-1:-1:-1::0;;;;;128454:16:0::3;::::0;128447:32:::3;::::0;957:18:1;;128447:38:0::3;;;;;;;;;;;;;;;;;::::0;::::3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;128447:52:0::3;;128443:87;;128508:22;;-1:-1:-1::0;;;128508:22:0::3;;;;;;;;;;;128443:87;128557:8;;128545:9;:20;128541:60;;;128575:26;;-1:-1:-1::0;;;128575:26:0::3;;;;;;;;;;;128541:60;128614:16;128633:11:::0;;;:5:::3;:11;::::0;;;;;;;128614:30;;::::3;::::0;::::3;::::0;;;;;;;::::3;::::0;::::3;::::0;::::3;::::0;;::::3;;;::::0;;::::3;::::0;;;;;;::::3;::::0;;;;;;;;::::3;::::0;::::3;::::0;;;;;::::3;::::0;::::3;::::0;;;;;::::3;;::::0;;;::::3;;;::::0;;;;;128659:15;128655:213:::3;;-1:-1:-1::0;;128713:46:0::3;::::0;;::::3;::::0;::::3;::::0;;;;;128724:4:::3;128713:46;::::0;;::::3;::::0;;;;;;;;;;;;;;;128691:19:::3;128713:46:::0;;;;;;;;;;;;128774:11;;;:5:::3;:11:::0;;;;;;;:21;;;;;;;;::::3;::::0;;;::::3;;-1:-1:-1::0;;128774:21:0;;::::3;;::::0;;;;;;::::3;::::0;;;;;::::3;::::0;::::3;::::0;;;::::3;::::0;::::3;::::0;;;::::3;::::0;;::::3;::::0;;;::::3;;::::0;;;::::3;;::::0;;;128810:20;;;;::::3;::::0;;;;;;;::::3;::::0;;;128845:11:::3;;128655:213;-1:-1:-1::0;;128878:11:0::3;::::0;;;:5:::3;:11;::::0;;;;;;:20:::3;:32:::0;;;;128921:9:::3;:20:::0;;::::3;::::0;;::::3;::::0;;;;;;;;;::::3;::::0;;;;-1:-1:-1;128921:20:0;128211:760::o;135122:1217::-;124596:10;;135221:4;;124596:10;;:19;;;;124592:60;;124624:28;;-1:-1:-1;;;124624:28:0;;;;;;;;;;;124592:60;124902:9:::1;124915:10;124902:23;124894:56;;;;-1:-1:-1::0;;;124894:56:0::1;;;;;;;:::i;:::-;135248:16:::2;::::0;135241:38:::2;::::0;-1:-1:-1;;;135241:38:0;;::::2;::::0;::::2;984:25:1::0;;;135283:10:0::2;::::0;135248:16;;::::2;-1:-1:-1::0;;;;;135248:16:0::2;::::0;135241:32:::2;::::0;957:18:1;;135241:38:0::2;;;;;;;;;;;;;;;;;::::0;::::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;135241:52:0::2;;135237:90;;135302:25;;-1:-1:-1::0;;;135302:25:0::2;;;;;;;;;;;135237:90;135363:5;135342:11:::0;;;:5:::2;:11;::::0;;;;:18:::2;;:26:::0;;-1:-1:-1;;135342:26:0::2;::::0;;135416:10:::2;::::0;;::::2;::::0;::::2;;;:18;;;135408:50;;;;-1:-1:-1::0;;;135408:50:0::2;;;;;;;:::i;:::-;135471:23;135532:11:::0;;;:5:::2;:11;::::0;;;;135497:2:::2;::::0;-1:-1:-1;;;135577:66:0;135676:15:::2;:13;:15::i;:::-;:19;::::0;135694:1:::2;135676:19;:::i;:::-;135654:41;;135724:15;135710:11;:29;135706:593;;;135772:4;135756:13:::0;;::::2;:20:::0;;-1:-1:-1;;135756:20:0::2;::::0;;::::2;::::0;;135791:15:::2;::::0;::::2;:27:::0;;;135833:12:::2;::::0;::::2;:15:::0;;;135756:13:::2;135833:15;::::0;::::2;:::i;:::-;::::0;;;-1:-1:-1;;135865:7:0::2;:18:::0;;::::2;::::0;;::::2;::::0;;-1:-1:-1;135865:18:0;;;;;::::2;::::0;;;;-1:-1:-1;135900:11:0::2;::::0;-1:-1:-1;;;;135900:11:0::2;135706:593;135950:15;135935:11;:30;;:55;;;;-1:-1:-1::0;135969:13:0::2;::::0;::::2;::::0;::::2;;:21;;:13:::0;:21:::2;135935:55;135931:368;;;136032:18;136045:4;136032:12;:18::i;:::-;136025:25;;;;;;;;135931:368;136089:15;136074:11;:30;;:56;;;;-1:-1:-1::0;136108:13:0::2;::::0;::::2;::::0;::::2;;:22;136074:56;136070:229;;;-1:-1:-1::0;136149:13:0::2;::::0;;::::2;:21:::0;;-1:-1:-1;;136149:21:0::2;::::0;;136185:17:::2;:28:::0;;;;::::2;::::0;;136165:5:::2;136185:28:::0;;;;;;::::2;::::0;;;136228:15:::2;::::0;;::::2;:30:::0;136165:5;-1:-1:-1;136273:12:0::2;::::0;-1:-1:-1;136273:12:0::2;136070:229;136316:5;136309:12;;;;;;124961:1;135122:1217:::0;;;;:::o;131056:200::-;124596:10;;131132:7;;124596:10;;:19;;;;124592:60;;124624:28;;-1:-1:-1;;;124624:28:0;;;;;;;;;;;124592:60;131156:9:::1;:16:::0;131176:1:::1;131156:21:::0;131152:62:::1;;131186:28;;-1:-1:-1::0;;;131186:28:0::1;;;;;;;;;;;131152:62;-1:-1:-1::0;131232:9:0::1;:16:::0;131056:200;:::o;138569:356::-;138609:7;138760:16;138775:1;138760:12;:16;:::i;:::-;138846:7;:14;138707:176;;;138750:27;;138707:176;;;7112:19:1;138804:15:0;7147:12:1;;;7140:28;7184:12;;;7177:28;7221:12;;138707:176:0;;;;;;;;;;;;138675:227;;;;;;138649:268;;138629:288;;138569:356;:::o;136429:386::-;136476:7;136510:3;;136655:16;136670:1;136655:12;:16;:::i;:::-;136602:165;;;136645:27;;136602:165;;;7112:19:1;136699:15:0;7147:12:1;;;7140:28;7184:12;;;7177:28;;;7221:12;;136602:165:0;;;;;;;;;;;;136570:216;;;;;;136544:257;;:263;;;;:::i;:::-;136524:283;;;136429:386;:::o;132514:926::-;124596:10;;132582:4;;124596:10;;:19;;;;124592:60;;124624:28;;-1:-1:-1;;;124624:28:0;;;;;;;;;;;124592:60;132610:16:::1;::::0;132603:38:::1;::::0;-1:-1:-1;;;132603:38:0;;::::1;::::0;::::1;984:25:1::0;;;132645:10:0::1;::::0;132610:16;;::::1;-1:-1:-1::0;;;;;132610:16:0::1;::::0;132603:32:::1;::::0;957:18:1;;132603:38:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;132603:52:0::1;;132599:90;;132664:25;;-1:-1:-1::0;;;132664:25:0::1;;;;;;;;;;;132599:90;132704:11;::::0;;;:5:::1;:11;::::0;;;;:18:::1;;::::0;::::1;;:27;;::::0;;132700:69:::1;;132740:29;;-1:-1:-1::0;;;132740:29:0::1;;;;;;;;;;;132700:69;132782:20;132904:11:::0;;;:5:::1;:11;::::0;;;;132955:14:::1;::::0;::::1;::::0;-1:-1:-1;;;132805:66:0;132999:15:::1;:13;:15::i;:::-;:19;::::0;133017:1:::1;132999:19;:::i;:::-;132980:38;;133045:18;133033:8;:30;133029:394;;133096:4;133080:13:::0;;::::1;:20:::0;;-1:-1:-1;;133080:20:0;;::::1;::::0;;::::1;::::0;;133115:13:::1;::::0;::::1;:21:::0;;;;::::1;::::0;;133156:24:::1;::::0;984:25:1;;;133156:24:0::1;::::0;972:2:1;957:18;133156:24:0::1;;;;;;;-1:-1:-1::0;133202:4:0::1;::::0;132514:926;-1:-1:-1;;;;;132514:926:0:o;133029:394::-:1;-1:-1:-1::0;;133239:13:0::1;::::0;::::1;:21:::0;;-1:-1:-1;;133239:21:0;;::::1;::::0;;;-1:-1:-1;133275:13:0;;::::1;:21:::0;;;;::::1;::::0;;;133311:15:::1;::::0;;::::1;:30:::0;;;;133356:17:::1;:28:::0;;;;::::1;::::0;;-1:-1:-1;133356:28:0;;;;;;::::1;::::0;;;;-1:-1:-1;;132514:926:0:o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::o;:::-;;;;;;;;;;;;;;;;;;:::o;14:611:1:-;204:2;216:21;;;286:13;;189:18;;;308:22;;;156:4;;387:15;;;361:2;346:18;;;156:4;430:169;444:6;441:1;438:13;430:169;;;505:13;;493:26;;548:2;574:15;;;;539:12;;;;466:1;459:9;430:169;;;-1:-1:-1;616:3:1;;14:611;-1:-1:-1;;;;;14:611:1:o;1212:131::-;-1:-1:-1;;;;;1287:31:1;;1277:42;;1267:70;;1333:1;1330;1323:12;1348:629;1434:6;1442;1450;1458;1511:3;1499:9;1490:7;1486:23;1482:33;1479:53;;;1528:1;1525;1518:12;1479:53;1567:9;1554:23;1586:31;1611:5;1586:31;:::i;:::-;1636:5;-1:-1:-1;1714:2:1;1699:18;;1686:32;;-1:-1:-1;1796:2:1;1781:18;;1768:32;1809:33;1768:32;1809:33;:::i;:::-;1348:629;;;;-1:-1:-1;1861:7:1;;1941:2;1926:18;1913:32;;-1:-1:-1;;1348:629:1:o;1982:466::-;2059:6;2067;2075;2128:2;2116:9;2107:7;2103:23;2099:32;2096:52;;;2144:1;2141;2134:12;2096:52;-1:-1:-1;;2189:23:1;;;2309:2;2294:18;;2281:32;;-1:-1:-1;2412:2:1;2397:18;;;2384:32;;1982:466;-1:-1:-1;1982:466:1:o;2732:226::-;2791:6;2844:2;2832:9;2823:7;2819:23;2815:32;2812:52;;;2860:1;2857;2850:12;2812:52;-1:-1:-1;2905:23:1;;2732:226;-1:-1:-1;2732:226:1:o;4015:346::-;4083:6;4091;4144:2;4132:9;4123:7;4119:23;4115:32;4112:52;;;4160:1;4157;4150:12;4112:52;-1:-1:-1;;4205:23:1;;;4325:2;4310:18;;;4297:32;;-1:-1:-1;4015:346:1:o;4366:344::-;4568:2;4550:21;;;4607:2;4587:18;;;4580:30;-1:-1:-1;;;4641:2:1;4626:18;;4619:50;4701:2;4686:18;;4366:344::o;4715:343::-;4917:2;4899:21;;;4956:2;4936:18;;;4929:30;-1:-1:-1;;;4990:2:1;4975:18;;4968:49;5049:2;5034:18;;4715:343::o;5063:127::-;5124:10;5119:3;5115:20;5112:1;5105:31;5155:4;5152:1;5145:15;5179:4;5176:1;5169:15;5195:251;5265:6;5318:2;5306:9;5297:7;5293:23;5289:32;5286:52;;;5334:1;5331;5324:12;5286:52;5366:9;5360:16;5385:31;5410:5;5385:31;:::i;5451:371::-;-1:-1:-1;;;;;5671:32:1;;;5653:51;;5740:32;;;;5735:2;5720:18;;5713:60;5804:2;5789:18;;5782:34;;;;5641:2;5626:18;;5451:371::o;5827:209::-;5859:1;5885;5875:132;;5929:10;5924:3;5920:20;5917:1;5910:31;5964:4;5961:1;5954:15;5992:4;5989:1;5982:15;5875:132;-1:-1:-1;6021:9:1;;5827:209::o;6392:127::-;6453:10;6448:3;6444:20;6441:1;6434:31;6484:4;6481:1;6474:15;6508:4;6505:1;6498:15;6524:125;6589:9;;;6610:10;;;6607:36;;;6623:18;;:::i;6654:135::-;6693:3;6714:17;;;6711:43;;6734:18;;:::i;:::-;-1:-1:-1;6781:1:1;6770:13;;6654:135::o;6794:128::-;6861:9;;;6882:11;;;6879:37;;;6896:18;;:::i
Swarm Source
ipfs://100e2143a96376fed60d08bb36d5d8161ada99e66c0bbe4825ab77cca00a295f
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.