Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60a06040 | 17264619 | 510 days ago | IN | 0 ETH | 0.06087216 |
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 Name:
UpgradeableCoreUSD
Compiler Version
v0.8.18+commit.87f61d96
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2023-05-15 */ // File: @openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @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 IERC165Upgradeable { /** * @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/math/MathUpgradeable.sol // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library MathUpgradeable { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @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 up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (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; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 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. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); 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 (rounding == Rounding.Up && 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 down. * * 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 + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * 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 10, 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 + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } } // File: @openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = MathUpgradeable.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), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, MathUpgradeable.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) { 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] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); 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); } } // File: @openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; } // File: @openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol // OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol) pragma solidity ^0.8.0; /** * @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: * ``` * 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(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlotUpgradeable { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 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 } } } // File: @openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @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://diligence.consensys.net/posts/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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @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, it is bubbled up by this * function (like regular Solidity function calls). * * 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. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @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`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) 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(errorMessage); } } } // File: @openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol // OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; /** * @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] * ``` * 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 Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 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 functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _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 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _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() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @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 { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } } // File: @openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; /** * @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); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; } // File: @openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @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; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; } // File: @openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; } // File: @openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol // OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol) pragma solidity ^0.8.0; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", StringsUpgradeable.toHexString(account), " is missing role ", StringsUpgradeable.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; } // File: @openzeppelin/contracts-upgradeable/interfaces/IERC1967Upgradeable.sol // OpenZeppelin Contracts (last updated v4.8.3) (interfaces/IERC1967.sol) pragma solidity ^0.8.0; /** * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC. * * _Available since v4.9._ */ interface IERC1967Upgradeable { /** * @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); } // File: @openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeaconUpgradeable { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); } // File: @openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.0; /** * @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 IERC1822ProxiableUpgradeable { /** * @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-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol // OpenZeppelin Contracts (last updated v4.8.3) (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ * * @custom:oz-upgrades-unsafe-allow delegatecall */ abstract contract ERC1967UpgradeUpgradeable is Initializable, IERC1967Upgradeable { function __ERC1967Upgrade_init() internal onlyInitializing { } function __ERC1967Upgrade_init_unchained() internal onlyInitializing { } // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall( address newImplementation, bytes memory data, bool forceCall ) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { _functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallUUPS( address newImplementation, bytes memory data, bool forceCall ) internal { // Upgrades from old implementations will perform a rollback test. This test requires the new // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing // this special case will break upgrade paths from old UUPS implementation to new ones. if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else { try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) { require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID"); } catch { revert("ERC1967Upgrade: new implementation is not UUPS"); } _upgradeToAndCall(newImplementation, data, forceCall); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {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 bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall( address newBeacon, bytes memory data, bool forceCall ) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data); } } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) { require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed"); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; } // File: @openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol // OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.0; /** * @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. * * _Available since v4.1._ */ abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable { function __UUPSUpgradeable_init() internal onlyInitializing { } function __UUPSUpgradeable_init_unchained() internal onlyInitializing { } /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address private immutable __self = address(this); /** * @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() { require(address(this) != __self, "Function must be called through delegatecall"); require(_getImplementation() == __self, "Function must be called through active proxy"); _; } /** * @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() { require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall"); _; } /** * @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 override notDelegated returns (bytes32) { return _IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeTo(address newImplementation) external virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, new bytes(0), false); } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, data, true); } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeTo} and {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal override onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; } // File: @openzeppelin/contracts/utils/Context.sol // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // File: @openzeppelin/contracts/access/Ownable.sol // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } // File: @openzeppelin/contracts/utils/math/Math.sol // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @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 up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (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; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 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. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); 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 (rounding == Rounding.Up && 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 down. * * 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 + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * 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 10, 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 + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } } // File: @openzeppelin/contracts/utils/Strings.sol // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @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), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @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) { 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] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); 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); } } // File: @openzeppelin/contracts/utils/cryptography/ECDSA.sol // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } } // File: @openzeppelin/contracts/token/ERC20/IERC20.sol // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); } // File: brawler/contracts/greengame/exchanges/upgradeable/WithdrawableCore.sol pragma solidity ^0.8.0; abstract contract WithdrawableCore is Initializable,AccessControlUpgradeable { using ECDSA for bytes32; bytes32 public constant WITHDRAW_ROLE = keccak256("WITHDRAW_ROLE"); address _withdrawAddress; address public tokenAddress; event TokenOut(address indexed owner, uint256 amount, string data); function _emitWithdrawEvent(address address_, uint256 amount_, string memory data_) internal virtual{ emit TokenOut(address_, amount_, data_); } function __WithdrawableCore_init() internal onlyInitializing { } function withdrawBalance() external onlyRole(WITHDRAW_ROLE) { address receiver = msg.sender; if(_withdrawAddress != address(0)) receiver = _withdrawAddress; uint256 _amount = getBalance(); require(IERC20(tokenAddress).transfer(receiver, _amount)); _emitWithdrawEvent(receiver,_amount,"admin"); } function getBalance() public view returns (uint256) { return IERC20(tokenAddress).balanceOf(address(this)); } function setWithdrawAddress(address wdAddress_) external onlyRole(DEFAULT_ADMIN_ROLE) { _withdrawAddress = wdAddress_; } function getWithdrawAddress() external view onlyRole(DEFAULT_ADMIN_ROLE) returns(address) { return _withdrawAddress; } } // File: brawler/contracts/greengame/exchanges/upgradeable/UpgradeableCore.sol pragma solidity ^0.8.0; abstract contract UpgradeableCore is Initializable,AccessControlUpgradeable, UUPSUpgradeable,PausableUpgradeable, WithdrawableCore { using ECDSA for bytes32; string _network; function __UpgradeableCore_init(address token_, string memory network_) internal onlyInitializing { __AccessControl_init(); __WithdrawableCore_init(); _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setRoleAdmin(DEFAULT_ADMIN_ROLE , DEFAULT_ADMIN_ROLE); _setupRole(WITHDRAW_ROLE, _msgSender()); _setRoleAdmin(WITHDRAW_ROLE , DEFAULT_ADMIN_ROLE); tokenAddress = token_; _network = network_; } function _authorizeUpgrade(address) internal override onlyRole(DEFAULT_ADMIN_ROLE) {} function _emitUseTokenEvent(address address_, uint256 amount_, string memory data_) internal virtual{ } function useToken( uint256 amount_, string memory data_) public whenNotPaused { require( IERC20(tokenAddress).transferFrom(_msgSender(), address(this), amount_) ); _emitUseTokenEvent(_msgSender(), amount_, data_); } function pause() public onlyRole(DEFAULT_ADMIN_ROLE) whenNotPaused { _pause(); } function unpause() public onlyRole(DEFAULT_ADMIN_ROLE) whenPaused { _unpause(); } } // File: brawler/contracts/greengame/exchanges/upgradeable/UpgradeableCoreUSD.sol pragma solidity ^0.8.0; contract UpgradeableCoreUSD is UpgradeableCore { using ECDSA for bytes32; event UseUSD(address indexed owner, uint256 amount, string data); function initialize(address tokenAddress_, string memory network_) initializer public { __UpgradeableCoreBUSD_init( tokenAddress_, network_); } function __UpgradeableCoreBUSD_init(address tokenAddress_, string memory network_) internal onlyInitializing { __UpgradeableCore_init(tokenAddress_, network_); } function _emitUseTokenEvent(address address_, uint256 amount_, string memory data_) internal override{ emit UseUSD(address_, amount_, data_); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"data","type":"string"}],"name":"TokenOut","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"data","type":"string"}],"name":"UseUSD","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWithdrawAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress_","type":"address"},{"internalType":"string","name":"network_","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"wdAddress_","type":"address"}],"name":"setWithdrawAddress","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":"tokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","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"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"string","name":"data_","type":"string"}],"name":"useToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawBalance","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040523060805234801561001457600080fd5b50608051611b4861004c6000396000818161051e0152818161055e015281816106470152818161068701526107160152611b486000f3fe60806040526004361061012a5760003560e01c80635c975abb116100ab578063a217fddf1161006f578063a217fddf14610311578063be59b6be14610326578063d547741f14610346578063e02023a114610366578063e8e7f80014610388578063f399e22e1461039d57600080fd5b80635c975abb146102765780635fd8c7101461028e5780638456cb59146102a357806391d14854146102b85780639d76ea58146102d857600080fd5b80633659cfe6116100f25780633659cfe6146101f95780633ab1a494146102195780633f4ba83a146102395780634f1ef2861461024e57806352d1902d1461026157600080fd5b806301ffc9a71461012f57806312065fe014610164578063248a9ca3146101875780632f2ff15d146101b757806336568abe146101d9575b600080fd5b34801561013b57600080fd5b5061014f61014a36600461149a565b6103bd565b60405190151581526020015b60405180910390f35b34801561017057600080fd5b506101796103f4565b60405190815260200161015b565b34801561019357600080fd5b506101796101a23660046114c4565b60009081526097602052604090206001015490565b3480156101c357600080fd5b506101d76101d23660046114f9565b610467565b005b3480156101e557600080fd5b506101d76101f43660046114f9565b610491565b34801561020557600080fd5b506101d7610214366004611525565b610514565b34801561022557600080fd5b506101d7610234366004611525565b6105f3565b34801561024557600080fd5b506101d7610622565b6101d761025c3660046115cc565b61063d565b34801561026d57600080fd5b50610179610709565b34801561028257600080fd5b5060fb5460ff1661014f565b34801561029a57600080fd5b506101d76107bc565b3480156102af57600080fd5b506101d76108ac565b3480156102c457600080fd5b5061014f6102d33660046114f9565b6108c7565b3480156102e457600080fd5b5061012e546102f9906001600160a01b031681565b6040516001600160a01b03909116815260200161015b565b34801561031d57600080fd5b50610179600081565b34801561033257600080fd5b506101d761034136600461164e565b6108f2565b34801561035257600080fd5b506101d76103613660046114f9565b610998565b34801561037257600080fd5b50610179600080516020611aac83398151915281565b34801561039457600080fd5b506102f96109bd565b3480156103a957600080fd5b506101d76103b836600461168b565b6109db565b60006001600160e01b03198216637965db0b60e01b14806103ee57506301ffc9a760e01b6001600160e01b03198316145b92915050565b61012e546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa15801561043e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046291906116c3565b905090565b60008281526097602052604090206001015461048281610aef565b61048c8383610af9565b505050565b6001600160a01b03811633146105065760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6105108282610b7f565b5050565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016300361055c5760405162461bcd60e51b81526004016104fd906116dc565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166105a5600080516020611acc833981519152546001600160a01b031690565b6001600160a01b0316146105cb5760405162461bcd60e51b81526004016104fd90611728565b6105d481610be6565b604080516000808252602082019092526105f091839190610bf1565b50565b60006105fe81610aef565b5061012d80546001600160a01b0319166001600160a01b0392909216919091179055565b600061062d81610aef565b610635610d5c565b6105f0610da7565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036106855760405162461bcd60e51b81526004016104fd906116dc565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166106ce600080516020611acc833981519152546001600160a01b031690565b6001600160a01b0316146106f45760405162461bcd60e51b81526004016104fd90611728565b6106fd82610be6565b61051082826001610bf1565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146107a95760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016104fd565b50600080516020611acc83398151915290565b600080516020611aac8339815191526107d481610aef565b61012d5433906001600160a01b0316156107f7575061012d546001600160a01b03165b60006108016103f4565b61012e5460405163a9059cbb60e01b81526001600160a01b0385811660048301526024820184905292935091169063a9059cbb906044016020604051808303816000875af1158015610857573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087b9190611774565b61088457600080fd5b61048c82826040518060400160405280600581526020016430b236b4b760d91b815250610df9565b60006108b781610aef565b6108bf610e41565b6105f0610e87565b60009182526097602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6108fa610e41565b61012e546001600160a01b03166323b872dd336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604481018590526064016020604051808303816000875af1158015610960573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109849190611774565b61098d57600080fd5b610510338383610ec4565b6000828152609760205260409020600101546109b381610aef565b61048c8383610b7f565b6000806109c981610aef565b505061012d546001600160a01b031690565b600054610100900460ff16158080156109fb5750600054600160ff909116105b80610a155750303b158015610a15575060005460ff166001145b610a785760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104fd565b6000805460ff191660011790558015610a9b576000805461ff0019166101001790555b610aa58383610eff565b801561048c576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6105f08133610f30565b610b0382826108c7565b6105105760008281526097602090815260408083206001600160a01b03851684529091529020805460ff19166001179055610b3b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610b8982826108c7565b156105105760008281526097602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061051081610aef565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615610c245761048c83610f89565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610c7e575060408051601f3d908101601f19168201909252610c7b918101906116c3565b60015b610ce15760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016104fd565b600080516020611acc8339815191528114610d505760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016104fd565b5061048c838383611025565b60fb5460ff16610da55760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016104fd565b565b610daf610d5c565b60fb805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b826001600160a01b03167f8d975448f7a9270f7445b90f4ee4085908f79f5cc4c96059e14ecaa7a85059338383604051610e349291906117e6565b60405180910390a2505050565b60fb5460ff1615610da55760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016104fd565b610e8f610e41565b60fb805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610ddc3390565b826001600160a01b03167f4db1adde7e87852be0791b143349bbdecc127523684ba1414380879e86565af58383604051610e349291906117e6565b600054610100900460ff16610f265760405162461bcd60e51b81526004016104fd90611807565b6105108282611050565b610f3a82826108c7565b61051057610f47816110f7565b610f52836020611109565b604051602001610f63929190611852565b60408051601f198184030181529082905262461bcd60e51b82526104fd916004016118c7565b6001600160a01b0381163b610ff65760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016104fd565b600080516020611acc83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b61102e836112ac565b60008251118061103b5750805b1561048c5761104a83836112ec565b50505050565b600054610100900460ff166110775760405162461bcd60e51b81526004016104fd90611807565b61107f6113e0565b6110876113e0565b611092600033611407565b61109d600080611411565b6110b5600080516020611aac83398151915233611407565b6110ce600080516020611aac8339815191526000611411565b61012e80546001600160a01b0319166001600160a01b03841617905561012f61048c8282611962565b60606103ee6001600160a01b03831660145b60606000611118836002611a38565b611123906002611a4f565b67ffffffffffffffff81111561113b5761113b611540565b6040519080825280601f01601f191660200182016040528015611165576020820181803683370190505b509050600360fc1b8160008151811061118057611180611a62565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106111af576111af611a62565b60200101906001600160f81b031916908160001a90535060006111d3846002611a38565b6111de906001611a4f565b90505b6001811115611256576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061121257611212611a62565b1a60f81b82828151811061122857611228611a62565b60200101906001600160f81b031916908160001a90535060049490941c9361124f81611a78565b90506111e1565b5083156112a55760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016104fd565b9392505050565b6112b581610f89565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6113545760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016104fd565b600080846001600160a01b03168460405161136f9190611a8f565b600060405180830381855af49150503d80600081146113aa576040519150601f19603f3d011682016040523d82523d6000602084013e6113af565b606091505b50915091506113d78282604051806060016040528060278152602001611aec6027913961145c565b95945050505050565b600054610100900460ff16610da55760405162461bcd60e51b81526004016104fd90611807565b6105108282610af9565b600082815260976020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6060831561146b5750816112a5565b6112a583838151156114805781518083602001fd5b8060405162461bcd60e51b81526004016104fd91906118c7565b6000602082840312156114ac57600080fd5b81356001600160e01b0319811681146112a557600080fd5b6000602082840312156114d657600080fd5b5035919050565b80356001600160a01b03811681146114f457600080fd5b919050565b6000806040838503121561150c57600080fd5b8235915061151c602084016114dd565b90509250929050565b60006020828403121561153757600080fd5b6112a5826114dd565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff8084111561157157611571611540565b604051601f8501601f19908116603f0116810190828211818310171561159957611599611540565b816040528093508581528686860111156115b257600080fd5b858560208301376000602087830101525050509392505050565b600080604083850312156115df57600080fd5b6115e8836114dd565b9150602083013567ffffffffffffffff81111561160457600080fd5b8301601f8101851361161557600080fd5b61162485823560208401611556565b9150509250929050565b600082601f83011261163f57600080fd5b6112a583833560208501611556565b6000806040838503121561166157600080fd5b82359150602083013567ffffffffffffffff81111561167f57600080fd5b6116248582860161162e565b6000806040838503121561169e57600080fd5b6116a7836114dd565b9150602083013567ffffffffffffffff81111561167f57600080fd5b6000602082840312156116d557600080fd5b5051919050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60006020828403121561178657600080fd5b815180151581146112a557600080fd5b60005b838110156117b1578181015183820152602001611799565b50506000910152565b600081518084526117d2816020860160208601611796565b601f01601f19169290920160200192915050565b8281526040602082015260006117ff60408301846117ba565b949350505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161188a816017850160208801611796565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516118bb816028840160208801611796565b01602801949350505050565b6020815260006112a560208301846117ba565b600181811c908216806118ee57607f821691505b60208210810361190e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561048c57600081815260208120601f850160051c8101602086101561193b5750805b601f850160051c820191505b8181101561195a57828155600101611947565b505050505050565b815167ffffffffffffffff81111561197c5761197c611540565b6119908161198a84546118da565b84611914565b602080601f8311600181146119c557600084156119ad5750858301515b600019600386901b1c1916600185901b17855561195a565b600085815260208120601f198616915b828110156119f4578886015182559484019460019091019084016119d5565b5085821015611a125787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176103ee576103ee611a22565b808201808211156103ee576103ee611a22565b634e487b7160e01b600052603260045260246000fd5b600081611a8757611a87611a22565b506000190190565b60008251611aa1818460208701611796565b919091019291505056fe5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212205b9b5a228d8b223706f2ecbcdf2974e1ed551a82d01a083c41d8a5da39e3a7e964736f6c63430008120033
Deployed Bytecode
0x60806040526004361061012a5760003560e01c80635c975abb116100ab578063a217fddf1161006f578063a217fddf14610311578063be59b6be14610326578063d547741f14610346578063e02023a114610366578063e8e7f80014610388578063f399e22e1461039d57600080fd5b80635c975abb146102765780635fd8c7101461028e5780638456cb59146102a357806391d14854146102b85780639d76ea58146102d857600080fd5b80633659cfe6116100f25780633659cfe6146101f95780633ab1a494146102195780633f4ba83a146102395780634f1ef2861461024e57806352d1902d1461026157600080fd5b806301ffc9a71461012f57806312065fe014610164578063248a9ca3146101875780632f2ff15d146101b757806336568abe146101d9575b600080fd5b34801561013b57600080fd5b5061014f61014a36600461149a565b6103bd565b60405190151581526020015b60405180910390f35b34801561017057600080fd5b506101796103f4565b60405190815260200161015b565b34801561019357600080fd5b506101796101a23660046114c4565b60009081526097602052604090206001015490565b3480156101c357600080fd5b506101d76101d23660046114f9565b610467565b005b3480156101e557600080fd5b506101d76101f43660046114f9565b610491565b34801561020557600080fd5b506101d7610214366004611525565b610514565b34801561022557600080fd5b506101d7610234366004611525565b6105f3565b34801561024557600080fd5b506101d7610622565b6101d761025c3660046115cc565b61063d565b34801561026d57600080fd5b50610179610709565b34801561028257600080fd5b5060fb5460ff1661014f565b34801561029a57600080fd5b506101d76107bc565b3480156102af57600080fd5b506101d76108ac565b3480156102c457600080fd5b5061014f6102d33660046114f9565b6108c7565b3480156102e457600080fd5b5061012e546102f9906001600160a01b031681565b6040516001600160a01b03909116815260200161015b565b34801561031d57600080fd5b50610179600081565b34801561033257600080fd5b506101d761034136600461164e565b6108f2565b34801561035257600080fd5b506101d76103613660046114f9565b610998565b34801561037257600080fd5b50610179600080516020611aac83398151915281565b34801561039457600080fd5b506102f96109bd565b3480156103a957600080fd5b506101d76103b836600461168b565b6109db565b60006001600160e01b03198216637965db0b60e01b14806103ee57506301ffc9a760e01b6001600160e01b03198316145b92915050565b61012e546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa15801561043e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046291906116c3565b905090565b60008281526097602052604090206001015461048281610aef565b61048c8383610af9565b505050565b6001600160a01b03811633146105065760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6105108282610b7f565b5050565b6001600160a01b037f0000000000000000000000008a058f7717d763752f5153bd20385e760e5425da16300361055c5760405162461bcd60e51b81526004016104fd906116dc565b7f0000000000000000000000008a058f7717d763752f5153bd20385e760e5425da6001600160a01b03166105a5600080516020611acc833981519152546001600160a01b031690565b6001600160a01b0316146105cb5760405162461bcd60e51b81526004016104fd90611728565b6105d481610be6565b604080516000808252602082019092526105f091839190610bf1565b50565b60006105fe81610aef565b5061012d80546001600160a01b0319166001600160a01b0392909216919091179055565b600061062d81610aef565b610635610d5c565b6105f0610da7565b6001600160a01b037f0000000000000000000000008a058f7717d763752f5153bd20385e760e5425da1630036106855760405162461bcd60e51b81526004016104fd906116dc565b7f0000000000000000000000008a058f7717d763752f5153bd20385e760e5425da6001600160a01b03166106ce600080516020611acc833981519152546001600160a01b031690565b6001600160a01b0316146106f45760405162461bcd60e51b81526004016104fd90611728565b6106fd82610be6565b61051082826001610bf1565b6000306001600160a01b037f0000000000000000000000008a058f7717d763752f5153bd20385e760e5425da16146107a95760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016104fd565b50600080516020611acc83398151915290565b600080516020611aac8339815191526107d481610aef565b61012d5433906001600160a01b0316156107f7575061012d546001600160a01b03165b60006108016103f4565b61012e5460405163a9059cbb60e01b81526001600160a01b0385811660048301526024820184905292935091169063a9059cbb906044016020604051808303816000875af1158015610857573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087b9190611774565b61088457600080fd5b61048c82826040518060400160405280600581526020016430b236b4b760d91b815250610df9565b60006108b781610aef565b6108bf610e41565b6105f0610e87565b60009182526097602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6108fa610e41565b61012e546001600160a01b03166323b872dd336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604481018590526064016020604051808303816000875af1158015610960573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109849190611774565b61098d57600080fd5b610510338383610ec4565b6000828152609760205260409020600101546109b381610aef565b61048c8383610b7f565b6000806109c981610aef565b505061012d546001600160a01b031690565b600054610100900460ff16158080156109fb5750600054600160ff909116105b80610a155750303b158015610a15575060005460ff166001145b610a785760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104fd565b6000805460ff191660011790558015610a9b576000805461ff0019166101001790555b610aa58383610eff565b801561048c576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6105f08133610f30565b610b0382826108c7565b6105105760008281526097602090815260408083206001600160a01b03851684529091529020805460ff19166001179055610b3b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610b8982826108c7565b156105105760008281526097602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061051081610aef565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615610c245761048c83610f89565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610c7e575060408051601f3d908101601f19168201909252610c7b918101906116c3565b60015b610ce15760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016104fd565b600080516020611acc8339815191528114610d505760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016104fd565b5061048c838383611025565b60fb5460ff16610da55760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016104fd565b565b610daf610d5c565b60fb805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b826001600160a01b03167f8d975448f7a9270f7445b90f4ee4085908f79f5cc4c96059e14ecaa7a85059338383604051610e349291906117e6565b60405180910390a2505050565b60fb5460ff1615610da55760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016104fd565b610e8f610e41565b60fb805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610ddc3390565b826001600160a01b03167f4db1adde7e87852be0791b143349bbdecc127523684ba1414380879e86565af58383604051610e349291906117e6565b600054610100900460ff16610f265760405162461bcd60e51b81526004016104fd90611807565b6105108282611050565b610f3a82826108c7565b61051057610f47816110f7565b610f52836020611109565b604051602001610f63929190611852565b60408051601f198184030181529082905262461bcd60e51b82526104fd916004016118c7565b6001600160a01b0381163b610ff65760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016104fd565b600080516020611acc83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b61102e836112ac565b60008251118061103b5750805b1561048c5761104a83836112ec565b50505050565b600054610100900460ff166110775760405162461bcd60e51b81526004016104fd90611807565b61107f6113e0565b6110876113e0565b611092600033611407565b61109d600080611411565b6110b5600080516020611aac83398151915233611407565b6110ce600080516020611aac8339815191526000611411565b61012e80546001600160a01b0319166001600160a01b03841617905561012f61048c8282611962565b60606103ee6001600160a01b03831660145b60606000611118836002611a38565b611123906002611a4f565b67ffffffffffffffff81111561113b5761113b611540565b6040519080825280601f01601f191660200182016040528015611165576020820181803683370190505b509050600360fc1b8160008151811061118057611180611a62565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106111af576111af611a62565b60200101906001600160f81b031916908160001a90535060006111d3846002611a38565b6111de906001611a4f565b90505b6001811115611256576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061121257611212611a62565b1a60f81b82828151811061122857611228611a62565b60200101906001600160f81b031916908160001a90535060049490941c9361124f81611a78565b90506111e1565b5083156112a55760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016104fd565b9392505050565b6112b581610f89565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6113545760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016104fd565b600080846001600160a01b03168460405161136f9190611a8f565b600060405180830381855af49150503d80600081146113aa576040519150601f19603f3d011682016040523d82523d6000602084013e6113af565b606091505b50915091506113d78282604051806060016040528060278152602001611aec6027913961145c565b95945050505050565b600054610100900460ff16610da55760405162461bcd60e51b81526004016104fd90611807565b6105108282610af9565b600082815260976020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6060831561146b5750816112a5565b6112a583838151156114805781518083602001fd5b8060405162461bcd60e51b81526004016104fd91906118c7565b6000602082840312156114ac57600080fd5b81356001600160e01b0319811681146112a557600080fd5b6000602082840312156114d657600080fd5b5035919050565b80356001600160a01b03811681146114f457600080fd5b919050565b6000806040838503121561150c57600080fd5b8235915061151c602084016114dd565b90509250929050565b60006020828403121561153757600080fd5b6112a5826114dd565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff8084111561157157611571611540565b604051601f8501601f19908116603f0116810190828211818310171561159957611599611540565b816040528093508581528686860111156115b257600080fd5b858560208301376000602087830101525050509392505050565b600080604083850312156115df57600080fd5b6115e8836114dd565b9150602083013567ffffffffffffffff81111561160457600080fd5b8301601f8101851361161557600080fd5b61162485823560208401611556565b9150509250929050565b600082601f83011261163f57600080fd5b6112a583833560208501611556565b6000806040838503121561166157600080fd5b82359150602083013567ffffffffffffffff81111561167f57600080fd5b6116248582860161162e565b6000806040838503121561169e57600080fd5b6116a7836114dd565b9150602083013567ffffffffffffffff81111561167f57600080fd5b6000602082840312156116d557600080fd5b5051919050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60006020828403121561178657600080fd5b815180151581146112a557600080fd5b60005b838110156117b1578181015183820152602001611799565b50506000910152565b600081518084526117d2816020860160208601611796565b601f01601f19169290920160200192915050565b8281526040602082015260006117ff60408301846117ba565b949350505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161188a816017850160208801611796565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516118bb816028840160208801611796565b01602801949350505050565b6020815260006112a560208301846117ba565b600181811c908216806118ee57607f821691505b60208210810361190e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561048c57600081815260208120601f850160051c8101602086101561193b5750805b601f850160051c820191505b8181101561195a57828155600101611947565b505050505050565b815167ffffffffffffffff81111561197c5761197c611540565b6119908161198a84546118da565b84611914565b602080601f8311600181146119c557600084156119ad5750858301515b600019600386901b1c1916600185901b17855561195a565b600085815260208120601f198616915b828110156119f4578886015182559484019460019091019084016119d5565b5085821015611a125787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176103ee576103ee611a22565b808201808211156103ee576103ee611a22565b634e487b7160e01b600052603260045260246000fd5b600081611a8757611a87611a22565b506000190190565b60008251611aa1818460208701611796565b919091019291505056fe5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212205b9b5a228d8b223706f2ecbcdf2974e1ed551a82d01a083c41d8a5da39e3a7e964736f6c63430008120033
Deployed Bytecode Sourcemap
100488:677:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;46401:215;;;;;;;;;;-1:-1:-1;46401:215:0;;;;;:::i;:::-;;:::i;:::-;;;470:14:1;;463:22;445:41;;433:2;418:18;46401:215:0;;;;;;;;98466:123;;;;;;;;;;;;;:::i;:::-;;;643:25:1;;;631:2;616:18;98466:123:0;497:177:1;48257:131:0;;;;;;;;;;-1:-1:-1;48257:131:0;;;;;:::i;:::-;48331:7;48358:12;;;:6;:12;;;;;:22;;;;48257:131;48698:147;;;;;;;;;;-1:-1:-1;48698:147:0;;;;;:::i;:::-;;:::i;:::-;;49842:218;;;;;;;;;;-1:-1:-1;49842:218:0;;;;;:::i;:::-;;:::i;65471:200::-;;;;;;;;;;-1:-1:-1;65471:200:0;;;;;:::i;:::-;;:::i;98597:134::-;;;;;;;;;;-1:-1:-1;98597:134:0;;;;;:::i;:::-;;:::i;100270:95::-;;;;;;;;;;;;;:::i;65930:225::-;;;;;;:::i;:::-;;:::i;65149:133::-;;;;;;;;;;;;;:::i;42304:86::-;;;;;;;;;;-1:-1:-1;42375:7:0;;;;42304:86;;98081:377;;;;;;;;;;;;;:::i;100168:94::-;;;;;;;;;;;;;:::i;46708:147::-;;;;;;;;;;-1:-1:-1;46708:147:0;;;;;:::i;:::-;;:::i;97727:27::-;;;;;;;;;;-1:-1:-1;97727:27:0;;;;-1:-1:-1;;;;;97727:27:0;;;;;;-1:-1:-1;;;;;3134:32:1;;;3116:51;;3104:2;3089:18;97727:27:0;2970:203:1;45802:49:0;;;;;;;;;;-1:-1:-1;45802:49:0;45847:4;45802:49;;99898:260;;;;;;;;;;-1:-1:-1;99898:260:0;;;;;:::i;:::-;;:::i;49138:149::-;;;;;;;;;;-1:-1:-1;49138:149:0;;;;;:::i;:::-;;:::i;97623:66::-;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;97623:66:0;;98737:137;;;;;;;;;;;;;:::i;100645:169::-;;;;;;;;;;-1:-1:-1;100645:169:0;;;;;:::i;:::-;;:::i;46401:215::-;46486:4;-1:-1:-1;;;;;;46510:58:0;;-1:-1:-1;;;46510:58:0;;:98;;-1:-1:-1;;;;;;;;;;38661:51:0;;;46572:36;46503:105;46401:215;-1:-1:-1;;46401:215:0:o;98466:123::-;98543:12;;98536:45;;-1:-1:-1;;;98536:45:0;;98575:4;98536:45;;;3116:51:1;98509:7:0;;-1:-1:-1;;;;;98543:12:0;;98536:30;;3089:18:1;;98536:45:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;98529:52;;98466:123;:::o;48698:147::-;48331:7;48358:12;;;:6;:12;;;;;:22;;;46293:16;46304:4;46293:10;:16::i;:::-;48812:25:::1;48823:4;48829:7;48812:10;:25::i;:::-;48698:147:::0;;;:::o;49842:218::-;-1:-1:-1;;;;;49938:23:0;;39981:10;49938:23;49930:83;;;;-1:-1:-1;;;49930:83:0;;4591:2:1;49930:83:0;;;4573:21:1;4630:2;4610:18;;;4603:30;4669:34;4649:18;;;4642:62;-1:-1:-1;;;4720:18:1;;;4713:45;4775:19;;49930:83:0;;;;;;;;;50026:26;50038:4;50044:7;50026:11;:26::i;:::-;49842:218;;:::o;65471:200::-;-1:-1:-1;;;;;64019:6:0;64002:23;64010:4;64002:23;63994:80;;;;-1:-1:-1;;;63994:80:0;;;;;;;:::i;:::-;64117:6;-1:-1:-1;;;;;64093:30:0;:20;-1:-1:-1;;;;;;;;;;;56070:65:0;-1:-1:-1;;;;;56070:65:0;;55990:153;64093:20;-1:-1:-1;;;;;64093:30:0;;64085:87;;;;-1:-1:-1;;;64085:87:0;;;;;;;:::i;:::-;65555:36:::1;65573:17;65555;:36::i;:::-;65643:12;::::0;;65653:1:::1;65643:12:::0;;;::::1;::::0;::::1;::::0;;;65602:61:::1;::::0;65624:17;;65643:12;65602:21:::1;:61::i;:::-;65471:200:::0;:::o;98597:134::-;45847:4;46293:16;45847:4;46293:10;:16::i;:::-;-1:-1:-1;98694:16:0::1;:29:::0;;-1:-1:-1;;;;;;98694:29:0::1;-1:-1:-1::0;;;;;98694:29:0;;;::::1;::::0;;;::::1;::::0;;98597:134::o;100270:95::-;45847:4;46293:16;45847:4;46293:10;:16::i;:::-;42168::::1;:14;:16::i;:::-;100347:10:::2;:8;:10::i;65930:225::-:0;-1:-1:-1;;;;;64019:6:0;64002:23;64010:4;64002:23;63994:80;;;;-1:-1:-1;;;63994:80:0;;;;;;;:::i;:::-;64117:6;-1:-1:-1;;;;;64093:30:0;:20;-1:-1:-1;;;;;;;;;;;56070:65:0;-1:-1:-1;;;;;56070:65:0;;55990:153;64093:20;-1:-1:-1;;;;;64093:30:0;;64085:87;;;;-1:-1:-1;;;64085:87:0;;;;;;;:::i;:::-;66048:36:::1;66066:17;66048;:36::i;:::-;66095:52;66117:17;66136:4;66142;66095:21;:52::i;65149:133::-:0;65227:7;64455:4;-1:-1:-1;;;;;64464:6:0;64447:23;;64439:92;;;;-1:-1:-1;;;64439:92:0;;5833:2:1;64439:92:0;;;5815:21:1;5872:2;5852:18;;;5845:30;5911:34;5891:18;;;5884:62;5982:26;5962:18;;;5955:54;6026:19;;64439:92:0;5631:420:1;64439:92:0;-1:-1:-1;;;;;;;;;;;;65149:133:0;:::o;98081:377::-;-1:-1:-1;;;;;;;;;;;46293:16:0;46304:4;46293:10;:16::i;:::-;98195::::1;::::0;98171:10:::1;::::0;-1:-1:-1;;;;;98195:16:0::1;:30:::0;98192:76:::1;;-1:-1:-1::0;98252:16:0::1;::::0;-1:-1:-1;;;;;98252:16:0::1;98192:76;98289:15;98307:12;:10;:12::i;:::-;98345;::::0;98338:48:::1;::::0;-1:-1:-1;;;98338:48:0;;-1:-1:-1;;;;;6248:32:1;;;98338:48:0::1;::::0;::::1;6230:51:1::0;6297:18;;;6290:34;;;98289:30:0;;-1:-1:-1;98345:12:0;::::1;::::0;98338:29:::1;::::0;6203:18:1;;98338:48:0::1;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;98330:57;;;::::0;::::1;;98406:44;98425:8;98434:7;98406:44;;;;;;;;;;;;;-1:-1:-1::0;;;98406:44:0::1;;::::0;:18:::1;:44::i;100168:94::-:0;45847:4;46293:16;45847:4;46293:10;:16::i;:::-;41909:19:::1;:17;:19::i;:::-;100246:8:::2;:6;:8::i;46708:147::-:0;46794:4;46818:12;;;:6;:12;;;;;;;;-1:-1:-1;;;;;46818:29:0;;;;;;;;;;;;;;;46708:147::o;99898:260::-;41909:19;:17;:19::i;:::-;100016:12:::1;::::0;-1:-1:-1;;;;;100016:12:0::1;100009:33;39981:10:::0;100009:71:::1;::::0;-1:-1:-1;;;;;;100009:71:0::1;::::0;;;;;;-1:-1:-1;;;;;6875:15:1;;;100009:71:0::1;::::0;::::1;6857:34:1::0;100065:4:0::1;6907:18:1::0;;;6900:43;6959:18;;;6952:34;;;6792:18;;100009:71:0::1;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;99987:104;;;::::0;::::1;;100102:48;39981:10:::0;100135:7:::1;100144:5;100102:18;:48::i;49138:149::-:0;48331:7;48358:12;;;:6;:12;;;;;:22;;;46293:16;46304:4;46293:10;:16::i;:::-;49253:26:::1;49265:4;49271:7;49253:11;:26::i;98737:137::-:0;98818:7;;46293:16;98818:7;46293:10;:16::i;:::-;-1:-1:-1;;98850:16:0::1;::::0;-1:-1:-1;;;;;98850:16:0::1;::::0;98737:137::o;100645:169::-;34038:19;34061:13;;;;;;34060:14;;34108:34;;;;-1:-1:-1;34126:12:0;;34141:1;34126:12;;;;:16;34108:34;34107:108;;;-1:-1:-1;34187:4:0;23699:19;:23;;;34148:66;;-1:-1:-1;34197:12:0;;;;;:17;34148:66;34085:204;;;;-1:-1:-1;;;34085:204:0;;7199:2:1;34085:204:0;;;7181:21:1;7238:2;7218:18;;;7211:30;7277:34;7257:18;;;7250:62;-1:-1:-1;;;7328:18:1;;;7321:44;7382:19;;34085:204:0;6997:410:1;34085:204:0;34300:12;:16;;-1:-1:-1;;34300:16:0;34315:1;34300:16;;;34327:67;;;;34362:13;:20;;-1:-1:-1;;34362:20:0;;;;;34327:67;100752:54:::1;100780:13;100797:8;100752:26;:54::i;:::-;34420:14:::0;34416:102;;;34467:5;34451:21;;-1:-1:-1;;34451:21:0;;;34492:14;;-1:-1:-1;7564:36:1;;34492:14:0;;7552:2:1;7537:18;34492:14:0;;;;;;;34027:498;100645:169;;:::o;47159:105::-;47226:30;47237:4;39981:10;47226;:30::i;51439:238::-;51523:22;51531:4;51537:7;51523;:22::i;:::-;51518:152;;51562:12;;;;:6;:12;;;;;;;;-1:-1:-1;;;;;51562:29:0;;;;;;;;;:36;;-1:-1:-1;;51562:36:0;51594:4;51562:36;;;51645:12;39981:10;;39901:98;51645:12;-1:-1:-1;;;;;51618:40:0;51636:7;-1:-1:-1;;;;;51618:40:0;51630:4;51618:40;;;;;;;;;;51439:238;;:::o;51857:239::-;51941:22;51949:4;51955:7;51941;:22::i;:::-;51937:152;;;52012:5;51980:12;;;:6;:12;;;;;;;;-1:-1:-1;;;;;51980:29:0;;;;;;;;;;:37;;-1:-1:-1;;51980:37:0;;;52037:40;39981:10;;51980:12;;52037:40;;52012:5;52037:40;51857:239;;:::o;99685:85::-;45847:4;46293:16;45847:4;46293:10;:16::i;57408:992::-;55492:66;57862:59;;;57858:535;;;57938:37;57957:17;57938:18;:37::i;57858:535::-;58041:17;-1:-1:-1;;;;;58012:61:0;;:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;58012:63:0;;;;;;;;-1:-1:-1;;58012:63:0;;;;;;;;;;;;:::i;:::-;;;58008:306;;58242:56;;-1:-1:-1;;;58242:56:0;;8002:2:1;58242:56:0;;;7984:21:1;8041:2;8021:18;;;8014:30;8080:34;8060:18;;;8053:62;-1:-1:-1;;;8131:18:1;;;8124:44;8185:19;;58242:56:0;7800:410:1;58008:306:0;-1:-1:-1;;;;;;;;;;;58126:28:0;;58118:82;;;;-1:-1:-1;;;58118:82:0;;8417:2:1;58118:82:0;;;8399:21:1;8456:2;8436:18;;;8429:30;8495:34;8475:18;;;8468:62;-1:-1:-1;;;8546:18:1;;;8539:39;8595:19;;58118:82:0;8215:405:1;58118:82:0;58076:140;58328:53;58346:17;58365:4;58371:9;58328:17;:53::i;42648:108::-;42375:7;;;;42707:41;;;;-1:-1:-1;;;42707:41:0;;8827:2:1;42707:41:0;;;8809:21:1;8866:2;8846:18;;;8839:30;-1:-1:-1;;;8885:18:1;;;8878:50;8945:18;;42707:41:0;8625:344:1;42707:41:0;42648:108::o;43159:120::-;42168:16;:14;:16::i;:::-;43218:7:::1;:15:::0;;-1:-1:-1;;43218:15:0::1;::::0;;43249:22:::1;39981:10:::0;43258:12:::1;43249:22;::::0;-1:-1:-1;;;;;3134:32:1;;;3116:51;;3104:2;3089:18;43249:22:0::1;;;;;;;43159:120::o:0;97836:160::-;97963:8;-1:-1:-1;;;;;97954:34:0;;97973:7;97982:5;97954:34;;;;;;;:::i;:::-;;;;;;;;97836:160;;;:::o;42463:108::-;42375:7;;;;42533:9;42525:38;;;;-1:-1:-1;;;42525:38:0;;10003:2:1;42525:38:0;;;9985:21:1;10042:2;10022:18;;;10015:30;-1:-1:-1;;;10061:18:1;;;10054:46;10117:18;;42525:38:0;9801:340:1;42900:118:0;41909:19;:17;:19::i;:::-;42960:7:::1;:14:::0;;-1:-1:-1;;42960:14:0::1;42970:4;42960:14;::::0;;42990:20:::1;42997:12;39981:10:::0;;39901:98;101003:159;101129:8;-1:-1:-1;;;;;101122:32:0;;101139:7;101148:5;101122:32;;;;;;;:::i;100822:175::-;36181:13;;;;;;;36173:69;;;;-1:-1:-1;;;36173:69:0;;;;;;;:::i;:::-;100942:47:::1;100965:13;100980:8;100942:22;:47::i;47554:514::-:0;47643:22;47651:4;47657:7;47643;:22::i;:::-;47638:423;;47831:39;47862:7;47831:30;:39::i;:::-;47943:49;47982:4;47989:2;47943:30;:49::i;:::-;47736:279;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;47736:279:0;;;;;;;;;;-1:-1:-1;;;47682:367:0;;;;;;;:::i;56239:284::-;-1:-1:-1;;;;;23699:19:0;;;56313:106;;;;-1:-1:-1;;;56313:106:0;;11802:2:1;56313:106:0;;;11784:21:1;11841:2;11821:18;;;11814:30;11880:34;11860:18;;;11853:62;-1:-1:-1;;;11931:18:1;;;11924:43;11984:19;;56313:106:0;11600:409:1;56313:106:0;-1:-1:-1;;;;;;;;;;;56430:85:0;;-1:-1:-1;;;;;;56430:85:0;-1:-1:-1;;;;;56430:85:0;;;;;;;;;;56239:284::o;56932:297::-;57075:29;57086:17;57075:10;:29::i;:::-;57133:1;57119:4;:11;:15;:28;;;;57138:9;57119:28;57115:107;;;57164:46;57186:17;57205:4;57164:21;:46::i;:::-;;56932:297;;;:::o;99210:467::-;36181:13;;;;;;;36173:69;;;;-1:-1:-1;;;36173:69:0;;;;;;;:::i;:::-;99319:22:::1;:20;:22::i;:::-;99352:25;:23;:25::i;:::-;99388:44;45847:4;39981:10:::0;99388::::1;:44::i;:::-;99443:54;45847:4;::::0;99443:13:::1;:54::i;:::-;99508:39;-1:-1:-1::0;;;;;;;;;;;39981:10:0;99388::::1;:44::i;99508:39::-;99558:49;-1:-1:-1::0;;;;;;;;;;;45847:4:0::1;99558:13;:49::i;:::-;99618:12;:21:::0;;-1:-1:-1;;;;;;99618:21:0::1;-1:-1:-1::0;;;;;99618:21:0;::::1;;::::0;;99650:8:::1;:19;99661:8:::0;99650;:19:::1;:::i;16082:151::-:0;16140:13;16173:52;-1:-1:-1;;;;;16185:22:0;;14215:2;15478:447;15553:13;15579:19;15611:10;15615:6;15611:1;:10;:::i;:::-;:14;;15624:1;15611:14;:::i;:::-;15601:25;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;15601:25:0;;15579:47;;-1:-1:-1;;;15637:6:0;15644:1;15637:9;;;;;;;;:::i;:::-;;;;:15;-1:-1:-1;;;;;15637:15:0;;;;;;;;;-1:-1:-1;;;15663:6:0;15670:1;15663:9;;;;;;;;:::i;:::-;;;;:15;-1:-1:-1;;;;;15663:15:0;;;;;;;;-1:-1:-1;15694:9:0;15706:10;15710:6;15706:1;:10;:::i;:::-;:14;;15719:1;15706:14;:::i;:::-;15694:26;;15689:131;15726:1;15722;:5;15689:131;;;-1:-1:-1;;;15770:5:0;15778:3;15770:11;15761:21;;;;;;;:::i;:::-;;;;15749:6;15756:1;15749:9;;;;;;;;:::i;:::-;;;;:33;-1:-1:-1;;;;;15749:33:0;;;;;;;;-1:-1:-1;15807:1:0;15797:11;;;;;15729:3;;;:::i;:::-;;;15689:131;;;-1:-1:-1;15838:10:0;;15830:55;;;;-1:-1:-1;;;15830:55:0;;15513:2:1;15830:55:0;;;15495:21:1;;;15532:18;;;15525:30;15591:34;15571:18;;;15564:62;15643:18;;15830:55:0;15311:356:1;15830:55:0;15910:6;15478:447;-1:-1:-1;;;15478:447:0:o;56636:155::-;56703:37;56722:17;56703:18;:37::i;:::-;56756:27;;-1:-1:-1;;;;;56756:27:0;;;;;;;;56636:155;:::o;61405:461::-;61488:12;-1:-1:-1;;;;;23699:19:0;;;61513:88;;;;-1:-1:-1;;;61513:88:0;;15874:2:1;61513:88:0;;;15856:21:1;15913:2;15893:18;;;15886:30;15952:34;15932:18;;;15925:62;-1:-1:-1;;;16003:18:1;;;15996:36;16049:19;;61513:88:0;15672:402:1;61513:88:0;61675:12;61689:23;61716:6;-1:-1:-1;;;;;61716:19:0;61736:4;61716:25;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;61674:67;;;;61759:99;61795:7;61804:10;61759:99;;;;;;;;;;;;;;;;;:35;:99::i;:::-;61752:106;61405:461;-1:-1:-1;;;;;61405:461:0:o;45491:66::-;36181:13;;;;;;;36173:69;;;;-1:-1:-1;;;36173:69:0;;;;;;;:::i;50767:112::-;50846:25;50857:4;50863:7;50846:10;:25::i;51011:251::-;51095:25;48358:12;;;:6;:12;;;;;;:22;;;;51152:34;;;;51202:52;;48358:22;;51152:34;;48358:22;;:12;;51202:52;;51095:25;51202:52;51084:178;51011:251;;:::o;29814:305::-;29964:12;29993:7;29989:123;;;-1:-1:-1;30024:10:0;30017:17;;29989:123;30067:33;30075:10;30087:12;30288:17;;:21;30284:388;;30520:10;30514:17;30577:15;30564:10;30560:2;30556:19;30549:44;30284:388;30647:12;30640:20;;-1:-1:-1;;;30640:20:0;;;;;;;;:::i;14:286:1:-;72:6;125:2;113:9;104:7;100:23;96:32;93:52;;;141:1;138;131:12;93:52;167:23;;-1:-1:-1;;;;;;219:32:1;;209:43;;199:71;;266:1;263;256:12;679:180;738:6;791:2;779:9;770:7;766:23;762:32;759:52;;;807:1;804;797:12;759:52;-1:-1:-1;830:23:1;;679:180;-1:-1:-1;679:180:1:o;1046:173::-;1114:20;;-1:-1:-1;;;;;1163:31:1;;1153:42;;1143:70;;1209:1;1206;1199:12;1143:70;1046:173;;;:::o;1224:254::-;1292:6;1300;1353:2;1341:9;1332:7;1328:23;1324:32;1321:52;;;1369:1;1366;1359:12;1321:52;1405:9;1392:23;1382:33;;1434:38;1468:2;1457:9;1453:18;1434:38;:::i;:::-;1424:48;;1224:254;;;;;:::o;1483:186::-;1542:6;1595:2;1583:9;1574:7;1570:23;1566:32;1563:52;;;1611:1;1608;1601:12;1563:52;1634:29;1653:9;1634:29;:::i;1674:127::-;1735:10;1730:3;1726:20;1723:1;1716:31;1766:4;1763:1;1756:15;1790:4;1787:1;1780:15;1806:631;1870:5;1900:18;1941:2;1933:6;1930:14;1927:40;;;1947:18;;:::i;:::-;2022:2;2016:9;1990:2;2076:15;;-1:-1:-1;;2072:24:1;;;2098:2;2068:33;2064:42;2052:55;;;2122:18;;;2142:22;;;2119:46;2116:72;;;2168:18;;:::i;:::-;2208:10;2204:2;2197:22;2237:6;2228:15;;2267:6;2259;2252:22;2307:3;2298:6;2293:3;2289:16;2286:25;2283:45;;;2324:1;2321;2314:12;2283:45;2374:6;2369:3;2362:4;2354:6;2350:17;2337:44;2429:1;2422:4;2413:6;2405;2401:19;2397:30;2390:41;;;;1806:631;;;;;:::o;2442:523::-;2519:6;2527;2580:2;2568:9;2559:7;2555:23;2551:32;2548:52;;;2596:1;2593;2586:12;2548:52;2619:29;2638:9;2619:29;:::i;:::-;2609:39;;2699:2;2688:9;2684:18;2671:32;2726:18;2718:6;2715:30;2712:50;;;2758:1;2755;2748:12;2712:50;2781:22;;2834:4;2826:13;;2822:27;-1:-1:-1;2812:55:1;;2863:1;2860;2853:12;2812:55;2886:73;2951:7;2946:2;2933:16;2928:2;2924;2920:11;2886:73;:::i;:::-;2876:83;;;2442:523;;;;;:::o;3178:221::-;3221:5;3274:3;3267:4;3259:6;3255:17;3251:27;3241:55;;3292:1;3289;3282:12;3241:55;3314:79;3389:3;3380:6;3367:20;3360:4;3352:6;3348:17;3314:79;:::i;3404:390::-;3482:6;3490;3543:2;3531:9;3522:7;3518:23;3514:32;3511:52;;;3559:1;3556;3549:12;3511:52;3595:9;3582:23;3572:33;;3656:2;3645:9;3641:18;3628:32;3683:18;3675:6;3672:30;3669:50;;;3715:1;3712;3705:12;3669:50;3738;3780:7;3771:6;3760:9;3756:22;3738:50;:::i;3799:396::-;3877:6;3885;3938:2;3926:9;3917:7;3913:23;3909:32;3906:52;;;3954:1;3951;3944:12;3906:52;3977:29;3996:9;3977:29;:::i;:::-;3967:39;;4057:2;4046:9;4042:18;4029:32;4084:18;4076:6;4073:30;4070:50;;;4116:1;4113;4106:12;4200:184;4270:6;4323:2;4311:9;4302:7;4298:23;4294:32;4291:52;;;4339:1;4336;4329:12;4291:52;-1:-1:-1;4362:16:1;;4200:184;-1:-1:-1;4200:184:1:o;4805:408::-;5007:2;4989:21;;;5046:2;5026:18;;;5019:30;5085:34;5080:2;5065:18;;5058:62;-1:-1:-1;;;5151:2:1;5136:18;;5129:42;5203:3;5188:19;;4805:408::o;5218:::-;5420:2;5402:21;;;5459:2;5439:18;;;5432:30;5498:34;5493:2;5478:18;;5471:62;-1:-1:-1;;;5564:2:1;5549:18;;5542:42;5616:3;5601:19;;5218:408::o;6335:277::-;6402:6;6455:2;6443:9;6434:7;6430:23;6426:32;6423:52;;;6471:1;6468;6461:12;6423:52;6503:9;6497:16;6556:5;6549:13;6542:21;6535:5;6532:32;6522:60;;6578:1;6575;6568:12;8974:250;9059:1;9069:113;9083:6;9080:1;9077:13;9069:113;;;9159:11;;;9153:18;9140:11;;;9133:39;9105:2;9098:10;9069:113;;;-1:-1:-1;;9216:1:1;9198:16;;9191:27;8974:250::o;9229:271::-;9271:3;9309:5;9303:12;9336:6;9331:3;9324:19;9352:76;9421:6;9414:4;9409:3;9405:14;9398:4;9391:5;9387:16;9352:76;:::i;:::-;9482:2;9461:15;-1:-1:-1;;9457:29:1;9448:39;;;;9489:4;9444:50;;9229:271;-1:-1:-1;;9229:271:1:o;9505:291::-;9682:6;9671:9;9664:25;9725:2;9720;9709:9;9705:18;9698:30;9645:4;9745:45;9786:2;9775:9;9771:18;9763:6;9745:45;:::i;:::-;9737:53;9505:291;-1:-1:-1;;;;9505:291:1:o;10146:407::-;10348:2;10330:21;;;10387:2;10367:18;;;10360:30;10426:34;10421:2;10406:18;;10399:62;-1:-1:-1;;;10492:2:1;10477:18;;10470:41;10543:3;10528:19;;10146:407::o;10558:812::-;10969:25;10964:3;10957:38;10939:3;11024:6;11018:13;11040:75;11108:6;11103:2;11098:3;11094:12;11087:4;11079:6;11075:17;11040:75;:::i;:::-;-1:-1:-1;;;11174:2:1;11134:16;;;11166:11;;;11159:40;11224:13;;11246:76;11224:13;11308:2;11300:11;;11293:4;11281:17;;11246:76;:::i;:::-;11342:17;11361:2;11338:26;;10558:812;-1:-1:-1;;;;10558:812:1:o;11375:220::-;11524:2;11513:9;11506:21;11487:4;11544:45;11585:2;11574:9;11570:18;11562:6;11544:45;:::i;12014:380::-;12093:1;12089:12;;;;12136;;;12157:61;;12211:4;12203:6;12199:17;12189:27;;12157:61;12264:2;12256:6;12253:14;12233:18;12230:38;12227:161;;12310:10;12305:3;12301:20;12298:1;12291:31;12345:4;12342:1;12335:15;12373:4;12370:1;12363:15;12227:161;;12014:380;;;:::o;12525:545::-;12627:2;12622:3;12619:11;12616:448;;;12663:1;12688:5;12684:2;12677:17;12733:4;12729:2;12719:19;12803:2;12791:10;12787:19;12784:1;12780:27;12774:4;12770:38;12839:4;12827:10;12824:20;12821:47;;;-1:-1:-1;12862:4:1;12821:47;12917:2;12912:3;12908:12;12905:1;12901:20;12895:4;12891:31;12881:41;;12972:82;12990:2;12983:5;12980:13;12972:82;;;13035:17;;;13016:1;13005:13;12972:82;;;12976:3;;;12525:545;;;:::o;13246:1352::-;13372:3;13366:10;13399:18;13391:6;13388:30;13385:56;;;13421:18;;:::i;:::-;13450:97;13540:6;13500:38;13532:4;13526:11;13500:38;:::i;:::-;13494:4;13450:97;:::i;:::-;13602:4;;13666:2;13655:14;;13683:1;13678:663;;;;14385:1;14402:6;14399:89;;;-1:-1:-1;14454:19:1;;;14448:26;14399:89;-1:-1:-1;;13203:1:1;13199:11;;;13195:24;13191:29;13181:40;13227:1;13223:11;;;13178:57;14501:81;;13648:944;;13678:663;12472:1;12465:14;;;12509:4;12496:18;;-1:-1:-1;;13714:20:1;;;13832:236;13846:7;13843:1;13840:14;13832:236;;;13935:19;;;13929:26;13914:42;;14027:27;;;;13995:1;13983:14;;;;13862:19;;13832:236;;;13836:3;14096:6;14087:7;14084:19;14081:201;;;14157:19;;;14151:26;-1:-1:-1;;14240:1:1;14236:14;;;14252:3;14232:24;14228:37;14224:42;14209:58;14194:74;;14081:201;-1:-1:-1;;;;;14328:1:1;14312:14;;;14308:22;14295:36;;-1:-1:-1;13246:1352:1:o;14603:127::-;14664:10;14659:3;14655:20;14652:1;14645:31;14695:4;14692:1;14685:15;14719:4;14716:1;14709:15;14735:168;14808:9;;;14839;;14856:15;;;14850:22;;14836:37;14826:71;;14877:18;;:::i;14908:125::-;14973:9;;;14994:10;;;14991:36;;;15007:18;;:::i;15038:127::-;15099:10;15094:3;15090:20;15087:1;15080:31;15130:4;15127:1;15120:15;15154:4;15151:1;15144:15;15170:136;15209:3;15237:5;15227:39;;15246:18;;:::i;:::-;-1:-1:-1;;;15282:18:1;;15170:136::o;16079:287::-;16208:3;16246:6;16240:13;16262:66;16321:6;16316:3;16309:4;16301:6;16297:17;16262:66;:::i;:::-;16344:16;;;;;16079:287;-1:-1:-1;;16079:287:1:o
Swarm Source
ipfs://5b9b5a228d8b223706f2ecbcdf2974e1ed551a82d01a083c41d8a5da39e3a7e9
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.