Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
OsmiNode
Compiler Version
v0.8.28+commit.7893614a
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2024-11-23 */ // Sources flattened with hardhat v2.22.14 https://hardhat.org // SPDX-License-Identifier: MIT // File @openzeppelin/contracts-upgradeable/proxy/utils/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.20; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Storage of the initializable contract. * * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions * when using with upgradeable contracts. * * @custom:storage-location erc7201:openzeppelin.storage.Initializable */ struct InitializableStorage { /** * @dev Indicates that the contract has been initialized. */ uint64 _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool _initializing; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00; /** * @dev The contract is already initialized. */ error InvalidInitialization(); /** * @dev The contract is not initializing. */ error NotInitializing(); /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint64 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in * production. * * Emits an {Initialized} event. */ modifier initializer() { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); // Cache values to avoid duplicated sloads bool isTopLevelCall = !$._initializing; uint64 initialized = $._initialized; // Allowed calls: // - initialSetup: the contract is not in the initializing state and no previous version was // initialized // - construction: the contract is initialized at version 1 (no reininitialization) and the // current contract is just being deployed bool initialSetup = initialized == 0 && isTopLevelCall; bool construction = initialized == 1 && address(this).code.length == 0; if (!initialSetup && !construction) { revert InvalidInitialization(); } $._initialized = 1; if (isTopLevelCall) { $._initializing = true; } _; if (isTopLevelCall) { $._initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint64 version) { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing || $._initialized >= version) { revert InvalidInitialization(); } $._initialized = version; $._initializing = true; _; $._initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { _checkInitializing(); _; } /** * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}. */ function _checkInitializing() internal view virtual { if (!_isInitializing()) { revert NotInitializing(); } } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { // solhint-disable-next-line var-name-mixedcase InitializableStorage storage $ = _getInitializableStorage(); if ($._initializing) { revert InvalidInitialization(); } if ($._initialized != type(uint64).max) { $._initialized = type(uint64).max; emit Initialized(type(uint64).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint64) { return _getInitializableStorage()._initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _getInitializableStorage()._initializing; } /** * @dev Returns a pointer to the storage namespace. */ // solhint-disable-next-line var-name-mixedcase function _getInitializableStorage() private pure returns (InitializableStorage storage $) { assembly { $.slot := INITIALIZABLE_STORAGE } } } // File @openzeppelin/contracts-upgradeable/utils/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } } // File @openzeppelin/contracts/access/manager/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/manager/IAuthority.sol) pragma solidity ^0.8.20; /** * @dev Standard interface for permissioning originally defined in Dappsys. */ interface IAuthority { /** * @dev Returns true if the caller can invoke on a target the function identified by a function selector. */ function canCall(address caller, address target, bytes4 selector) external view returns (bool allowed); } // File @openzeppelin/contracts/access/manager/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/manager/AuthorityUtils.sol) pragma solidity ^0.8.20; library AuthorityUtils { /** * @dev Since `AccessManager` implements an extended IAuthority interface, invoking `canCall` with backwards compatibility * for the preexisting `IAuthority` interface requires special care to avoid reverting on insufficient return data. * This helper function takes care of invoking `canCall` in a backwards compatible way without reverting. */ function canCallWithDelay( address authority, address caller, address target, bytes4 selector ) internal view returns (bool immediate, uint32 delay) { (bool success, bytes memory data) = authority.staticcall( abi.encodeCall(IAuthority.canCall, (caller, target, selector)) ); if (success) { if (data.length >= 0x40) { (immediate, delay) = abi.decode(data, (bool, uint32)); } else if (data.length >= 0x20) { immediate = abi.decode(data, (bool)); } } return (immediate, delay); } } // File @openzeppelin/contracts/access/manager/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/manager/IAccessManaged.sol) pragma solidity ^0.8.20; interface IAccessManaged { /** * @dev Authority that manages this contract was updated. */ event AuthorityUpdated(address authority); error AccessManagedUnauthorized(address caller); error AccessManagedRequiredDelay(address caller, uint32 delay); error AccessManagedInvalidAuthority(address authority); /** * @dev Returns the current authority. */ function authority() external view returns (address); /** * @dev Transfers control to a new authority. The caller must be the current authority. */ function setAuthority(address) external; /** * @dev Returns true only in the context of a delayed restricted call, at the moment that the scheduled operation is * being consumed. Prevents denial of service for delayed restricted calls in the case that the contract performs * attacker controlled calls. */ function isConsumingScheduledOp() external view returns (bytes4); } // File @openzeppelin/contracts/utils/math/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } } // File @openzeppelin/contracts/utils/math/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.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 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); } } // File @openzeppelin/contracts/utils/types/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/types/Time.sol) pragma solidity ^0.8.20; /** * @dev This library provides helpers for manipulating time-related objects. * * It uses the following types: * - `uint48` for timepoints * - `uint32` for durations * * While the library doesn't provide specific types for timepoints and duration, it does provide: * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point * - additional helper functions */ library Time { using Time for *; /** * @dev Get the block timestamp as a Timepoint. */ function timestamp() internal view returns (uint48) { return SafeCast.toUint48(block.timestamp); } /** * @dev Get the block number as a Timepoint. */ function blockNumber() internal view returns (uint48) { return SafeCast.toUint48(block.number); } // ==================================================== Delay ===================================================== /** * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the * future. The "effect" timepoint describes when the transitions happens from the "old" value to the "new" value. * This allows updating the delay applied to some operation while keeping some guarantees. * * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should * still apply for some time. * * * The `Delay` type is 112 bits long, and packs the following: * * ``` * | [uint48]: effect date (timepoint) * | | [uint32]: value before (duration) * ↓ ↓ ↓ [uint32]: value after (duration) * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC * ``` * * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently * supported. */ type Delay is uint112; /** * @dev Wrap a duration into a Delay to add the one-step "update in the future" feature */ function toDelay(uint32 duration) internal pure returns (Delay) { return Delay.wrap(duration); } /** * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered. */ function _getFullAt(Delay self, uint48 timepoint) private pure returns (uint32, uint32, uint48) { (uint32 valueBefore, uint32 valueAfter, uint48 effect) = self.unpack(); return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect); } /** * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the * effect timepoint is 0, then the pending value should not be considered. */ function getFull(Delay self) internal view returns (uint32, uint32, uint48) { return _getFullAt(self, timestamp()); } /** * @dev Get the current value. */ function get(Delay self) internal view returns (uint32) { (uint32 delay, , ) = self.getFull(); return delay; } /** * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the * new delay becomes effective. */ function withUpdate( Delay self, uint32 newValue, uint32 minSetback ) internal view returns (Delay updatedDelay, uint48 effect) { uint32 value = self.get(); uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0)); effect = timestamp() + setback; return (pack(value, newValue, effect), effect); } /** * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint). */ function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) { uint112 raw = Delay.unwrap(self); valueAfter = uint32(raw); valueBefore = uint32(raw >> 32); effect = uint48(raw >> 64); return (valueBefore, valueAfter, effect); } /** * @dev pack the components into a Delay object. */ function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) { return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter)); } } // File @openzeppelin/contracts/access/manager/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/manager/IAccessManager.sol) pragma solidity ^0.8.20; interface IAccessManager { /** * @dev A delayed operation was scheduled. */ event OperationScheduled( bytes32 indexed operationId, uint32 indexed nonce, uint48 schedule, address caller, address target, bytes data ); /** * @dev A scheduled operation was executed. */ event OperationExecuted(bytes32 indexed operationId, uint32 indexed nonce); /** * @dev A scheduled operation was canceled. */ event OperationCanceled(bytes32 indexed operationId, uint32 indexed nonce); /** * @dev Informational labelling for a roleId. */ event RoleLabel(uint64 indexed roleId, string label); /** * @dev Emitted when `account` is granted `roleId`. * * NOTE: The meaning of the `since` argument depends on the `newMember` argument. * If the role is granted to a new member, the `since` argument indicates when the account becomes a member of the role, * otherwise it indicates the execution delay for this account and roleId is updated. */ event RoleGranted(uint64 indexed roleId, address indexed account, uint32 delay, uint48 since, bool newMember); /** * @dev Emitted when `account` membership or `roleId` is revoked. Unlike granting, revoking is instantaneous. */ event RoleRevoked(uint64 indexed roleId, address indexed account); /** * @dev Role acting as admin over a given `roleId` is updated. */ event RoleAdminChanged(uint64 indexed roleId, uint64 indexed admin); /** * @dev Role acting as guardian over a given `roleId` is updated. */ event RoleGuardianChanged(uint64 indexed roleId, uint64 indexed guardian); /** * @dev Grant delay for a given `roleId` will be updated to `delay` when `since` is reached. */ event RoleGrantDelayChanged(uint64 indexed roleId, uint32 delay, uint48 since); /** * @dev Target mode is updated (true = closed, false = open). */ event TargetClosed(address indexed target, bool closed); /** * @dev Role required to invoke `selector` on `target` is updated to `roleId`. */ event TargetFunctionRoleUpdated(address indexed target, bytes4 selector, uint64 indexed roleId); /** * @dev Admin delay for a given `target` will be updated to `delay` when `since` is reached. */ event TargetAdminDelayUpdated(address indexed target, uint32 delay, uint48 since); error AccessManagerAlreadyScheduled(bytes32 operationId); error AccessManagerNotScheduled(bytes32 operationId); error AccessManagerNotReady(bytes32 operationId); error AccessManagerExpired(bytes32 operationId); error AccessManagerLockedAccount(address account); error AccessManagerLockedRole(uint64 roleId); error AccessManagerBadConfirmation(); error AccessManagerUnauthorizedAccount(address msgsender, uint64 roleId); error AccessManagerUnauthorizedCall(address caller, address target, bytes4 selector); error AccessManagerUnauthorizedConsume(address target); error AccessManagerUnauthorizedCancel(address msgsender, address caller, address target, bytes4 selector); error AccessManagerInvalidInitialAdmin(address initialAdmin); /** * @dev Check if an address (`caller`) is authorised to call a given function on a given contract directly (with * no restriction). Additionally, it returns the delay needed to perform the call indirectly through the {schedule} * & {execute} workflow. * * This function is usually called by the targeted contract to control immediate execution of restricted functions. * Therefore we only return true if the call can be performed without any delay. If the call is subject to a * previously set delay (not zero), then the function should return false and the caller should schedule the operation * for future execution. * * If `immediate` is true, the delay can be disregarded and the operation can be immediately executed, otherwise * the operation can be executed if and only if delay is greater than 0. * * NOTE: The IAuthority interface does not include the `uint32` delay. This is an extension of that interface that * is backward compatible. Some contracts may thus ignore the second return argument. In that case they will fail * to identify the indirect workflow, and will consider calls that require a delay to be forbidden. * * NOTE: This function does not report the permissions of this manager itself. These are defined by the * {_canCallSelf} function instead. */ function canCall( address caller, address target, bytes4 selector ) external view returns (bool allowed, uint32 delay); /** * @dev Expiration delay for scheduled proposals. Defaults to 1 week. * * IMPORTANT: Avoid overriding the expiration with 0. Otherwise every contract proposal will be expired immediately, * disabling any scheduling usage. */ function expiration() external view returns (uint32); /** * @dev Minimum setback for all delay updates, with the exception of execution delays. It * can be increased without setback (and reset via {revokeRole} in the case event of an * accidental increase). Defaults to 5 days. */ function minSetback() external view returns (uint32); /** * @dev Get whether the contract is closed disabling any access. Otherwise role permissions are applied. */ function isTargetClosed(address target) external view returns (bool); /** * @dev Get the role required to call a function. */ function getTargetFunctionRole(address target, bytes4 selector) external view returns (uint64); /** * @dev Get the admin delay for a target contract. Changes to contract configuration are subject to this delay. */ function getTargetAdminDelay(address target) external view returns (uint32); /** * @dev Get the id of the role that acts as an admin for the given role. * * The admin permission is required to grant the role, revoke the role and update the execution delay to execute * an operation that is restricted to this role. */ function getRoleAdmin(uint64 roleId) external view returns (uint64); /** * @dev Get the role that acts as a guardian for a given role. * * The guardian permission allows canceling operations that have been scheduled under the role. */ function getRoleGuardian(uint64 roleId) external view returns (uint64); /** * @dev Get the role current grant delay. * * Its value may change at any point without an event emitted following a call to {setGrantDelay}. * Changes to this value, including effect timepoint are notified in advance by the {RoleGrantDelayChanged} event. */ function getRoleGrantDelay(uint64 roleId) external view returns (uint32); /** * @dev Get the access details for a given account for a given role. These details include the timepoint at which * membership becomes active, and the delay applied to all operation by this user that requires this permission * level. * * Returns: * [0] Timestamp at which the account membership becomes valid. 0 means role is not granted. * [1] Current execution delay for the account. * [2] Pending execution delay for the account. * [3] Timestamp at which the pending execution delay will become active. 0 means no delay update is scheduled. */ function getAccess(uint64 roleId, address account) external view returns (uint48, uint32, uint32, uint48); /** * @dev Check if a given account currently has the permission level corresponding to a given role. Note that this * permission might be associated with an execution delay. {getAccess} can provide more details. */ function hasRole(uint64 roleId, address account) external view returns (bool, uint32); /** * @dev Give a label to a role, for improved role discoverability by UIs. * * Requirements: * * - the caller must be a global admin * * Emits a {RoleLabel} event. */ function labelRole(uint64 roleId, string calldata label) external; /** * @dev Add `account` to `roleId`, or change its execution delay. * * This gives the account the authorization to call any function that is restricted to this role. An optional * execution delay (in seconds) can be set. If that delay is non 0, the user is required to schedule any operation * that is restricted to members of this role. The user will only be able to execute the operation after the delay has * passed, before it has expired. During this period, admin and guardians can cancel the operation (see {cancel}). * * If the account has already been granted this role, the execution delay will be updated. This update is not * immediate and follows the delay rules. For example, if a user currently has a delay of 3 hours, and this is * called to reduce that delay to 1 hour, the new delay will take some time to take effect, enforcing that any * operation executed in the 3 hours that follows this update was indeed scheduled before this update. * * Requirements: * * - the caller must be an admin for the role (see {getRoleAdmin}) * - granted role must not be the `PUBLIC_ROLE` * * Emits a {RoleGranted} event. */ function grantRole(uint64 roleId, address account, uint32 executionDelay) external; /** * @dev Remove an account from a role, with immediate effect. If the account does not have the role, this call has * no effect. * * Requirements: * * - the caller must be an admin for the role (see {getRoleAdmin}) * - revoked role must not be the `PUBLIC_ROLE` * * Emits a {RoleRevoked} event if the account had the role. */ function revokeRole(uint64 roleId, address account) external; /** * @dev Renounce role permissions for the calling account with immediate effect. If the sender is not in * the role this call has no effect. * * Requirements: * * - the caller must be `callerConfirmation`. * * Emits a {RoleRevoked} event if the account had the role. */ function renounceRole(uint64 roleId, address callerConfirmation) external; /** * @dev Change admin role for a given role. * * Requirements: * * - the caller must be a global admin * * Emits a {RoleAdminChanged} event */ function setRoleAdmin(uint64 roleId, uint64 admin) external; /** * @dev Change guardian role for a given role. * * Requirements: * * - the caller must be a global admin * * Emits a {RoleGuardianChanged} event */ function setRoleGuardian(uint64 roleId, uint64 guardian) external; /** * @dev Update the delay for granting a `roleId`. * * Requirements: * * - the caller must be a global admin * * Emits a {RoleGrantDelayChanged} event. */ function setGrantDelay(uint64 roleId, uint32 newDelay) external; /** * @dev Set the role required to call functions identified by the `selectors` in the `target` contract. * * Requirements: * * - the caller must be a global admin * * Emits a {TargetFunctionRoleUpdated} event per selector. */ function setTargetFunctionRole(address target, bytes4[] calldata selectors, uint64 roleId) external; /** * @dev Set the delay for changing the configuration of a given target contract. * * Requirements: * * - the caller must be a global admin * * Emits a {TargetAdminDelayUpdated} event. */ function setTargetAdminDelay(address target, uint32 newDelay) external; /** * @dev Set the closed flag for a contract. * * Requirements: * * - the caller must be a global admin * * Emits a {TargetClosed} event. */ function setTargetClosed(address target, bool closed) external; /** * @dev Return the timepoint at which a scheduled operation will be ready for execution. This returns 0 if the * operation is not yet scheduled, has expired, was executed, or was canceled. */ function getSchedule(bytes32 id) external view returns (uint48); /** * @dev Return the nonce for the latest scheduled operation with a given id. Returns 0 if the operation has never * been scheduled. */ function getNonce(bytes32 id) external view returns (uint32); /** * @dev Schedule a delayed operation for future execution, and return the operation identifier. It is possible to * choose the timestamp at which the operation becomes executable as long as it satisfies the execution delays * required for the caller. The special value zero will automatically set the earliest possible time. * * Returns the `operationId` that was scheduled. Since this value is a hash of the parameters, it can reoccur when * the same parameters are used; if this is relevant, the returned `nonce` can be used to uniquely identify this * scheduled operation from other occurrences of the same `operationId` in invocations of {execute} and {cancel}. * * Emits a {OperationScheduled} event. * * NOTE: It is not possible to concurrently schedule more than one operation with the same `target` and `data`. If * this is necessary, a random byte can be appended to `data` to act as a salt that will be ignored by the target * contract if it is using standard Solidity ABI encoding. */ function schedule(address target, bytes calldata data, uint48 when) external returns (bytes32, uint32); /** * @dev Execute a function that is delay restricted, provided it was properly scheduled beforehand, or the * execution delay is 0. * * Returns the nonce that identifies the previously scheduled operation that is executed, or 0 if the * operation wasn't previously scheduled (if the caller doesn't have an execution delay). * * Emits an {OperationExecuted} event only if the call was scheduled and delayed. */ function execute(address target, bytes calldata data) external payable returns (uint32); /** * @dev Cancel a scheduled (delayed) operation. Returns the nonce that identifies the previously scheduled * operation that is cancelled. * * Requirements: * * - the caller must be the proposer, a guardian of the targeted function, or a global admin * * Emits a {OperationCanceled} event. */ function cancel(address caller, address target, bytes calldata data) external returns (uint32); /** * @dev Consume a scheduled operation targeting the caller. If such an operation exists, mark it as consumed * (emit an {OperationExecuted} event and clean the state). Otherwise, throw an error. * * This is useful for contract that want to enforce that calls targeting them were scheduled on the manager, * with all the verifications that it implies. * * Emit a {OperationExecuted} event. */ function consumeScheduledOp(address caller, bytes calldata data) external; /** * @dev Hashing function for delayed operations. */ function hashOperation(address caller, address target, bytes calldata data) external view returns (bytes32); /** * @dev Changes the authority of a target managed by this manager instance. * * Requirements: * * - the caller must be a global admin */ function updateAuthority(address target, address newAuthority) external; } // File @openzeppelin/contracts-upgradeable/access/manager/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/manager/AccessManaged.sol) pragma solidity ^0.8.20; /** * @dev This contract module makes available a {restricted} modifier. Functions decorated with this modifier will be * permissioned according to an "authority": a contract like {AccessManager} that follows the {IAuthority} interface, * implementing a policy that allows certain callers to access certain functions. * * IMPORTANT: The `restricted` modifier should never be used on `internal` functions, judiciously used in `public` * functions, and ideally only used in `external` functions. See {restricted}. */ abstract contract AccessManagedUpgradeable is Initializable, ContextUpgradeable, IAccessManaged { /// @custom:storage-location erc7201:openzeppelin.storage.AccessManaged struct AccessManagedStorage { address _authority; bool _consumingSchedule; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.AccessManaged")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant AccessManagedStorageLocation = 0xf3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a00; function _getAccessManagedStorage() private pure returns (AccessManagedStorage storage $) { assembly { $.slot := AccessManagedStorageLocation } } /** * @dev Initializes the contract connected to an initial authority. */ function __AccessManaged_init(address initialAuthority) internal onlyInitializing { __AccessManaged_init_unchained(initialAuthority); } function __AccessManaged_init_unchained(address initialAuthority) internal onlyInitializing { _setAuthority(initialAuthority); } /** * @dev Restricts access to a function as defined by the connected Authority for this contract and the * caller and selector of the function that entered the contract. * * [IMPORTANT] * ==== * In general, this modifier should only be used on `external` functions. It is okay to use it on `public` * functions that are used as external entry points and are not called internally. Unless you know what you're * doing, it should never be used on `internal` functions. Failure to follow these rules can have critical security * implications! This is because the permissions are determined by the function that entered the contract, i.e. the * function at the bottom of the call stack, and not the function where the modifier is visible in the source code. * ==== * * [WARNING] * ==== * Avoid adding this modifier to the https://docs.soliditylang.org/en/v0.8.20/contracts.html#receive-ether-function[`receive()`] * function or the https://docs.soliditylang.org/en/v0.8.20/contracts.html#fallback-function[`fallback()`]. These * functions are the only execution paths where a function selector cannot be unambiguosly determined from the calldata * since the selector defaults to `0x00000000` in the `receive()` function and similarly in the `fallback()` function * if no calldata is provided. (See {_checkCanCall}). * * The `receive()` function will always panic whereas the `fallback()` may panic depending on the calldata length. * ==== */ modifier restricted() { _checkCanCall(_msgSender(), _msgData()); _; } /// @inheritdoc IAccessManaged function authority() public view virtual returns (address) { AccessManagedStorage storage $ = _getAccessManagedStorage(); return $._authority; } /// @inheritdoc IAccessManaged function setAuthority(address newAuthority) public virtual { address caller = _msgSender(); if (caller != authority()) { revert AccessManagedUnauthorized(caller); } if (newAuthority.code.length == 0) { revert AccessManagedInvalidAuthority(newAuthority); } _setAuthority(newAuthority); } /// @inheritdoc IAccessManaged function isConsumingScheduledOp() public view returns (bytes4) { AccessManagedStorage storage $ = _getAccessManagedStorage(); return $._consumingSchedule ? this.isConsumingScheduledOp.selector : bytes4(0); } /** * @dev Transfers control to a new authority. Internal function with no access restriction. Allows bypassing the * permissions set by the current authority. */ function _setAuthority(address newAuthority) internal virtual { AccessManagedStorage storage $ = _getAccessManagedStorage(); $._authority = newAuthority; emit AuthorityUpdated(newAuthority); } /** * @dev Reverts if the caller is not allowed to call the function identified by a selector. Panics if the calldata * is less than 4 bytes long. */ function _checkCanCall(address caller, bytes calldata data) internal virtual { AccessManagedStorage storage $ = _getAccessManagedStorage(); (bool immediate, uint32 delay) = AuthorityUtils.canCallWithDelay( authority(), caller, address(this), bytes4(data[0:4]) ); if (!immediate) { if (delay > 0) { $._consumingSchedule = true; IAccessManager(authority()).consumeScheduledOp(caller, data); $._consumingSchedule = false; } else { revert AccessManagedUnauthorized(caller); } } } } // File @openzeppelin/contracts/interfaces/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.20; /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822Proxiable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); } // File @openzeppelin/contracts/proxy/beacon/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.20; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {UpgradeableBeacon} will check that this address is a contract. */ function implementation() external view returns (address); } // File @openzeppelin/contracts/utils/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol) pragma solidity ^0.8.20; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error AddressInsufficientBalance(address account); /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedInnerCall(); /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert AddressInsufficientBalance(address(this)); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert FailedInnerCall(); } } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {FailedInnerCall} error. * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert AddressInsufficientBalance(address(this)); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an * unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {FailedInnerCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}. */ function _revert(bytes memory returndata) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert FailedInnerCall(); } } } // File @openzeppelin/contracts/utils/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. pragma solidity ^0.8.20; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ```solidity * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(newImplementation.code.length > 0); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } /** * @dev Returns an `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } } // File @openzeppelin/contracts/proxy/ERC1967/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Utils.sol) pragma solidity ^0.8.20; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. */ library ERC1967Utils { // We re-declare ERC-1967 events here because they can't be used directly from IERC1967. // This will be fixed in Solidity 0.8.21. At that point we should remove these events. /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Emitted when the beacon is changed. */ event BeaconUpgraded(address indexed beacon); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev The `implementation` of the proxy is invalid. */ error ERC1967InvalidImplementation(address implementation); /** * @dev The `admin` of the proxy is invalid. */ error ERC1967InvalidAdmin(address admin); /** * @dev The `beacon` of the proxy is invalid. */ error ERC1967InvalidBeacon(address beacon); /** * @dev An upgrade function sees `msg.value > 0` that may be lost. */ error ERC1967NonPayable(); /** * @dev Returns the current implementation address. */ function getImplementation() internal view returns (address) { return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { if (newImplementation.code.length == 0) { revert ERC1967InvalidImplementation(newImplementation); } StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Performs implementation upgrade with additional setup call if data is nonempty. * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected * to avoid stuck value in the contract. * * Emits an {IERC1967-Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); if (data.length > 0) { Address.functionDelegateCall(newImplementation, data); } else { _checkNonPayable(); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Returns the current admin. * * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103` */ function getAdmin() internal view returns (address) { return StorageSlot.getAddressSlot(ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { if (newAdmin == address(0)) { revert ERC1967InvalidAdmin(address(0)); } StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {IERC1967-AdminChanged} event. */ function changeAdmin(address newAdmin) internal { emit AdminChanged(getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1. */ // solhint-disable-next-line private-vars-leading-underscore bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Returns the current beacon. */ function getBeacon() internal view returns (address) { return StorageSlot.getAddressSlot(BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { if (newBeacon.code.length == 0) { revert ERC1967InvalidBeacon(newBeacon); } StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon; address beaconImplementation = IBeacon(newBeacon).implementation(); if (beaconImplementation.code.length == 0) { revert ERC1967InvalidImplementation(beaconImplementation); } } /** * @dev Change the beacon and trigger a setup call if data is nonempty. * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected * to avoid stuck value in the contract. * * Emits an {IERC1967-BeaconUpgraded} event. * * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for * efficiency. */ function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0) { Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data); } else { _checkNonPayable(); } } /** * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract * if an upgrade doesn't perform an initialization call. */ function _checkNonPayable() private { if (msg.value > 0) { revert ERC1967NonPayable(); } } } // File @openzeppelin/contracts-upgradeable/proxy/utils/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.20; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. */ abstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable { /// @custom:oz-upgrades-unsafe-allow state-variable-immutable address private immutable __self = address(this); /** * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)` * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called, * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string. * If the getter returns `"5.0.0"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function * during an upgrade. */ string public constant UPGRADE_INTERFACE_VERSION = "5.0.0"; /** * @dev The call is from an unauthorized context. */ error UUPSUnauthorizedCallContext(); /** * @dev The storage `slot` is unsupported as a UUID. */ error UUPSUnsupportedProxiableUUID(bytes32 slot); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { _checkProxy(); _; } /** * @dev Check that the execution is not being performed through a delegate call. This allows a function to be * callable on the implementing contract but not through proxies. */ modifier notDelegated() { _checkNotDelegated(); _; } function __UUPSUpgradeable_init() internal onlyInitializing { } function __UUPSUpgradeable_init_unchained() internal onlyInitializing { } /** * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the * implementation. It is used to validate the implementation's compatibility when performing an upgrade. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier. */ function proxiableUUID() external view virtual notDelegated returns (bytes32) { return ERC1967Utils.IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. * * @custom:oz-upgrades-unsafe-allow-reachable delegatecall */ function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, data); } /** * @dev Reverts if the execution is not performed via delegatecall or the execution * context is not of a proxy with an ERC1967-compliant implementation pointing to self. * See {_onlyProxy}. */ function _checkProxy() internal view virtual { if ( address(this) == __self || // Must be called through delegatecall ERC1967Utils.getImplementation() != __self // Must be called through an active proxy ) { revert UUPSUnauthorizedCallContext(); } } /** * @dev Reverts if the execution is performed via delegatecall. * See {notDelegated}. */ function _checkNotDelegated() internal view virtual { if (address(this) != __self) { // Must not be called through delegatecall revert UUPSUnauthorizedCallContext(); } } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; /** * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call. * * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value * is expected to be the implementation slot in ERC1967. * * Emits an {IERC1967-Upgraded} event. */ function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private { try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) { if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) { revert UUPSUnsupportedProxiableUUID(slot); } ERC1967Utils.upgradeToAndCall(newImplementation, data); } catch { // The implementation is not UUPS revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation); } } } // File @openzeppelin/contracts/utils/introspection/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } // File @openzeppelin/contracts-upgradeable/utils/introspection/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165Upgradeable is Initializable, IERC165 { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } } // File @openzeppelin/contracts/interfaces/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); } // File @openzeppelin/contracts/token/ERC721/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.20; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or * {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the address zero. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); } // File @openzeppelin/contracts/token/ERC721/extensions/[email protected] // Original license: SPDX_License_Identifier: MIT // 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/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.20; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be * reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } // File @openzeppelin/contracts/utils/math/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } } // File @openzeppelin/contracts/utils/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; /** * @dev String operations. */ library Strings { bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { uint256 localValue = value; bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal * representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } } // File @openzeppelin/contracts-upgradeable/token/ERC721/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.20; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ abstract contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721, IERC721Metadata, IERC721Errors { using Strings for uint256; /// @custom:storage-location erc7201:openzeppelin.storage.ERC721 struct ERC721Storage { // Token name string _name; // Token symbol string _symbol; mapping(uint256 tokenId => address) _owners; mapping(address owner => uint256) _balances; mapping(uint256 tokenId => address) _tokenApprovals; mapping(address owner => mapping(address operator => bool)) _operatorApprovals; } // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC721")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant ERC721StorageLocation = 0x80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab0079300; function _getERC721Storage() private pure returns (ERC721Storage storage $) { assembly { $.slot := ERC721StorageLocation } } /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC721_init_unchained(name_, symbol_); } function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { ERC721Storage storage $ = _getERC721Storage(); $._name = name_; $._symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual returns (uint256) { ERC721Storage storage $ = _getERC721Storage(); if (owner == address(0)) { revert ERC721InvalidOwner(address(0)); } return $._balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual returns (address) { return _requireOwned(tokenId); } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual returns (string memory) { ERC721Storage storage $ = _getERC721Storage(); return $._name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual returns (string memory) { ERC721Storage storage $ = _getERC721Storage(); return $._symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual returns (string memory) { _requireOwned(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual { _approve(to, tokenId, _msgSender()); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual returns (address) { _requireOwned(tokenId); return _getApproved(tokenId); } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual returns (bool) { ERC721Storage storage $ = _getERC721Storage(); return $._operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here. address previousOwner = _update(to, tokenId, _msgSender()); if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual { transferFrom(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist * * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the * core ERC721 logic MUST be matched with the use of {_increaseBalance} to keep balances * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`. */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { ERC721Storage storage $ = _getERC721Storage(); return $._owners[tokenId]; } /** * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted. */ function _getApproved(uint256 tokenId) internal view virtual returns (address) { ERC721Storage storage $ = _getERC721Storage(); return $._tokenApprovals[tokenId]; } /** * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in * particular (ignoring whether it is owned by `owner`). * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) { return spender != address(0) && (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender); } /** * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner. * Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets * the `spender` for the specific `tokenId`. * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual { if (!_isAuthorized(owner, spender, tokenId)) { if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } else { revert ERC721InsufficientApproval(spender, tokenId); } } } /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that * a uint256 would ever overflow from increments when these increments are bounded to uint128 values. * * WARNING: Increasing an account's balance using this function tends to be paired with an override of the * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership * remain consistent with one another. */ function _increaseBalance(address account, uint128 value) internal virtual { ERC721Storage storage $ = _getERC721Storage(); unchecked { $._balances[account] += value; } } /** * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update. * * The `auth` argument is optional. If the value passed is non 0, then this function will check that * `auth` is either the owner of the token, or approved to operate on the token (by the owner). * * Emits a {Transfer} event. * * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}. */ function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) { ERC721Storage storage $ = _getERC721Storage(); address from = _ownerOf(tokenId); // Perform (optional) operator check if (auth != address(0)) { _checkAuthorized(from, auth, tokenId); } // Execute the update if (from != address(0)) { // Clear approval. No need to re-authorize or emit the Approval event _approve(address(0), tokenId, address(0), false); unchecked { $._balances[from] -= 1; } } if (to != address(0)) { unchecked { $._balances[to] += 1; } } $._owners[tokenId] = to; emit Transfer(from, to, tokenId); return from; } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner != address(0)) { revert ERC721InvalidSender(address(0)); } } /** * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual { _mint(to, tokenId); _checkOnERC721Received(address(0), to, tokenId, data); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal { address previousOwner = _update(address(0), tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } else if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients * are aware of the ERC721 standard to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is like {safeTransferFrom} in the sense that it invokes * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `tokenId` token must exist and be owned by `from`. * - `to` cannot be the zero address. * - `from` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer(address from, address to, uint256 tokenId) internal { _safeTransfer(from, to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual { _transfer(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Approve `to` to operate on `tokenId` * * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is * either the owner of the token, or approved to operate on all tokens held by this owner. * * Emits an {Approval} event. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address to, uint256 tokenId, address auth) internal { _approve(to, tokenId, auth, true); } /** * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not * emitted in the context of transfers. */ function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual { ERC721Storage storage $ = _getERC721Storage(); // Avoid reading the owner unless necessary if (emitEvent || auth != address(0)) { address owner = _requireOwned(tokenId); // We do not use _isAuthorized because single-token approvals should not be able to call approve if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) { revert ERC721InvalidApprover(auth); } if (emitEvent) { emit Approval(owner, to, tokenId); } } $._tokenApprovals[tokenId] = to; } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Requirements: * - operator can't be the address zero. * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { ERC721Storage storage $ = _getERC721Storage(); if (operator == address(0)) { revert ERC721InvalidOperator(operator); } $._operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned). * Returns the owner. * * Overrides to ownership logic should be done to {_ownerOf}. */ function _requireOwned(uint256 tokenId) internal view returns (address) { address owner = _ownerOf(tokenId); if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } return owner; } /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the * recipient doesn't accept the token transfer. The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call */ function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private { if (to.code.length > 0) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { if (retval != IERC721Receiver.onERC721Received.selector) { revert ERC721InvalidReceiver(to); } } catch (bytes memory reason) { if (reason.length == 0) { revert ERC721InvalidReceiver(to); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } } } // File contracts/OsmiNode.sol // Original license: SPDX_License_Identifier: MIT // Compatible with OpenZeppelin Contracts ^5.0.0 pragma solidity ^0.8.22; /// @custom:security-contact [email protected] contract OsmiNode is Initializable, ERC721Upgradeable, AccessManagedUpgradeable, UUPSUpgradeable { /** * @dev Emitted when a token's transfer lock is updated. */ event OsmiNodeTransferLockUpdated(uint256 tokenId, uint lockedUntil); /** * @dev Indicates a token is transfer locked. * @param tokenId Id of the token. * @param lockedUntil When are transfers unlocked for tokenId? */ error OsmiNodeTransferLocked(uint256 tokenId, uint lockedUntil); /** * @dev Initial duration of transfer lock when minting tokens. */ uint public constant InitialTransferLockDurationOnMint = 365 days; /// @custom:storage-location erc7201:ai.osmi.storage.OsmiNode struct OsmiNodeStorage { uint256 nextTokenId; uint transferLockDurationOnMint; mapping(uint256 => uint) transferLockedUntil; } // keccak256(abi.encode(uint256(keccak256("ai.osmi.storage.OsmiNode")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant OsmiNodeStorageLocation = 0x9f791d4738865ba7c779eecd51509000f816d1d2e37f69177c0f7c39eff80000; function _getOsmiNodeStorageLocation() private pure returns (OsmiNodeStorage storage $) { assembly { $.slot := OsmiNodeStorageLocation } } /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } function initialize(address initialAuthority) initializer public { __ERC721_init("Osmi AI Node", "OsmiNode"); __AccessManaged_init(initialAuthority); __UUPSUpgradeable_init(); __transfer_locked_init(); } /** * @dev Initialized the transfer locked system. */ function __transfer_locked_init() internal onlyInitializing { OsmiNodeStorage storage $ = _getOsmiNodeStorageLocation(); $.transferLockDurationOnMint = InitialTransferLockDurationOnMint; } function _baseURI() internal view override returns (string memory) { return string.concat( string.concat( "https://nodes.osmi.ai/api/token-metadata/", Strings.toString(block.chainid) ), "/OsmiNode/" ); } /** * @dev Returns the total supply of nodes. */ function getTotalSupply() external view returns (uint256) { OsmiNodeStorage storage $ = _getOsmiNodeStorageLocation(); return $.nextTokenId; } /** * @dev Returns it a token is transfer locked and the time any lock expires. */ function isTransferLocked(uint256 tokenId) external view returns (bool, uint) { return _isTransferLocked(tokenId); } function _isTransferLocked(uint256 tokenId) internal view returns (bool, uint) { uint lockedUntil = _getTransferLockedUntil(tokenId); bool locked = lockedUntil > block.timestamp; return (locked, lockedUntil); } /** * @dev Returns when a token's transfer lock is expired. */ function getTransferLockedUntil(uint256 tokenId) external view returns (uint) { _requireOwned(tokenId); return _getTransferLockedUntil(tokenId); } function _getTransferLockedUntil(uint256 tokenId) internal view returns (uint) { OsmiNodeStorage storage $ = _getOsmiNodeStorageLocation(); return $.transferLockedUntil[tokenId]; } /** * @dev Restricted function for setting the transfer unlock time for a token. * @param tokenId Id of the token. * @param lockedUntil When are transfers unlocked for tokenId? */ function setTransferLockedUntil(uint256 tokenId, uint lockedUntil) external restricted { _requireOwned(tokenId); _setTransferLockedUntil(tokenId, lockedUntil); } function _setTransferLockedUntil(uint256 tokenId, uint lockedUntil) internal { OsmiNodeStorage storage $ = _getOsmiNodeStorageLocation(); $.transferLockedUntil[tokenId] = lockedUntil; emit OsmiNodeTransferLockUpdated(tokenId, lockedUntil); } /** * @dev Restricted function to set the transfer lock duration on mint of a new token. * @param duration How many seconds from mint time should the transfer lock last? */ function setTransferLockDurationOnMint(uint duration) external restricted { _setTransferLockDurationOnMint(duration); } function _setTransferLockDurationOnMint(uint duration) internal { OsmiNodeStorage storage $ = _getOsmiNodeStorageLocation(); $.transferLockDurationOnMint = duration; } /** * @dev Restricted function to mint a token to an address. * @param to Address to receive the token. */ function safeMint(address to) public restricted { OsmiNodeStorage storage $ = _getOsmiNodeStorageLocation(); uint256 tokenId = $.nextTokenId++; _safeMint(to, tokenId); _setTransferLockedUntil(tokenId, block.timestamp + $.transferLockDurationOnMint); } /** * @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 override returns (address) { uint lockedUntil = _getTransferLockedUntil(tokenId); if(lockedUntil > block.timestamp) { revert OsmiNodeTransferLocked(tokenId, lockedUntil); } return super._update(to, tokenId, auth); } /** * @dev Restricted function to authorize contract upgrades. */ function _authorizeUpgrade(address newImplementation) internal restricted override {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"authority","type":"address"}],"name":"AccessManagedInvalidAuthority","type":"error"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"uint32","name":"delay","type":"uint32"}],"name":"AccessManagedRequiredDelay","type":"error"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"AccessManagedUnauthorized","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721IncorrectOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721InsufficientApproval","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC721InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC721InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC721InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC721InvalidSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721NonexistentToken","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"lockedUntil","type":"uint256"}],"name":"OsmiNodeTransferLocked","type":"error"},{"inputs":[],"name":"UUPSUnauthorizedCallContext","type":"error"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"UUPSUnsupportedProxiableUUID","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"authority","type":"address"}],"name":"AuthorityUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lockedUntil","type":"uint256"}],"name":"OsmiNodeTransferLockUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"InitialTransferLockDurationOnMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADE_INTERFACE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"authority","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTransferLockedUntil","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"initialAuthority","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isConsumingScheduledOp","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isTransferLocked","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"safeMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAuthority","type":"address"}],"name":"setAuthority","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"setTransferLockDurationOnMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"lockedUntil","type":"uint256"}],"name":"setTransferLockedUntil","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"}]
Contract Creation Code
60a06040523060805234801561001457600080fd5b5061001d610022565b6100d4565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100725760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100d15780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6080516123466100fd60003960008181610e9601528181610ebf015261100301526123466000f3fe60806040526004361061019c5760003560e01c80638fb36037116100ec578063c4d66de81161008a578063c87b56dd11610064578063c87b56dd146104f9578063d8f0c00214610519578063e272a56114610531578063e985e9c51461055157600080fd5b8063c4d66de814610485578063c4e41b22146104a5578063c4fd6877146104d957600080fd5b8063a22cb465116100c6578063a22cb465146103ff578063ad3cb1cc1461041f578063b88d4fde14610450578063bf7e214f1461047057600080fd5b80638fb360371461036857806395d89b41146103965780639913627f146103ab57600080fd5b806342842e0e1161015957806352d1902d1161013357806352d1902d146102f35780636352211e1461030857806370a08231146103285780637a9e5e4b1461034857600080fd5b806342842e0e146102925780634c119a46146102b25780634f1ef286146102e057600080fd5b806301ffc9a7146101a157806306fdde03146101d6578063081812fc146101f8578063095ea7b31461023057806323b872dd1461025257806340d097c314610272575b600080fd5b3480156101ad57600080fd5b506101c16101bc366004611ba8565b610571565b60405190151581526020015b60405180910390f35b3480156101e257600080fd5b506101eb6105c3565b6040516101cd9190611c15565b34801561020457600080fd5b50610218610213366004611c28565b610667565b6040516001600160a01b0390911681526020016101cd565b34801561023c57600080fd5b5061025061024b366004611c5d565b61067c565b005b34801561025e57600080fd5b5061025061026d366004611c87565b61068b565b34801561027e57600080fd5b5061025061028d366004611cc4565b61071b565b34801561029e57600080fd5b506102506102ad366004611c87565b610787565b3480156102be57600080fd5b506102d26102cd366004611c28565b6107a2565b6040519081526020016101cd565b6102506102ee366004611d84565b6107cf565b3480156102ff57600080fd5b506102d26107ea565b34801561031457600080fd5b50610218610323366004611c28565b610807565b34801561033457600080fd5b506102d2610343366004611cc4565b610812565b34801561035457600080fd5b50610250610363366004611cc4565b61086e565b34801561037457600080fd5b5061037d6108f1565b6040516001600160e01b031990911681526020016101cd565b3480156103a257600080fd5b506101eb61092a565b3480156103b757600080fd5b506103e86103c6366004611c28565b60009081526000805160206122d1833981519152602052604090205442811191565b6040805192151583526020830191909152016101cd565b34801561040b57600080fd5b5061025061041a366004611de0565b610969565b34801561042b57600080fd5b506101eb604051806040016040528060058152602001640352e302e360dc1b81525081565b34801561045c57600080fd5b5061025061046b366004611e17565b610974565b34801561047c57600080fd5b5061021861098b565b34801561049157600080fd5b506102506104a0366004611cc4565b6109a7565b3480156104b157600080fd5b507f9f791d4738865ba7c779eecd51509000f816d1d2e37f69177c0f7c39eff80000546102d2565b3480156104e557600080fd5b506102506104f4366004611e7f565b610b15565b34801561050557600080fd5b506101eb610514366004611c28565b610b32565b34801561052557600080fd5b506102d26301e1338081565b34801561053d57600080fd5b5061025061054c366004611c28565b610b9a565b34801561055d57600080fd5b506101c161056c366004611ea1565b610bce565b60006001600160e01b031982166380ac58cd60e01b14806105a257506001600160e01b03198216635b5e139f60e01b145b806105bd57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000805160206122b183398151915280546060919081906105e390611ed4565b80601f016020809104026020016040519081016040528092919081815260200182805461060f90611ed4565b801561065c5780601f106106315761010080835404028352916020019161065c565b820191906000526020600020905b81548152906001019060200180831161063f57829003601f168201915b505050505091505090565b600061067282610c1b565b506105bd82610c53565b610687828233610c8d565b5050565b6001600160a01b0382166106ba57604051633250574960e11b8152600060048201526024015b60405180910390fd5b60006106c7838333610c9a565b9050836001600160a01b0316816001600160a01b031614610715576040516364283d7b60e01b81526001600160a01b03808616600483015260248201849052821660448201526064016106b1565b50505050565b610728335b600036610cf5565b7f9f791d4738865ba7c779eecd51509000f816d1d2e37f69177c0f7c39eff800008054600090828261075983611f24565b9190505590506107698382610df3565b6107828183600101544261077d9190611f3d565b610e0d565b505050565b61078283838360405180602001604052806000815250610974565b60006107ad82610c1b565b5060008281526000805160206122d183398151915260205260409020546105bd565b6107d7610e8b565b6107e082610f32565b6106878282610f3b565b60006107f4610ff8565b506000805160206122f183398151915290565b60006105bd82610c1b565b60006000805160206122b18339815191526001600160a01b03831661084d576040516322718ad960e21b8152600060048201526024016106b1565b6001600160a01b039092166000908152600390920160205250604090205490565b3361087761098b565b6001600160a01b0316816001600160a01b0316146108b25760405162d1953b60e31b81526001600160a01b03821660048201526024016106b1565b816001600160a01b03163b6000036108e8576040516361798f2f60e11b81526001600160a01b03831660048201526024016106b1565b61068782611041565b600080516020612291833981519152805460009190600160a01b900460ff1661091b576000610924565b638fb3603760e01b5b91505090565b7f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930180546060916000805160206122b1833981519152916105e390611ed4565b6106873383836110a2565b61097f84848461068b565b61071584848484611153565b600080516020612291833981519152546001600160a01b031690565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff166000811580156109ed5750825b905060008267ffffffffffffffff166001148015610a0a5750303b155b905081158015610a18575080155b15610a365760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a6057845460ff60401b1916600160401b1785555b610aae6040518060400160405280600c81526020016b4f736d69204149204e6f646560a01b815250604051806040016040528060088152602001674f736d694e6f646560c01b81525061127c565b610ab78661128e565b610abf61129f565b610ac76112a7565b8315610b0d57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b610b1e33610720565b610b2782610c1b565b506106878282610e0d565b6060610b3d82610c1b565b506000610b486112d8565b90506000815111610b685760405180602001604052806000815250610b93565b80610b7284611324565b604051602001610b83929190611f50565b6040516020818303038152906040525b9392505050565b610ba333610720565b610bcb817f9f791d4738865ba7c779eecd51509000f816d1d2e37f69177c0f7c39eff8000155565b50565b6001600160a01b0391821660009081527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793056020908152604080832093909416825291909152205460ff1690565b600080610c27836113b7565b90506001600160a01b0381166105bd57604051637e27328960e01b8152600481018490526024016106b1565b60009081527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930460205260409020546001600160a01b031690565b61078283838360016113f1565b60008281526000805160206122d1833981519152602052604081205442811115610ce15760405163045e912960e31b815260048101859052602481018290526044016106b1565b610cec858585611507565b95945050505050565b600080516020612291833981519152600080610d30610d1261098b565b8730610d22600460008a8c611f7f565b610d2b91611fa9565b611611565b9150915081610b0d5763ffffffff811615610dd057825460ff60a01b1916600160a01b178355610d5e61098b565b6001600160a01b03166394c7d7ee8787876040518463ffffffff1660e01b8152600401610d8d93929190611fe1565b600060405180830381600087803b158015610da757600080fd5b505af1158015610dbb573d6000803e3d6000fd5b5050845460ff60a01b1916855550610b0d9050565b60405162d1953b60e31b81526001600160a01b03871660048201526024016106b1565b61068782826040518060200160405280600081525061171d565b60008281526000805160206122d18339815191526020908152604091829020839055815184815290810183905281517f9f791d4738865ba7c779eecd51509000f816d1d2e37f69177c0f7c39eff80000927fbb83344d2ed829c24bb3ebbb518d53a2ab011c0c6b97b964ea5da15b6a83d792928290030190a1505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610f1257507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610f066000805160206122f1833981519152546001600160a01b031690565b6001600160a01b031614155b15610f305760405163703e46dd60e11b815260040160405180910390fd5b565b610bcb33610720565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610f95575060408051601f3d908101601f19168201909252610f9291810190612021565b60015b610fbd57604051634c9c8ce360e01b81526001600160a01b03831660048201526024016106b1565b6000805160206122f18339815191528114610fee57604051632a87526960e21b8152600481018290526024016106b1565b6107828383611734565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610f305760405163703e46dd60e11b815260040160405180910390fd5b60008051602061229183398151915280546001600160a01b0383166001600160a01b03199091168117825560408051918252517f2f658b440c35314f52658ea8a740e05b284cdc84dc9ae01e891f21b8933e7cad9181900360200190a15050565b6000805160206122b18339815191526001600160a01b0383166110e357604051630b61174360e31b81526001600160a01b03841660048201526024016106b1565b6001600160a01b038481166000818152600584016020908152604080832094881680845294825291829020805460ff191687151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a350505050565b6001600160a01b0383163b1561071557604051630a85bd0160e11b81526001600160a01b0384169063150b7a029061119590339088908790879060040161203a565b6020604051808303816000875af19250505080156111d0575060408051601f3d908101601f191682019092526111cd91810190612077565b60015b611239573d8080156111fe576040519150601f19603f3d011682016040523d82523d6000602084013e611203565b606091505b50805160000361123157604051633250574960e11b81526001600160a01b03851660048201526024016106b1565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461127557604051633250574960e11b81526001600160a01b03851660048201526024016106b1565b5050505050565b61128461178a565b61068782826117d3565b61129661178a565b610bcb81611804565b610f3061178a565b6112af61178a565b6301e133807f9f791d4738865ba7c779eecd51509000f816d1d2e37f69177c0f7c39eff8000155565b60606112e346611324565b6040516020016112f39190612094565b60408051601f1981840301815290829052611310916020016120eb565b604051602081830303815290604052905090565b6060600061133183611815565b600101905060008167ffffffffffffffff81111561135157611351611cdf565b6040519080825280601f01601f19166020018201604052801561137b576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461138557509392505050565b60009081527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930260205260409020546001600160a01b031690565b6000805160206122b1833981519152818061141457506001600160a01b03831615155b156114d657600061142485610c1b565b90506001600160a01b038416158015906114505750836001600160a01b0316816001600160a01b031614155b801561146357506114618185610bce565b155b1561148c5760405163a9fbf51f60e01b81526001600160a01b03851660048201526024016106b1565b82156114d45784866001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b600093845260040160205250506040902080546001600160a01b0319166001600160a01b0392909216919091179055565b60006000805160206122b183398151915281611522856113b7565b90506001600160a01b0384161561153e5761153e8185876118ed565b6001600160a01b0381161561157e5761155b6000866000806113f1565b6001600160a01b0381166000908152600383016020526040902080546000190190555b6001600160a01b038616156115af576001600160a01b03861660009081526003830160205260409020805460010190555b600085815260028301602052604080822080546001600160a01b0319166001600160a01b038a811691821790925591518893918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a495945050505050565b6040516001600160a01b03848116602483015283811660448301526001600160e01b03198316606483015260009182918291829189169060840160408051601f198184030181529181526020820180516001600160e01b031663b700961360e01b179052516116809190612119565b600060405180830381855afa9150503d80600081146116bb576040519150601f19603f3d011682016040523d82523d6000602084013e6116c0565b606091505b509150915081156117125760408151106116f257808060200190518101906116e89190612135565b9094509250611712565b6020815110611712578080602001905181019061170f919061216d565b93505b505094509492505050565b6117278383611951565b6107826000848484611153565b61173d826119b6565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115611782576107828282611a1b565b610687611a88565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16610f3057604051631afcd79f60e31b815260040160405180910390fd5b6117db61178a565b6000805160206122b1833981519152806117f584826121d1565b506001810161071583826121d1565b61180c61178a565b610bcb81611041565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106118545772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611880576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061189e57662386f26fc10000830492506010015b6305f5e10083106118b6576305f5e100830492506008015b61271083106118ca57612710830492506004015b606483106118dc576064830492506002015b600a83106105bd5760010192915050565b6118f8838383611aa7565b610782576001600160a01b03831661192657604051637e27328960e01b8152600481018290526024016106b1565b60405163177e802f60e01b81526001600160a01b0383166004820152602481018290526044016106b1565b6001600160a01b03821661197b57604051633250574960e11b8152600060048201526024016106b1565b600061198983836000610c9a565b90506001600160a01b03811615610782576040516339e3563760e11b8152600060048201526024016106b1565b806001600160a01b03163b6000036119ec57604051634c9c8ce360e01b81526001600160a01b03821660048201526024016106b1565b6000805160206122f183398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051611a389190612119565b600060405180830381855af49150503d8060008114611a73576040519150601f19603f3d011682016040523d82523d6000602084013e611a78565b606091505b5091509150610cec858383611b0d565b3415610f305760405163b398979f60e01b815260040160405180910390fd5b60006001600160a01b03831615801590611b055750826001600160a01b0316846001600160a01b03161480611ae15750611ae18484610bce565b80611b055750826001600160a01b0316611afa83610c53565b6001600160a01b0316145b949350505050565b606082611b2257611b1d82611b69565b610b93565b8151158015611b3957506001600160a01b0384163b155b15611b6257604051639996b31560e01b81526001600160a01b03851660048201526024016106b1565b5080610b93565b805115611b795780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6001600160e01b031981168114610bcb57600080fd5b600060208284031215611bba57600080fd5b8135610b9381611b92565b60005b83811015611be0578181015183820152602001611bc8565b50506000910152565b60008151808452611c01816020860160208601611bc5565b601f01601f19169290920160200192915050565b602081526000610b936020830184611be9565b600060208284031215611c3a57600080fd5b5035919050565b80356001600160a01b0381168114611c5857600080fd5b919050565b60008060408385031215611c7057600080fd5b611c7983611c41565b946020939093013593505050565b600080600060608486031215611c9c57600080fd5b611ca584611c41565b9250611cb360208501611c41565b929592945050506040919091013590565b600060208284031215611cd657600080fd5b610b9382611c41565b634e487b7160e01b600052604160045260246000fd5b600082601f830112611d0657600080fd5b813567ffffffffffffffff811115611d2057611d20611cdf565b604051601f8201601f19908116603f0116810167ffffffffffffffff81118282101715611d4f57611d4f611cdf565b604052818152838201602001851015611d6757600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215611d9757600080fd5b611da083611c41565b9150602083013567ffffffffffffffff811115611dbc57600080fd5b611dc885828601611cf5565b9150509250929050565b8015158114610bcb57600080fd5b60008060408385031215611df357600080fd5b611dfc83611c41565b91506020830135611e0c81611dd2565b809150509250929050565b60008060008060808587031215611e2d57600080fd5b611e3685611c41565b9350611e4460208601611c41565b925060408501359150606085013567ffffffffffffffff811115611e6757600080fd5b611e7387828801611cf5565b91505092959194509250565b60008060408385031215611e9257600080fd5b50508035926020909101359150565b60008060408385031215611eb457600080fd5b611ebd83611c41565b9150611ecb60208401611c41565b90509250929050565b600181811c90821680611ee857607f821691505b602082108103611f0857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600060018201611f3657611f36611f0e565b5060010190565b808201808211156105bd576105bd611f0e565b60008351611f62818460208801611bc5565b835190830190611f76818360208801611bc5565b01949350505050565b60008085851115611f8f57600080fd5b83861115611f9c57600080fd5b5050820193919092039150565b80356001600160e01b03198116906004841015611fda576001600160e01b0319600485900360031b81901b82161691505b5092915050565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b60006020828403121561203357600080fd5b5051919050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061206d90830184611be9565b9695505050505050565b60006020828403121561208957600080fd5b8151610b9381611b92565b7f68747470733a2f2f6e6f6465732e6f736d692e61692f6170692f746f6b656e2d8152686d657461646174612f60b81b6020820152600082516120de816029850160208701611bc5565b9190910160290192915050565b600082516120fd818460208701611bc5565b692f4f736d694e6f64652f60b01b920191825250600a01919050565b6000825161212b818460208701611bc5565b9190910192915050565b6000806040838503121561214857600080fd5b825161215381611dd2565b602084015190925063ffffffff81168114611e0c57600080fd5b60006020828403121561217f57600080fd5b8151610b9381611dd2565b601f82111561078257806000526020600020601f840160051c810160208510156121b15750805b601f840160051c820191505b8181101561127557600081556001016121bd565b815167ffffffffffffffff8111156121eb576121eb611cdf565b6121ff816121f98454611ed4565b8461218a565b6020601f821160018114612233576000831561221b5750848201515b600019600385901b1c1916600184901b178455611275565b600084815260208120601f198516915b828110156122635787850151825560209485019460019092019101612243565b50848210156122815786840151600019600387901b60f8161c191681555b50505050600190811b0190555056fef3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a0080bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793009f791d4738865ba7c779eecd51509000f816d1d2e37f69177c0f7c39eff80002360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220c439b15f46095d74713341093c95ea21a239ede1fb58aabe286deafaba651ff664736f6c634300081c0033
Deployed Bytecode
0x60806040526004361061019c5760003560e01c80638fb36037116100ec578063c4d66de81161008a578063c87b56dd11610064578063c87b56dd146104f9578063d8f0c00214610519578063e272a56114610531578063e985e9c51461055157600080fd5b8063c4d66de814610485578063c4e41b22146104a5578063c4fd6877146104d957600080fd5b8063a22cb465116100c6578063a22cb465146103ff578063ad3cb1cc1461041f578063b88d4fde14610450578063bf7e214f1461047057600080fd5b80638fb360371461036857806395d89b41146103965780639913627f146103ab57600080fd5b806342842e0e1161015957806352d1902d1161013357806352d1902d146102f35780636352211e1461030857806370a08231146103285780637a9e5e4b1461034857600080fd5b806342842e0e146102925780634c119a46146102b25780634f1ef286146102e057600080fd5b806301ffc9a7146101a157806306fdde03146101d6578063081812fc146101f8578063095ea7b31461023057806323b872dd1461025257806340d097c314610272575b600080fd5b3480156101ad57600080fd5b506101c16101bc366004611ba8565b610571565b60405190151581526020015b60405180910390f35b3480156101e257600080fd5b506101eb6105c3565b6040516101cd9190611c15565b34801561020457600080fd5b50610218610213366004611c28565b610667565b6040516001600160a01b0390911681526020016101cd565b34801561023c57600080fd5b5061025061024b366004611c5d565b61067c565b005b34801561025e57600080fd5b5061025061026d366004611c87565b61068b565b34801561027e57600080fd5b5061025061028d366004611cc4565b61071b565b34801561029e57600080fd5b506102506102ad366004611c87565b610787565b3480156102be57600080fd5b506102d26102cd366004611c28565b6107a2565b6040519081526020016101cd565b6102506102ee366004611d84565b6107cf565b3480156102ff57600080fd5b506102d26107ea565b34801561031457600080fd5b50610218610323366004611c28565b610807565b34801561033457600080fd5b506102d2610343366004611cc4565b610812565b34801561035457600080fd5b50610250610363366004611cc4565b61086e565b34801561037457600080fd5b5061037d6108f1565b6040516001600160e01b031990911681526020016101cd565b3480156103a257600080fd5b506101eb61092a565b3480156103b757600080fd5b506103e86103c6366004611c28565b60009081526000805160206122d1833981519152602052604090205442811191565b6040805192151583526020830191909152016101cd565b34801561040b57600080fd5b5061025061041a366004611de0565b610969565b34801561042b57600080fd5b506101eb604051806040016040528060058152602001640352e302e360dc1b81525081565b34801561045c57600080fd5b5061025061046b366004611e17565b610974565b34801561047c57600080fd5b5061021861098b565b34801561049157600080fd5b506102506104a0366004611cc4565b6109a7565b3480156104b157600080fd5b507f9f791d4738865ba7c779eecd51509000f816d1d2e37f69177c0f7c39eff80000546102d2565b3480156104e557600080fd5b506102506104f4366004611e7f565b610b15565b34801561050557600080fd5b506101eb610514366004611c28565b610b32565b34801561052557600080fd5b506102d26301e1338081565b34801561053d57600080fd5b5061025061054c366004611c28565b610b9a565b34801561055d57600080fd5b506101c161056c366004611ea1565b610bce565b60006001600160e01b031982166380ac58cd60e01b14806105a257506001600160e01b03198216635b5e139f60e01b145b806105bd57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000805160206122b183398151915280546060919081906105e390611ed4565b80601f016020809104026020016040519081016040528092919081815260200182805461060f90611ed4565b801561065c5780601f106106315761010080835404028352916020019161065c565b820191906000526020600020905b81548152906001019060200180831161063f57829003601f168201915b505050505091505090565b600061067282610c1b565b506105bd82610c53565b610687828233610c8d565b5050565b6001600160a01b0382166106ba57604051633250574960e11b8152600060048201526024015b60405180910390fd5b60006106c7838333610c9a565b9050836001600160a01b0316816001600160a01b031614610715576040516364283d7b60e01b81526001600160a01b03808616600483015260248201849052821660448201526064016106b1565b50505050565b610728335b600036610cf5565b7f9f791d4738865ba7c779eecd51509000f816d1d2e37f69177c0f7c39eff800008054600090828261075983611f24565b9190505590506107698382610df3565b6107828183600101544261077d9190611f3d565b610e0d565b505050565b61078283838360405180602001604052806000815250610974565b60006107ad82610c1b565b5060008281526000805160206122d183398151915260205260409020546105bd565b6107d7610e8b565b6107e082610f32565b6106878282610f3b565b60006107f4610ff8565b506000805160206122f183398151915290565b60006105bd82610c1b565b60006000805160206122b18339815191526001600160a01b03831661084d576040516322718ad960e21b8152600060048201526024016106b1565b6001600160a01b039092166000908152600390920160205250604090205490565b3361087761098b565b6001600160a01b0316816001600160a01b0316146108b25760405162d1953b60e31b81526001600160a01b03821660048201526024016106b1565b816001600160a01b03163b6000036108e8576040516361798f2f60e11b81526001600160a01b03831660048201526024016106b1565b61068782611041565b600080516020612291833981519152805460009190600160a01b900460ff1661091b576000610924565b638fb3603760e01b5b91505090565b7f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930180546060916000805160206122b1833981519152916105e390611ed4565b6106873383836110a2565b61097f84848461068b565b61071584848484611153565b600080516020612291833981519152546001600160a01b031690565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff166000811580156109ed5750825b905060008267ffffffffffffffff166001148015610a0a5750303b155b905081158015610a18575080155b15610a365760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a6057845460ff60401b1916600160401b1785555b610aae6040518060400160405280600c81526020016b4f736d69204149204e6f646560a01b815250604051806040016040528060088152602001674f736d694e6f646560c01b81525061127c565b610ab78661128e565b610abf61129f565b610ac76112a7565b8315610b0d57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b610b1e33610720565b610b2782610c1b565b506106878282610e0d565b6060610b3d82610c1b565b506000610b486112d8565b90506000815111610b685760405180602001604052806000815250610b93565b80610b7284611324565b604051602001610b83929190611f50565b6040516020818303038152906040525b9392505050565b610ba333610720565b610bcb817f9f791d4738865ba7c779eecd51509000f816d1d2e37f69177c0f7c39eff8000155565b50565b6001600160a01b0391821660009081527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793056020908152604080832093909416825291909152205460ff1690565b600080610c27836113b7565b90506001600160a01b0381166105bd57604051637e27328960e01b8152600481018490526024016106b1565b60009081527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930460205260409020546001600160a01b031690565b61078283838360016113f1565b60008281526000805160206122d1833981519152602052604081205442811115610ce15760405163045e912960e31b815260048101859052602481018290526044016106b1565b610cec858585611507565b95945050505050565b600080516020612291833981519152600080610d30610d1261098b565b8730610d22600460008a8c611f7f565b610d2b91611fa9565b611611565b9150915081610b0d5763ffffffff811615610dd057825460ff60a01b1916600160a01b178355610d5e61098b565b6001600160a01b03166394c7d7ee8787876040518463ffffffff1660e01b8152600401610d8d93929190611fe1565b600060405180830381600087803b158015610da757600080fd5b505af1158015610dbb573d6000803e3d6000fd5b5050845460ff60a01b1916855550610b0d9050565b60405162d1953b60e31b81526001600160a01b03871660048201526024016106b1565b61068782826040518060200160405280600081525061171d565b60008281526000805160206122d18339815191526020908152604091829020839055815184815290810183905281517f9f791d4738865ba7c779eecd51509000f816d1d2e37f69177c0f7c39eff80000927fbb83344d2ed829c24bb3ebbb518d53a2ab011c0c6b97b964ea5da15b6a83d792928290030190a1505050565b306001600160a01b037f00000000000000000000000014ea14a50fe434b5f7d9d337a5f096d7054e3d8e161480610f1257507f00000000000000000000000014ea14a50fe434b5f7d9d337a5f096d7054e3d8e6001600160a01b0316610f066000805160206122f1833981519152546001600160a01b031690565b6001600160a01b031614155b15610f305760405163703e46dd60e11b815260040160405180910390fd5b565b610bcb33610720565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610f95575060408051601f3d908101601f19168201909252610f9291810190612021565b60015b610fbd57604051634c9c8ce360e01b81526001600160a01b03831660048201526024016106b1565b6000805160206122f18339815191528114610fee57604051632a87526960e21b8152600481018290526024016106b1565b6107828383611734565b306001600160a01b037f00000000000000000000000014ea14a50fe434b5f7d9d337a5f096d7054e3d8e1614610f305760405163703e46dd60e11b815260040160405180910390fd5b60008051602061229183398151915280546001600160a01b0383166001600160a01b03199091168117825560408051918252517f2f658b440c35314f52658ea8a740e05b284cdc84dc9ae01e891f21b8933e7cad9181900360200190a15050565b6000805160206122b18339815191526001600160a01b0383166110e357604051630b61174360e31b81526001600160a01b03841660048201526024016106b1565b6001600160a01b038481166000818152600584016020908152604080832094881680845294825291829020805460ff191687151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a350505050565b6001600160a01b0383163b1561071557604051630a85bd0160e11b81526001600160a01b0384169063150b7a029061119590339088908790879060040161203a565b6020604051808303816000875af19250505080156111d0575060408051601f3d908101601f191682019092526111cd91810190612077565b60015b611239573d8080156111fe576040519150601f19603f3d011682016040523d82523d6000602084013e611203565b606091505b50805160000361123157604051633250574960e11b81526001600160a01b03851660048201526024016106b1565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461127557604051633250574960e11b81526001600160a01b03851660048201526024016106b1565b5050505050565b61128461178a565b61068782826117d3565b61129661178a565b610bcb81611804565b610f3061178a565b6112af61178a565b6301e133807f9f791d4738865ba7c779eecd51509000f816d1d2e37f69177c0f7c39eff8000155565b60606112e346611324565b6040516020016112f39190612094565b60408051601f1981840301815290829052611310916020016120eb565b604051602081830303815290604052905090565b6060600061133183611815565b600101905060008167ffffffffffffffff81111561135157611351611cdf565b6040519080825280601f01601f19166020018201604052801561137b576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461138557509392505050565b60009081527f80bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab007930260205260409020546001600160a01b031690565b6000805160206122b1833981519152818061141457506001600160a01b03831615155b156114d657600061142485610c1b565b90506001600160a01b038416158015906114505750836001600160a01b0316816001600160a01b031614155b801561146357506114618185610bce565b155b1561148c5760405163a9fbf51f60e01b81526001600160a01b03851660048201526024016106b1565b82156114d45784866001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b600093845260040160205250506040902080546001600160a01b0319166001600160a01b0392909216919091179055565b60006000805160206122b183398151915281611522856113b7565b90506001600160a01b0384161561153e5761153e8185876118ed565b6001600160a01b0381161561157e5761155b6000866000806113f1565b6001600160a01b0381166000908152600383016020526040902080546000190190555b6001600160a01b038616156115af576001600160a01b03861660009081526003830160205260409020805460010190555b600085815260028301602052604080822080546001600160a01b0319166001600160a01b038a811691821790925591518893918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a495945050505050565b6040516001600160a01b03848116602483015283811660448301526001600160e01b03198316606483015260009182918291829189169060840160408051601f198184030181529181526020820180516001600160e01b031663b700961360e01b179052516116809190612119565b600060405180830381855afa9150503d80600081146116bb576040519150601f19603f3d011682016040523d82523d6000602084013e6116c0565b606091505b509150915081156117125760408151106116f257808060200190518101906116e89190612135565b9094509250611712565b6020815110611712578080602001905181019061170f919061216d565b93505b505094509492505050565b6117278383611951565b6107826000848484611153565b61173d826119b6565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2805115611782576107828282611a1b565b610687611a88565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16610f3057604051631afcd79f60e31b815260040160405180910390fd5b6117db61178a565b6000805160206122b1833981519152806117f584826121d1565b506001810161071583826121d1565b61180c61178a565b610bcb81611041565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106118545772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611880576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061189e57662386f26fc10000830492506010015b6305f5e10083106118b6576305f5e100830492506008015b61271083106118ca57612710830492506004015b606483106118dc576064830492506002015b600a83106105bd5760010192915050565b6118f8838383611aa7565b610782576001600160a01b03831661192657604051637e27328960e01b8152600481018290526024016106b1565b60405163177e802f60e01b81526001600160a01b0383166004820152602481018290526044016106b1565b6001600160a01b03821661197b57604051633250574960e11b8152600060048201526024016106b1565b600061198983836000610c9a565b90506001600160a01b03811615610782576040516339e3563760e11b8152600060048201526024016106b1565b806001600160a01b03163b6000036119ec57604051634c9c8ce360e01b81526001600160a01b03821660048201526024016106b1565b6000805160206122f183398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b031684604051611a389190612119565b600060405180830381855af49150503d8060008114611a73576040519150601f19603f3d011682016040523d82523d6000602084013e611a78565b606091505b5091509150610cec858383611b0d565b3415610f305760405163b398979f60e01b815260040160405180910390fd5b60006001600160a01b03831615801590611b055750826001600160a01b0316846001600160a01b03161480611ae15750611ae18484610bce565b80611b055750826001600160a01b0316611afa83610c53565b6001600160a01b0316145b949350505050565b606082611b2257611b1d82611b69565b610b93565b8151158015611b3957506001600160a01b0384163b155b15611b6257604051639996b31560e01b81526001600160a01b03851660048201526024016106b1565b5080610b93565b805115611b795780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6001600160e01b031981168114610bcb57600080fd5b600060208284031215611bba57600080fd5b8135610b9381611b92565b60005b83811015611be0578181015183820152602001611bc8565b50506000910152565b60008151808452611c01816020860160208601611bc5565b601f01601f19169290920160200192915050565b602081526000610b936020830184611be9565b600060208284031215611c3a57600080fd5b5035919050565b80356001600160a01b0381168114611c5857600080fd5b919050565b60008060408385031215611c7057600080fd5b611c7983611c41565b946020939093013593505050565b600080600060608486031215611c9c57600080fd5b611ca584611c41565b9250611cb360208501611c41565b929592945050506040919091013590565b600060208284031215611cd657600080fd5b610b9382611c41565b634e487b7160e01b600052604160045260246000fd5b600082601f830112611d0657600080fd5b813567ffffffffffffffff811115611d2057611d20611cdf565b604051601f8201601f19908116603f0116810167ffffffffffffffff81118282101715611d4f57611d4f611cdf565b604052818152838201602001851015611d6757600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215611d9757600080fd5b611da083611c41565b9150602083013567ffffffffffffffff811115611dbc57600080fd5b611dc885828601611cf5565b9150509250929050565b8015158114610bcb57600080fd5b60008060408385031215611df357600080fd5b611dfc83611c41565b91506020830135611e0c81611dd2565b809150509250929050565b60008060008060808587031215611e2d57600080fd5b611e3685611c41565b9350611e4460208601611c41565b925060408501359150606085013567ffffffffffffffff811115611e6757600080fd5b611e7387828801611cf5565b91505092959194509250565b60008060408385031215611e9257600080fd5b50508035926020909101359150565b60008060408385031215611eb457600080fd5b611ebd83611c41565b9150611ecb60208401611c41565b90509250929050565b600181811c90821680611ee857607f821691505b602082108103611f0857634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600060018201611f3657611f36611f0e565b5060010190565b808201808211156105bd576105bd611f0e565b60008351611f62818460208801611bc5565b835190830190611f76818360208801611bc5565b01949350505050565b60008085851115611f8f57600080fd5b83861115611f9c57600080fd5b5050820193919092039150565b80356001600160e01b03198116906004841015611fda576001600160e01b0319600485900360031b81901b82161691505b5092915050565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b60006020828403121561203357600080fd5b5051919050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061206d90830184611be9565b9695505050505050565b60006020828403121561208957600080fd5b8151610b9381611b92565b7f68747470733a2f2f6e6f6465732e6f736d692e61692f6170692f746f6b656e2d8152686d657461646174612f60b81b6020820152600082516120de816029850160208701611bc5565b9190910160290192915050565b600082516120fd818460208701611bc5565b692f4f736d694e6f64652f60b01b920191825250600a01919050565b6000825161212b818460208701611bc5565b9190910192915050565b6000806040838503121561214857600080fd5b825161215381611dd2565b602084015190925063ffffffff81168114611e0c57600080fd5b60006020828403121561217f57600080fd5b8151610b9381611dd2565b601f82111561078257806000526020600020601f840160051c810160208510156121b15750805b601f840160051c820191505b8181101561127557600081556001016121bd565b815167ffffffffffffffff8111156121eb576121eb611cdf565b6121ff816121f98454611ed4565b8461218a565b6020601f821160018114612233576000831561221b5750848201515b600019600385901b1c1916600184901b178455611275565b600084815260208120601f198516915b828110156122635787850151825560209485019460019092019101612243565b50848210156122815786840151600019600387901b60f8161c191681555b50505050600190811b0190555056fef3177357ab46d8af007ab3fdb9af81da189e1068fefdc0073dca88a2cab40a0080bb2b638cc20bc4d0a60d66940f3ab4a00c1d7b313497ca82fb0b4ab00793009f791d4738865ba7c779eecd51509000f816d1d2e37f69177c0f7c39eff80002360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca2646970667358221220c439b15f46095d74713341093c95ea21a239ede1fb58aabe286deafaba651ff664736f6c634300081c0033
Deployed Bytecode Sourcemap
158655:6275:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;141270:316;;;;;;;;;;-1:-1:-1;141270:316:0;;;;;:::i;:::-;;:::i;:::-;;;565:14:1;;558:22;540:41;;528:2;513:18;141270:316:0;;;;;;;;142170:149;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;143458:158::-;;;;;;;;;;-1:-1:-1;143458:158:0;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;1743:32:1;;;1725:51;;1713:2;1698:18;143458:158:0;1579:203:1;143277:115:0;;;;;;;;;;-1:-1:-1;143277:115:0;;;;;:::i;:::-;;:::i;:::-;;144185:588;;;;;;;;;;-1:-1:-1;144185:588:0;;;;;:::i;:::-;;:::i;163483:292::-;;;;;;;;;;-1:-1:-1;163483:292:0;;;;;:::i;:::-;;:::i;144844:134::-;;;;;;;;;;-1:-1:-1;144844:134:0;;;;;:::i;:::-;;:::i;161748:169::-;;;;;;;;;;-1:-1:-1;161748:169:0;;;;;:::i;:::-;;:::i;:::-;;;2986:25:1;;;2974:2;2959:18;161748:169:0;2840:177:1;116006:217:0;;;;;;:::i;:::-;;:::i;115539:136::-;;;;;;;;;;;;;:::i;141983:120::-;;;;;;;;;;-1:-1:-1;141983:120:0;;;;;:::i;:::-;;:::i;141650:271::-;;;;;;;;;;-1:-1:-1;141650:271:0;;;;;:::i;:::-;;:::i;90859:371::-;;;;;;;;;;-1:-1:-1;90859:371:0;;;;;:::i;:::-;;:::i;91274:230::-;;;;;;;;;;;;;:::i;:::-;;;-1:-1:-1;;;;;;4627:33:1;;;4609:52;;4597:2;4582:18;91274:230:0;4465:202:1;142388:153:0;;;;;;;;;;;;;:::i;161280:130::-;;;;;;;;;;-1:-1:-1;161280:130:0;;;;;:::i;:::-;161346:4;162090:30;;;-1:-1:-1;;;;;;;;;;;162090:30:0;;;;;;161598:15;161584:29;;;161280:130;;;;;4865:14:1;;4858:22;4840:41;;4912:2;4897:18;;4890:34;;;;4813:18;161280:130:0;4672:258:1;143688:146:0;;;;;;;;;;-1:-1:-1;143688:146:0;;;;;:::i;:::-;;:::i;113607:58::-;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;113607:58:0;;;;;145049:211;;;;;;;;;;-1:-1:-1;145049:211:0;;;;;:::i;:::-;;:::i;90648:167::-;;;;;;;;;;;;;:::i;160091:244::-;;;;;;;;;;-1:-1:-1;160091:244:0;;;;;:::i;:::-;;:::i;161007:165::-;;;;;;;;;;-1:-1:-1;159925:23:0;161151:13;161007:165;;162345:184;;;;;;;;;;-1:-1:-1;162345:184:0;;;;;:::i;:::-;;:::i;142612:260::-;;;;;;;;;;-1:-1:-1;142612:260:0;;;;;:::i;:::-;;:::i;159251:65::-;;;;;;;;;;;;159308:8;159251:65;;163014:133;;;;;;;;;;-1:-1:-1;163014:133:0;;;;;:::i;:::-;;:::i;143905:213::-;;;;;;;;;;-1:-1:-1;143905:213:0;;;;;:::i;:::-;;:::i;141270:316::-;141383:4;-1:-1:-1;;;;;;141420:40:0;;-1:-1:-1;;;141420:40:0;;:105;;-1:-1:-1;;;;;;;141477:48:0;;-1:-1:-1;;;141477:48:0;141420:105;:158;;;-1:-1:-1;;;;;;;;;;120624:40:0;;;141542:36;141400:178;141270:316;-1:-1:-1;;141270:316:0:o;142170:149::-;-1:-1:-1;;;;;;;;;;;142297:14:0;;142215:13;;140653:21;;;142297:14;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;142170:149;:::o;143458:158::-;143525:7;143545:22;143559:7;143545:13;:22::i;:::-;;143587:21;143600:7;143587:12;:21::i;143277:115::-;143349:35;143358:2;143362:7;10370:10;143349:8;:35::i;:::-;143277:115;;:::o;144185:588::-;-1:-1:-1;;;;;144280:16:0;;144276:89;;144320:33;;-1:-1:-1;;;144320:33:0;;144350:1;144320:33;;;1725:51:1;1698:18;;144320:33:0;;;;;;;;144276:89;144586:21;144610:34;144618:2;144622:7;10370:10;144610:7;:34::i;:::-;144586:58;;144676:4;-1:-1:-1;;;;;144659:21:0;:13;-1:-1:-1;;;;;144659:21:0;;144655:111;;144704:50;;-1:-1:-1;;;144704:50:0;;-1:-1:-1;;;;;7187:32:1;;;144704:50:0;;;7169:51:1;7236:18;;;7229:34;;;7299:32;;7279:18;;;7272:60;7142:18;;144704:50:0;6967:371:1;144655:111:0;144265:508;144185:588;;;:::o;163483:292::-;90545:39;10370:10;90559:12;10447:14;;90545:13;:39::i;:::-;159925:23;163628:15;;163542:25:::1;::::0;159925:23;163542:25;163628:15:::1;::::0;::::1;:::i;:::-;;;;;163610:33;;163654:22;163664:2;163668:7;163654:9;:22::i;:::-;163687:80;163711:7;163738:1;:28;;;163720:15;:46;;;;:::i;:::-;163687:23;:80::i;:::-;163531:244;;163483:292:::0;:::o;144844:134::-;144931:39;144948:4;144954:2;144958:7;144931:39;;;;;;;;;;;;:16;:39::i;161748:169::-;161820:4;161837:22;161851:7;161837:13;:22::i;:::-;-1:-1:-1;161998:4:0;162090:30;;;-1:-1:-1;;;;;;;;;;;162090:30:0;;;;;;161877:32;161925:203;116006:217;114461:13;:11;:13::i;:::-;116122:36:::1;116140:17;116122;:36::i;:::-;116169:46;116191:17;116210:4;116169:21;:46::i;115539:136::-:0;115608:7;114741:20;:18;:20::i;:::-;-1:-1:-1;;;;;;;;;;;;115539:136:0;:::o;141983:120::-;142046:7;142073:22;142087:7;142073:13;:22::i;141650:271::-;141713:7;-1:-1:-1;;;;;;;;;;;;;;;;141793:19:0;;141789:89;;141836:30;;-1:-1:-1;;;141836:30:0;;141863:1;141836:30;;;1725:51:1;1698:18;;141836:30:0;1579:203:1;141789:89:0;-1:-1:-1;;;;;141895:18:0;;;;;;;:11;;;;:18;;-1:-1:-1;141895:18:0;;;;;141650:271::o;90859:371::-;10370:10;90983:11;:9;:11::i;:::-;-1:-1:-1;;;;;90973:21:0;:6;-1:-1:-1;;;;;90973:21:0;;90969:94;;91018:33;;-1:-1:-1;;;91018:33:0;;-1:-1:-1;;;;;1743:32:1;;91018:33:0;;;1725:51:1;1698:18;;91018:33:0;1579:203:1;90969:94:0;91077:12;-1:-1:-1;;;;;91077:24:0;;91105:1;91077:29;91073:112;;91130:43;;-1:-1:-1;;;91130:43:0;;-1:-1:-1;;;;;1743:32:1;;91130:43:0;;;1725:51:1;1698:18;;91130:43:0;1579:203:1;91073:112:0;91195:27;91209:12;91195:13;:27::i;91274:230::-;-1:-1:-1;;;;;;;;;;;91425:20:0;;91329:6;;88478:28;-1:-1:-1;;;91425:20:0;;;;:71;;91494:1;91425:71;;;-1:-1:-1;;;91425:71:0;91418:78;;;91274:230;:::o;142388:153::-;142524:9;142517:16;;142435:13;;-1:-1:-1;;;;;;;;;;;140653:21:0;142517:16;;;:::i;143688:146::-;143774:52;10370:10;143807:8;143817;143774:18;:52::i;145049:211::-;145163:31;145176:4;145182:2;145186:7;145163:12;:31::i;:::-;145205:47;145228:4;145234:2;145238:7;145247:4;145205:22;:47::i;90648:167::-;-1:-1:-1;;;;;;;;;;;90795:12:0;-1:-1:-1;;;;;90795:12:0;;90648:167::o;160091:244::-;9297:21;4613:15;;-1:-1:-1;;;4613:15:0;;;;4612:16;;4660:14;;4466:30;5045:16;;:34;;;;;5065:14;5045:34;5025:54;;5090:17;5110:11;:16;;5125:1;5110:16;:50;;;;-1:-1:-1;5138:4:0;5130:25;:30;5110:50;5090:70;;5178:12;5177:13;:30;;;;;5195:12;5194:13;5177:30;5173:93;;;5231:23;;-1:-1:-1;;;5231:23:0;;;;;;;;;;;5173:93;5276:18;;-1:-1:-1;;5276:18:0;5293:1;5276:18;;;5305:69;;;;5340:22;;-1:-1:-1;;;;5340:22:0;-1:-1:-1;;;5340:22:0;;;5305:69;160167:41:::1;;;;;;;;;;;;;;-1:-1:-1::0;;;160167:41:0::1;;::::0;::::1;;;;;;;;;;;;;-1:-1:-1::0;;;160167:41:0::1;;::::0;:13:::1;:41::i;:::-;160219:38;160240:16;160219:20;:38::i;:::-;160268:24;:22;:24::i;:::-;160303;:22;:24::i;:::-;5400:14:::0;5396:104;;;5431:23;;-1:-1:-1;;;;5431:23:0;;;5474:14;;-1:-1:-1;7898:50:1;;5474:14:0;;7886:2:1;7871:18;5474:14:0;;;;;;;5396:104;4398:1109;;;;;160091:244;:::o;162345:184::-;90545:39;10370:10;90559:12;10290:98;90545:39;162443:22:::1;162457:7;162443:13;:22::i;:::-;;162476:45;162500:7;162509:11;162476:23;:45::i;142612:260::-:0;142676:13;142702:22;142716:7;142702:13;:22::i;:::-;;142737:21;142761:10;:8;:10::i;:::-;142737:34;;142813:1;142795:7;142789:21;:25;:75;;;;;;;;;;;;;;;;;142831:7;142840:18;:7;:16;:18::i;:::-;142817:42;;;;;;;;;:::i;:::-;;;;;;;;;;;;;142789:75;142782:82;142612:260;-1:-1:-1;;;142612:260:0:o;163014:133::-;90545:39;10370:10;90559:12;10290:98;90545:39;163099:40:::1;163130:8;163298:28:::0;:39;163155:190;163099:40:::1;163014:133:::0;:::o;143905:213::-;-1:-1:-1;;;;;144073:27:0;;;143993:4;144073:27;;;:20;:27;;;;;;;;:37;;;;;;;;;;;;;;;143905:213::o;156843:247::-;156906:7;156926:13;156942:17;156951:7;156942:8;:17::i;:::-;156926:33;-1:-1:-1;;;;;;156974:19:0;;156970:90;;157017:31;;-1:-1:-1;;;157017:31:0;;;;;2986:25:1;;;2959:18;;157017:31:0;2840:177:1;146080:187:0;146150:7;146233:26;;;:17;:26;;;;;;-1:-1:-1;;;;;146233:26:0;;146080:187::o;154959:122::-;155040:33;155049:2;155053:7;155062:4;155068;155040:8;:33::i;164381:338::-;164468:7;162090:30;;;-1:-1:-1;;;;;;;;;;;162090:30:0;;;;;;164567:15;164553:11;:29;164550:112;;;164606:44;;-1:-1:-1;;;164606:44:0;;;;;8634:25:1;;;8675:18;;;8668:34;;;8607:18;;164606:44:0;8460:248:1;164550:112:0;164679:32;164693:2;164697:7;164706:4;164679:13;:32::i;:::-;164672:39;164381:338;-1:-1:-1;;;;;164381:338:0:o;92103:684::-;-1:-1:-1;;;;;;;;;;;92191:30:0;;92294:149;92340:11;:9;:11::i;:::-;92366:6;92395:4;92422:9;92429:1;92427;92422:4;;:9;:::i;:::-;92415:17;;;:::i;:::-;92294:31;:149::i;:::-;92261:182;;;;92459:9;92454:326;;92489:9;;;;92485:284;;92519:27;;-1:-1:-1;;;;92519:27:0;-1:-1:-1;;;92519:27:0;;;92580:11;:9;:11::i;:::-;-1:-1:-1;;;;;92565:46:0;;92612:6;92620:4;;92565:60;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;92644:28:0;;-1:-1:-1;;;;92644:28:0;;;-1:-1:-1;92485:284:0;;-1:-1:-1;92485:284:0;;92720:33;;-1:-1:-1;;;92720:33:0;;-1:-1:-1;;;;;1743:32:1;;92720:33:0;;;1725:51:1;1698:18;;92720:33:0;1579:203:1;151078:102:0;151146:26;151156:2;151160:7;151146:26;;;;;;;;;;;;:9;:26::i;162537:273::-;162625:25;162693:30;;;-1:-1:-1;;;;;;;;;;;162693:30:0;;;;;;;;;:44;;;162753:49;;8634:25:1;;;8675:18;;;8668:34;;;162753:49:0;;159925:23;;162753:49;;;;;;;;162614:196;162537:273;;:::o;116457:319::-;116539:4;-1:-1:-1;;;;;116548:6:0;116531:23;;;:121;;;116646:6;-1:-1:-1;;;;;116610:42:0;:32;-1:-1:-1;;;;;;;;;;;107056:53:0;-1:-1:-1;;;;;107056:53:0;;106977:140;116610:32;-1:-1:-1;;;;;116610:42:0;;;116531:121;116513:256;;;116728:29;;-1:-1:-1;;;116728:29:0;;;;;;;;;;;116513:256;116457:319::o;164810:117::-;90545:39;10370:10;90559:12;10290:98;117950:548;118068:17;-1:-1:-1;;;;;118050:50:0;;:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;118050:52:0;;;;;;;;-1:-1:-1;;118050:52:0;;;;;;;;;;;;:::i;:::-;;;118046:445;;118419:60;;-1:-1:-1;;;118419:60:0;;-1:-1:-1;;;;;1743:32:1;;118419:60:0;;;1725:51:1;1698:18;;118419:60:0;1579:203:1;118046:445:0;-1:-1:-1;;;;;;;;;;;118145:40:0;;118141:122;;118213:34;;-1:-1:-1;;;118213:34:0;;;;;2986:25:1;;;2959:18;;118213:34:0;2840:177:1;118141:122:0;118277:54;118307:17;118326:4;118277:29;:54::i;116899:218::-;116974:4;-1:-1:-1;;;;;116983:6:0;116966:23;;116962:148;;117069:29;;-1:-1:-1;;;117069:29:0;;;;;;;;;;;91698:224;-1:-1:-1;;;;;;;;;;;91841:27:0;;-1:-1:-1;;;;;91841:27:0;;-1:-1:-1;;;;;;91841:27:0;;;;;;;91884:30;;;1725:51:1;;;91884:30:0;;;;;;1713:2:1;91884:30:0;;;91760:162;91698:224;:::o;156224:376::-;-1:-1:-1;;;;;;;;;;;;;;;;156388:22:0;;156384:93;;156434:31;;-1:-1:-1;;;156434:31:0;;-1:-1:-1;;;;;1743:32:1;;156434:31:0;;;1725:51:1;1698:18;;156434:31:0;1579:203:1;156384:93:0;-1:-1:-1;;;;;156487:27:0;;;;;;;:20;;;:27;;;;;;;;:37;;;;;;;;;;;;;:48;;-1:-1:-1;;156487:48:0;;;;;;;;;;156551:41;;540::1;;;156551::0;;513:18:1;156551:41:0;;;;;;;156317:283;156224:376;;;:::o;157640:799::-;-1:-1:-1;;;;;157757:14:0;;;:18;157753:679;;157796:71;;-1:-1:-1;;;157796:71:0;;-1:-1:-1;;;;;157796:36:0;;;;;:71;;10370:10;;157847:4;;157853:7;;157862:4;;157796:71;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;-1:-1:-1;157796:71:0;;;;;;;;-1:-1:-1;;157796:71:0;;;;;;;;;;;;:::i;:::-;;;157792:629;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;158110:6;:13;158127:1;158110:18;158106:300;;158160:25;;-1:-1:-1;;;158160:25:0;;-1:-1:-1;;;;;1743:32:1;;158160:25:0;;;1725:51:1;1698:18;;158160:25:0;1579:203:1;158106:300:0;158356:6;158350:13;158341:6;158337:2;158333:15;158326:38;157792:629;-1:-1:-1;;;;;;157915:51:0;;-1:-1:-1;;;157915:51:0;157911:132;;157998:25;;-1:-1:-1;;;157998:25:0;;-1:-1:-1;;;;;1743:32:1;;157998:25:0;;;1725:51:1;1698:18;;157998:25:0;1579:203:1;157911:132:0;157868:190;157640:799;;;;:::o;140816:151::-;7304:20;:18;:20::i;:::-;140920:39:::1;140944:5;140951:7;140920:23;:39::i;88623:149::-:0;7304:20;:18;:20::i;:::-;88716:48:::1;88747:16;88716:30;:48::i;114789:68::-:0;7304:20;:18;:20::i;160414:211::-;7304:20;:18;:20::i;:::-;159308:8:::1;160553:28:::0;:64;160414:211::o;160633:300::-;160685:13;160840:31;160857:13;160840:16;:31::i;:::-;160746:140;;;;;;;;:::i;:::-;;;;-1:-1:-1;;160746:140:0;;;;;;;;;;160718:207;;160746:140;160718:207;;:::i;:::-;;;;;;;;;;;;;160711:214;;160633:300;:::o;136601:718::-;136657:13;136708:14;136725:17;136736:5;136725:10;:17::i;:::-;136745:1;136725:21;136708:38;;136761:20;136795:6;136784:18;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;136784:18:0;-1:-1:-1;136761:41:0;-1:-1:-1;136926:28:0;;;136942:2;136926:28;136983:290;-1:-1:-1;;137015:5:0;-1:-1:-1;;;137152:2:0;137141:14;;137136:32;137015:5;137123:46;137215:2;137206:11;;;-1:-1:-1;137236:21:0;136983:290;137236:21;-1:-1:-1;137294:6:0;136601:718;-1:-1:-1;;;136601:718:0:o;145784:175::-;145850:7;145933:18;;;:9;:18;;;;;;-1:-1:-1;;;;;145933:18:0;;145784:175::o;155269:736::-;-1:-1:-1;;;;;;;;;;;155487:9:0;;:31;;-1:-1:-1;;;;;;155500:18:0;;;;155487:31;155483:471;;;155535:13;155551:22;155565:7;155551:13;:22::i;:::-;155535:38;-1:-1:-1;;;;;;155704:18:0;;;;;;:35;;;155735:4;-1:-1:-1;;;;;155726:13:0;:5;-1:-1:-1;;;;;155726:13:0;;;155704:35;:69;;;;;155744:29;155761:5;155768:4;155744:16;:29::i;:::-;155743:30;155704:69;155700:144;;;155801:27;;-1:-1:-1;;;155801:27:0;;-1:-1:-1;;;;;1743:32:1;;155801:27:0;;;1725:51:1;1698:18;;155801:27:0;1579:203:1;155700:144:0;155864:9;155860:83;;;155919:7;155915:2;-1:-1:-1;;;;;155899:28:0;155908:5;-1:-1:-1;;;;;155899:28:0;;;;;;;;;;;155860:83;155520:434;155483:471;155966:26;;;;:17;;:26;;-1:-1:-1;;155966:26:0;;;:31;;-1:-1:-1;;;;;;155966:31:0;-1:-1:-1;;;;;155966:31:0;;;;;;;;;;155269:736::o;149158:886::-;149244:7;-1:-1:-1;;;;;;;;;;;149244:7:0;149335:17;149344:7;149335:8;:17::i;:::-;149320:32;-1:-1:-1;;;;;;149415:18:0;;;149411:88;;149450:37;149467:4;149473;149479:7;149450:16;:37::i;:::-;-1:-1:-1;;;;;149546:18:0;;;149542:265;;149664:48;149681:1;149685:7;149702:1;149706:5;149664:8;:48::i;:::-;-1:-1:-1;;;;;149758:17:0;;;;;;:11;;;:17;;;;;:22;;-1:-1:-1;;149758:22:0;;;149542:265;-1:-1:-1;;;;;149823:16:0;;;149819:113;;-1:-1:-1;;;;;149885:15:0;;;;;;:11;;;:15;;;;;:20;;149904:1;149885:20;;;149819:113;149944:18;;;;:9;;;:18;;;;;;:23;;-1:-1:-1;;;;;;149944:23:0;-1:-1:-1;;;;;149944:23:0;;;;;;;;;149985:27;;149944:18;;149985:27;;;;;;;150032:4;149158:886;-1:-1:-1;;;;;149158:886:0:o;11853:653::-;12125:62;;-1:-1:-1;;;;;12131:32:1;;;12125:62:0;;;12113:51:1;12200:32;;;12180:18;;;12173:60;-1:-1:-1;;;;;;12269:33:1;;12249:18;;;12242:61;12013:14:0;;;;;;;;12090:20;;;12086:18:1;;12125:62:0;;;-1:-1:-1;;12125:62:0;;;;;;;;;;;;;;-1:-1:-1;;;;;12125:62:0;-1:-1:-1;;;12125:62:0;;;12090:108;;;12125:62;12090:108;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12054:144;;;;12213:7;12209:254;;;12256:4;12241;:11;:19;12237:215;;12313:4;12302:32;;;;;;;;;;;;:::i;:::-;12281:53;;-1:-1:-1;12281:53:0;-1:-1:-1;12237:215:0;;;12375:4;12360;:11;:19;12356:96;;12423:4;12412:24;;;;;;;;;;;;:::i;:::-;12400:36;;12356:96;12473:25;;11853:653;;;;;;;:::o;151407:185::-;151502:18;151508:2;151512:7;151502:5;:18::i;:::-;151531:53;151562:1;151566:2;151570:7;151579:4;151531:22;:53::i;107820:344::-;107912:37;107931:17;107912:18;:37::i;:::-;107965:27;;-1:-1:-1;;;;;107965:27:0;;;;;;;;108009:11;;:15;108005:152;;108041:53;108070:17;108089:4;108041:28;:53::i;108005:152::-;108127:18;:16;:18::i;7464:145::-;9297:21;8978:40;-1:-1:-1;;;8978:40:0;;;;7527:75;;7573:17;;-1:-1:-1;;;7573:17:0;;;;;;;;;;;140975:223;7304:20;:18;:20::i;:::-;-1:-1:-1;;;;;;;;;;;140653:21:0;141145:15:::1;141155:5:::0;140653:21;141145:15:::1;:::i;:::-;-1:-1:-1::0;141171:9:0::1;::::0;::::1;:19;141183:7:::0;141171:9;:19:::1;:::i;88780:142::-:0;7304:20;:18;:20::i;:::-;88883:31:::1;88897:16;88883:13;:31::i;26370:948::-:0;26423:7;;-1:-1:-1;;;26501:17:0;;26497:106;;-1:-1:-1;;;26539:17:0;;;-1:-1:-1;26585:2:0;26575:12;26497:106;26630:8;26621:5;:17;26617:106;;26668:8;26659:17;;;-1:-1:-1;26705:2:0;26695:12;26617:106;26750:8;26741:5;:17;26737:106;;26788:8;26779:17;;;-1:-1:-1;26825:2:0;26815:12;26737:106;26870:7;26861:5;:16;26857:103;;26907:7;26898:16;;;-1:-1:-1;26943:1:0;26933:11;26857:103;26987:7;26978:5;:16;26974:103;;27024:7;27015:16;;;-1:-1:-1;27060:1:0;27050:11;26974:103;27104:7;27095:5;:16;27091:103;;27141:7;27132:16;;;-1:-1:-1;27177:1:0;27167:11;27091:103;27221:7;27212:5;:16;27208:68;;27259:1;27249:11;27304:6;26370:948;-1:-1:-1;;26370:948:0:o;147307:376::-;147420:38;147434:5;147441:7;147450;147420:13;:38::i;:::-;147415:261;;-1:-1:-1;;;;;147479:19:0;;147475:190;;147526:31;;-1:-1:-1;;;147526:31:0;;;;;2986:25:1;;;2959:18;;147526:31:0;2840:177:1;147475:190:0;147605:44;;-1:-1:-1;;;147605:44:0;;-1:-1:-1;;;;;15587:32:1;;147605:44:0;;;15569:51:1;15636:18;;;15629:34;;;15542:18;;147605:44:0;15395:274:1;150380:335:0;-1:-1:-1;;;;;150448:16:0;;150444:89;;150488:33;;-1:-1:-1;;;150488:33:0;;150518:1;150488:33;;;1725:51:1;1698:18;;150488:33:0;1579:203:1;150444:89:0;150543:21;150567:32;150575:2;150579:7;150596:1;150567:7;:32::i;:::-;150543:56;-1:-1:-1;;;;;;150614:27:0;;;150610:98;;150665:31;;-1:-1:-1;;;150665:31:0;;150693:1;150665:31;;;1725:51:1;1698:18;;150665:31:0;1579:203:1;107213:286:0;107291:17;-1:-1:-1;;;;;107291:29:0;;107324:1;107291:34;107287:121;;107349:47;;-1:-1:-1;;;107349:47:0;;-1:-1:-1;;;;;1743:32:1;;107349:47:0;;;1725:51:1;1698:18;;107349:47:0;1579:203:1;107287:121:0;-1:-1:-1;;;;;;;;;;;107418:73:0;;-1:-1:-1;;;;;;107418:73:0;-1:-1:-1;;;;;107418:73:0;;;;;;;;;;107213:286::o;98654:256::-;98737:12;98763;98777:23;98804:6;-1:-1:-1;;;;;98804:19:0;98824:4;98804:25;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;98762:67;;;;98847:55;98874:6;98882:7;98891:10;98847:26;:55::i;111744:126::-;111795:9;:13;111791:72;;111832:19;;-1:-1:-1;;;111832:19:0;;;;;;;;;;;146587:276;146690:4;-1:-1:-1;;;;;146727:21:0;;;;;;:128;;;146775:7;-1:-1:-1;;;;;146766:16:0;:5;-1:-1:-1;;;;;146766:16:0;;:52;;;;146786:32;146803:5;146810:7;146786:16;:32::i;:::-;146766:88;;;;146847:7;-1:-1:-1;;;;;146822:32:0;:21;146835:7;146822:12;:21::i;:::-;-1:-1:-1;;;;;146822:32:0;;146766:88;146707:148;146587:276;-1:-1:-1;;;;146587:276:0:o;99183:597::-;99331:12;99361:7;99356:417;;99385:19;99393:10;99385:7;:19::i;:::-;99356:417;;;99613:17;;:22;:49;;;;-1:-1:-1;;;;;;99639:18:0;;;:23;99613:49;99609:121;;;99690:24;;-1:-1:-1;;;99690:24:0;;-1:-1:-1;;;;;1743:32:1;;99690:24:0;;;1725:51:1;1698:18;;99690:24:0;1579:203:1;99609:121:0;-1:-1:-1;99751:10:0;99744:17;;100333:528;100466:17;;:21;100462:392;;100698:10;100692:17;100755:15;100742:10;100738:2;100734:19;100727:44;100462:392;100825:17;;-1:-1:-1;;;100825:17:0;;;;;;;;;;;14:131:1;-1:-1:-1;;;;;;88:32:1;;78:43;;68:71;;135:1;132;125:12;150:245;208:6;261:2;249:9;240:7;236:23;232:32;229:52;;;277:1;274;267:12;229:52;316:9;303:23;335:30;359:5;335:30;:::i;592:250::-;677:1;687:113;701:6;698:1;695:13;687:113;;;777:11;;;771:18;758:11;;;751:39;723:2;716:10;687:113;;;-1:-1:-1;;834:1:1;816:16;;809:27;592:250::o;847:271::-;889:3;927:5;921:12;954:6;949:3;942:19;970:76;1039:6;1032:4;1027:3;1023:14;1016:4;1009:5;1005:16;970:76;:::i;:::-;1100:2;1079:15;-1:-1:-1;;1075:29:1;1066:39;;;;1107:4;1062:50;;847:271;-1:-1:-1;;847:271:1:o;1123:220::-;1272:2;1261:9;1254:21;1235:4;1292:45;1333:2;1322:9;1318:18;1310:6;1292:45;:::i;1348:226::-;1407:6;1460:2;1448:9;1439:7;1435:23;1431:32;1428:52;;;1476:1;1473;1466:12;1428:52;-1:-1:-1;1521:23:1;;1348:226;-1:-1:-1;1348:226:1:o;1787:173::-;1855:20;;-1:-1:-1;;;;;1904:31:1;;1894:42;;1884:70;;1950:1;1947;1940:12;1884:70;1787:173;;;:::o;1965:300::-;2033:6;2041;2094:2;2082:9;2073:7;2069:23;2065:32;2062:52;;;2110:1;2107;2100:12;2062:52;2133:29;2152:9;2133:29;:::i;:::-;2123:39;2231:2;2216:18;;;;2203:32;;-1:-1:-1;;;1965:300:1:o;2270:374::-;2347:6;2355;2363;2416:2;2404:9;2395:7;2391:23;2387:32;2384:52;;;2432:1;2429;2422:12;2384:52;2455:29;2474:9;2455:29;:::i;:::-;2445:39;;2503:38;2537:2;2526:9;2522:18;2503:38;:::i;:::-;2270:374;;2493:48;;-1:-1:-1;;;2610:2:1;2595:18;;;;2582:32;;2270:374::o;2649:186::-;2708:6;2761:2;2749:9;2740:7;2736:23;2732:32;2729:52;;;2777:1;2774;2767:12;2729:52;2800:29;2819:9;2800:29;:::i;3022:127::-;3083:10;3078:3;3074:20;3071:1;3064:31;3114:4;3111:1;3104:15;3138:4;3135:1;3128:15;3154:725;3196:5;3249:3;3242:4;3234:6;3230:17;3226:27;3216:55;;3267:1;3264;3257:12;3216:55;3307:6;3294:20;3337:18;3329:6;3326:30;3323:56;;;3359:18;;:::i;:::-;3408:2;3402:9;3500:2;3462:17;;-1:-1:-1;;3458:31:1;;;3491:2;3454:40;3450:54;3438:67;;3535:18;3520:34;;3556:22;;;3517:62;3514:88;;;3582:18;;:::i;:::-;3618:2;3611:22;3642;;;3683:19;;;3704:4;3679:30;3676:39;-1:-1:-1;3673:59:1;;;3728:1;3725;3718:12;3673:59;3792:6;3785:4;3777:6;3773:17;3766:4;3758:6;3754:17;3741:58;3847:1;3819:19;;;3840:4;3815:30;3808:41;;;;3823:6;3154:725;-1:-1:-1;;;3154:725:1:o;3884:394::-;3961:6;3969;4022:2;4010:9;4001:7;3997:23;3993:32;3990:52;;;4038:1;4035;4028:12;3990:52;4061:29;4080:9;4061:29;:::i;:::-;4051:39;;4141:2;4130:9;4126:18;4113:32;4168:18;4160:6;4157:30;4154:50;;;4200:1;4197;4190:12;4154:50;4223:49;4264:7;4255:6;4244:9;4240:22;4223:49;:::i;:::-;4213:59;;;3884:394;;;;;:::o;4935:118::-;5021:5;5014:13;5007:21;5000:5;4997:32;4987:60;;5043:1;5040;5033:12;5058:315;5123:6;5131;5184:2;5172:9;5163:7;5159:23;5155:32;5152:52;;;5200:1;5197;5190:12;5152:52;5223:29;5242:9;5223:29;:::i;:::-;5213:39;;5302:2;5291:9;5287:18;5274:32;5315:28;5337:5;5315:28;:::i;:::-;5362:5;5352:15;;;5058:315;;;;;:::o;5378:583::-;5473:6;5481;5489;5497;5550:3;5538:9;5529:7;5525:23;5521:33;5518:53;;;5567:1;5564;5557:12;5518:53;5590:29;5609:9;5590:29;:::i;:::-;5580:39;;5638:38;5672:2;5661:9;5657:18;5638:38;:::i;:::-;5628:48;-1:-1:-1;5745:2:1;5730:18;;5717:32;;-1:-1:-1;5824:2:1;5809:18;;5796:32;5851:18;5840:30;;5837:50;;;5883:1;5880;5873:12;5837:50;5906:49;5947:7;5938:6;5927:9;5923:22;5906:49;:::i;:::-;5896:59;;;5378:583;;;;;;;:::o;5966:346::-;6034:6;6042;6095:2;6083:9;6074:7;6070:23;6066:32;6063:52;;;6111:1;6108;6101:12;6063:52;-1:-1:-1;;6156:23:1;;;6276:2;6261:18;;;6248:32;;-1:-1:-1;5966:346:1:o;6317:260::-;6385:6;6393;6446:2;6434:9;6425:7;6421:23;6417:32;6414:52;;;6462:1;6459;6452:12;6414:52;6485:29;6504:9;6485:29;:::i;:::-;6475:39;;6533:38;6567:2;6556:9;6552:18;6533:38;:::i;:::-;6523:48;;6317:260;;;;;:::o;6582:380::-;6661:1;6657:12;;;;6704;;;6725:61;;6779:4;6771:6;6767:17;6757:27;;6725:61;6832:2;6824:6;6821:14;6801:18;6798:38;6795:161;;6878:10;6873:3;6869:20;6866:1;6859:31;6913:4;6910:1;6903:15;6941:4;6938:1;6931:15;6795:161;;6582:380;;;:::o;7343:127::-;7404:10;7399:3;7395:20;7392:1;7385:31;7435:4;7432:1;7425:15;7459:4;7456:1;7449:15;7475:135;7514:3;7535:17;;;7532:43;;7555:18;;:::i;:::-;-1:-1:-1;7602:1:1;7591:13;;7475:135::o;7615:125::-;7680:9;;;7701:10;;;7698:36;;;7714:18;;:::i;7959:496::-;8138:3;8176:6;8170:13;8192:66;8251:6;8246:3;8239:4;8231:6;8227:17;8192:66;:::i;:::-;8321:13;;8280:16;;;;8343:70;8321:13;8280:16;8390:4;8378:17;;8343:70;:::i;:::-;8429:20;;7959:496;-1:-1:-1;;;;7959:496:1:o;8713:331::-;8818:9;8829;8871:8;8859:10;8856:24;8853:44;;;8893:1;8890;8883:12;8853:44;8922:6;8912:8;8909:20;8906:40;;;8942:1;8939;8932:12;8906:40;-1:-1:-1;;8968:23:1;;;9013:25;;;;;-1:-1:-1;8713:331:1:o;9049:338::-;9169:19;;-1:-1:-1;;;;;;9206:29:1;;;9255:1;9247:10;;9244:137;;;-1:-1:-1;;;;;;9316:1:1;9312:11;;;9309:1;9305:19;9301:46;;;9293:55;;9289:82;;-1:-1:-1;9244:137:1;;9049:338;;;;:::o;9392:485::-;-1:-1:-1;;;;;9577:32:1;;9559:51;;9646:2;9641;9626:18;;9619:30;;;9665:18;;9658:34;;;9685:6;9734;9729:2;9714:18;;9701:48;9798:1;9769:22;;;9793:2;9765:31;;;9758:42;;;;9861:2;9840:15;;;-1:-1:-1;;9836:29:1;9821:45;9817:54;;9392:485;-1:-1:-1;;9392:485:1:o;9882:184::-;9952:6;10005:2;9993:9;9984:7;9980:23;9976:32;9973:52;;;10021:1;10018;10011:12;9973:52;-1:-1:-1;10044:16:1;;9882:184;-1:-1:-1;9882:184:1:o;10071:485::-;-1:-1:-1;;;;;10302:32:1;;;10284:51;;10371:32;;10366:2;10351:18;;10344:60;10435:2;10420:18;;10413:34;;;10483:3;10478:2;10463:18;;10456:31;;;-1:-1:-1;;10504:46:1;;10530:19;;10522:6;10504:46;:::i;:::-;10496:54;10071:485;-1:-1:-1;;;;;;10071:485:1:o;10561:249::-;10630:6;10683:2;10671:9;10662:7;10658:23;10654:32;10651:52;;;10699:1;10696;10689:12;10651:52;10731:9;10725:16;10750:30;10774:5;10750:30;:::i;10815:504::-;11077:34;11072:3;11065:47;-1:-1:-1;;;11137:2:1;11132:3;11128:12;11121:33;11047:3;11183:6;11177:13;11199:73;11265:6;11260:2;11255:3;11251:12;11246:2;11238:6;11234:15;11199:73;:::i;:::-;11292:16;;;;11310:2;11288:25;;10815:504;-1:-1:-1;;10815:504:1:o;11324:452::-;11546:3;11584:6;11578:13;11600:66;11659:6;11654:3;11647:4;11639:6;11635:17;11600:66;:::i;:::-;-1:-1:-1;;;11688:16:1;;11713:27;;;-1:-1:-1;11767:2:1;11756:14;;11324:452;-1:-1:-1;11324:452:1:o;12314:287::-;12443:3;12481:6;12475:13;12497:66;12556:6;12551:3;12544:4;12536:6;12532:17;12497:66;:::i;:::-;12579:16;;;;;12314:287;-1:-1:-1;;12314:287:1:o;12606:410::-;12681:6;12689;12742:2;12730:9;12721:7;12717:23;12713:32;12710:52;;;12758:1;12755;12748:12;12710:52;12790:9;12784:16;12809:28;12831:5;12809:28;:::i;:::-;12906:2;12891:18;;12885:25;12856:5;;-1:-1:-1;12954:10:1;12941:24;;12929:37;;12919:65;;12980:1;12977;12970:12;13021:245;13088:6;13141:2;13129:9;13120:7;13116:23;13112:32;13109:52;;;13157:1;13154;13147:12;13109:52;13189:9;13183:16;13208:28;13230:5;13208:28;:::i;13397:518::-;13499:2;13494:3;13491:11;13488:421;;;13535:5;13532:1;13525:16;13579:4;13576:1;13566:18;13649:2;13637:10;13633:19;13630:1;13626:27;13620:4;13616:38;13685:4;13673:10;13670:20;13667:47;;;-1:-1:-1;13708:4:1;13667:47;13763:2;13758:3;13754:12;13751:1;13747:20;13741:4;13737:31;13727:41;;13818:81;13836:2;13829:5;13826:13;13818:81;;;13895:1;13881:16;;13862:1;13851:13;13818:81;;14091:1299;14217:3;14211:10;14244:18;14236:6;14233:30;14230:56;;;14266:18;;:::i;:::-;14295:97;14385:6;14345:38;14377:4;14371:11;14345:38;:::i;:::-;14339:4;14295:97;:::i;:::-;14441:4;14472:2;14461:14;;14489:1;14484:649;;;;15177:1;15194:6;15191:89;;;-1:-1:-1;15246:19:1;;;15240:26;15191:89;-1:-1:-1;;14048:1:1;14044:11;;;14040:24;14036:29;14026:40;14072:1;14068:11;;;14023:57;15293:81;;14454:930;;14484:649;13344:1;13337:14;;;13381:4;13368:18;;-1:-1:-1;;14520:20:1;;;14638:222;14652:7;14649:1;14646:14;14638:222;;;14734:19;;;14728:26;14713:42;;14841:4;14826:20;;;;14794:1;14782:14;;;;14668:12;14638:222;;;14642:3;14888:6;14879:7;14876:19;14873:201;;;14949:19;;;14943:26;-1:-1:-1;;15032:1:1;15028:14;;;15044:3;15024:24;15020:37;15016:42;15001:58;14986:74;;14873:201;-1:-1:-1;;;;15120:1:1;15104:14;;;15100:22;15087:36;;-1:-1:-1;14091:1299:1:o
Swarm Source
ipfs://c439b15f46095d74713341093c95ea21a239ede1fb58aabe286deafaba651ff6
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.