- Contract name:
- DataNFT
- Optimization enabled
- true
- Compiler version
- v0.8.17+commit.8df45f5f
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2023-12-15T15:37:48.205314Z
Contract source code
// SPDX-License-Identifier: MIT
// File: @openzeppelin/[email protected]/utils/CountersUpgradeable.sol
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
// File: @openzeppelin/[email protected]/utils/StorageSlotUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library CountersUpgradeable {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/proxy/utils/Initializable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (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 Internal function that returns the initialized version. Returns `_initialized`
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Internal function that returns the initialized version. Returns `_initializing`
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}
// File: @openzeppelin/[email protected]/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.5.0) (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 {
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 Emitted when the implementation is upgraded.
*/
event Upgraded(address indexed implementation);
/**
* @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 Emitted when the admin account has changed.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @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 Emitted when the beacon is upgraded.
*/
event BeaconUpgraded(address indexed beacon);
/**
* @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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/token/ERC721/IERC721ReceiverUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721ReceiverUpgradeable {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
// File: @openzeppelin/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/token/ERC721/IERC721Upgradeable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721Upgradeable is IERC165Upgradeable {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(
address indexed from,
address indexed to,
uint256 indexed tokenId
);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(
address indexed owner,
address indexed approved,
uint256 indexed tokenId
);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(
address indexed owner,
address indexed operator,
bool approved
);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(
uint256 tokenId
) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(
address owner,
address operator
) external view returns (bool);
}
// File: @openzeppelin/[email protected]/token/ERC721/extensions/IERC721MetadataUpgradeable.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721MetadataUpgradeable is IERC721Upgradeable {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
// File: @openzeppelin/[email protected]/token/ERC721/ERC721Upgradeable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721Upgradeable is
Initializable,
ContextUpgradeable,
ERC165Upgradeable,
IERC721Upgradeable,
IERC721MetadataUpgradeable
{
using AddressUpgradeable for address;
using StringsUpgradeable for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
function __ERC721_init(
string memory name_,
string memory symbol_
) internal onlyInitializing {
__ERC721_init_unchained(name_, symbol_);
}
function __ERC721_init_unchained(
string memory name_,
string memory symbol_
) internal onlyInitializing {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(
bytes4 interfaceId
)
public
view
virtual
override(ERC165Upgradeable, IERC165Upgradeable)
returns (bool)
{
return
interfaceId == type(IERC721Upgradeable).interfaceId ||
interfaceId == type(IERC721MetadataUpgradeable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(
address owner
) public view virtual override returns (uint256) {
require(
owner != address(0),
"ERC721: address zero is not a valid owner"
);
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(
uint256 tokenId
) public view virtual override returns (address) {
address owner = _ownerOf(tokenId);
require(owner != address(0), "ERC721: invalid token ID");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(
uint256 tokenId
) public view virtual override returns (string memory) {
_requireMinted(tokenId);
string memory baseURI = _baseURI();
return
bytes(baseURI).length > 0
? string(abi.encodePacked(baseURI, tokenId.toString()))
: "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721Upgradeable.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not token owner or approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(
uint256 tokenId
) public view virtual override returns (address) {
_requireMinted(tokenId);
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(
address operator,
bool approved
) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(
address owner,
address operator
) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(
_isApprovedOrOwner(_msgSender(), tokenId),
"ERC721: caller is not token owner or approved"
);
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public virtual override {
require(
_isApprovedOrOwner(_msgSender(), tokenId),
"ERC721: caller is not token owner or approved"
);
_safeTransfer(from, to, tokenId, data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory data
) internal virtual {
_transfer(from, to, tokenId);
require(
_checkOnERC721Received(from, to, tokenId, data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
*/
function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
return _owners[tokenId];
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _ownerOf(tokenId) != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(
address spender,
uint256 tokenId
) internal view virtual returns (bool) {
address owner = ERC721Upgradeable.ownerOf(tokenId);
return (spender == owner ||
isApprovedForAll(owner, spender) ||
getApproved(tokenId) == spender);
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId, 1);
// Check that tokenId was not minted by `_beforeTokenTransfer` hook
require(!_exists(tokenId), "ERC721: token already minted");
unchecked {
// Will not overflow unless all 2**256 token ids are minted to the same owner.
// Given that tokens are minted one by one, it is impossible in practice that
// this ever happens. Might change if we allow batch minting.
// The ERC fails to describe this case.
_balances[to] += 1;
}
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId, 1);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
* This is an internal function that does not check if the sender is authorized to operate on the token.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721Upgradeable.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId, 1);
// Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
owner = ERC721Upgradeable.ownerOf(tokenId);
// Clear approvals
delete _tokenApprovals[tokenId];
unchecked {
// Cannot overflow, as that would require more tokens to be burned/transferred
// out than the owner initially received through minting and transferring in.
_balances[owner] -= 1;
}
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), tokenId, 1);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(
ERC721Upgradeable.ownerOf(tokenId) == from,
"ERC721: transfer from incorrect owner"
);
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId, 1);
// Check that tokenId was not transferred by `_beforeTokenTransfer` hook
require(
ERC721Upgradeable.ownerOf(tokenId) == from,
"ERC721: transfer from incorrect owner"
);
// Clear approvals from the previous owner
delete _tokenApprovals[tokenId];
unchecked {
// `_balances[from]` cannot overflow for the same reason as described in `_burn`:
// `from`'s balance is the number of token held, which is at least one before the current
// transfer.
// `_balances[to]` could overflow in the conditions described in `_mint`. That would require
// all 2**256 token ids to be minted, which in practice is impossible.
_balances[from] -= 1;
_balances[to] += 1;
}
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId, 1);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits an {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Reverts if the `tokenId` has not been minted yet.
*/
function _requireMinted(uint256 tokenId) internal view virtual {
require(_exists(tokenId), "ERC721: invalid token ID");
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory data
) private returns (bool) {
if (to.isContract()) {
try
IERC721ReceiverUpgradeable(to).onERC721Received(
_msgSender(),
from,
tokenId,
data
)
returns (bytes4 retval) {
return
retval ==
IERC721ReceiverUpgradeable.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert(
"ERC721: transfer to non ERC721Receiver implementer"
);
} else {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is
* used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
* - When `from` is zero, the tokens will be minted for `to`.
* - When `to` is zero, ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
* - `batchSize` is non-zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 /* firstTokenId */,
uint256 batchSize
) internal virtual {
if (batchSize > 1) {
if (from != address(0)) {
_balances[from] -= batchSize;
}
if (to != address(0)) {
_balances[to] += batchSize;
}
}
}
/**
* @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
* used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
* - When `from` is zero, the tokens were minted for `to`.
* - When `to` is zero, ``from``'s tokens were burned.
* - `from` and `to` are never both zero.
* - `batchSize` is non-zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 firstTokenId,
uint256 batchSize
) 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[44] private __gap;
}
// File: @openzeppelin/[email protected]/token/ERC721/extensions/ERC721BurnableUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Burnable.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 Burnable Token
* @dev ERC721 Token that can be burned (destroyed).
*/
abstract contract ERC721BurnableUpgradeable is
Initializable,
ContextUpgradeable,
ERC721Upgradeable
{
function __ERC721Burnable_init() internal onlyInitializing {}
function __ERC721Burnable_init_unchained() internal onlyInitializing {}
/**
* @dev Burns `tokenId`. See {ERC721-_burn}.
*
* Requirements:
*
* - The caller must own `tokenId` or be an approved operator.
*/
function burn(uint256 tokenId) public virtual {
//solhint-disable-next-line max-line-length
require(
_isApprovedOrOwner(_msgSender(), tokenId),
"ERC721: caller is not token owner or approved"
);
_burn(tokenId);
}
/**
* @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/[email protected]/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/extensions/ERC721URIStorage.sol)
pragma solidity ^0.8.0;
interface IPriceOracle {
function getPrice(
bytes32 _pairKey
) external view returns (uint256 timestamp, uint256 price, uint8 decimals);
}
interface ExternalWallet {
function withdraw(address _to, uint256 _amount) external;
}
interface NftSvg {
function formatTokenURI(string memory _nftName, string memory _nftDescription, uint256 tokenId, uint16 level, DataNFT.LevelTrait[] memory levelTraits) external view returns (string memory);
}
/**
* @dev ERC721 token with storage based token URI management.
*/
abstract contract ERC721URIStorageUpgradeable is
Initializable,
ERC721Upgradeable
{
function __ERC721URIStorage_init() internal onlyInitializing {}
function __ERC721URIStorage_init_unchained() internal onlyInitializing {}
using StringsUpgradeable for uint256;
// Optional mapping for token URIs
mapping(uint256 => string) private _tokenURIs;
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(
uint256 tokenId
) public view virtual override returns (string memory) {
_requireMinted(tokenId);
string memory _tokenURI = _tokenURIs[tokenId];
string memory base = _baseURI();
// If there is no base URI, return the token URI.
if (bytes(base).length == 0) {
return _tokenURI;
}
// If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
if (bytes(_tokenURI).length > 0) {
return string(abi.encodePacked(base, _tokenURI));
}
return super.tokenURI(tokenId);
}
/**
* @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _setTokenURI(
uint256 tokenId,
string memory _tokenURI
) internal virtual {
require(
_exists(tokenId),
"ERC721URIStorage: URI set of nonexistent token"
);
_tokenURIs[tokenId] = _tokenURI;
}
/**
* @dev See {ERC721-_burn}. This override additionally checks to see if a
* token-specific URI was set for the token, and if so, it deletes the token URI from
* the storage mapping.
*/
function _burn(uint256 tokenId) internal virtual override {
super._burn(tokenId);
if (bytes(_tokenURIs[tokenId]).length != 0) {
delete _tokenURIs[tokenId];
}
}
/**
* @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: contract-219a6644d7.sol
pragma solidity ^0.8.9;
contract DataNFT is
Initializable,
ERC721Upgradeable,
ERC721URIStorageUpgradeable,
PausableUpgradeable,
AccessControlUpgradeable,
ERC721BurnableUpgradeable,
UUPSUpgradeable
{
using CountersUpgradeable for CountersUpgradeable.Counter;
bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
bytes32 public constant UPGRADER_ROLE = keccak256("UPGRADER_ROLE");
CountersUpgradeable.Counter private _tokenIdCounter;
uint8 public MAX_LEVEL = 4;
IPriceOracle public priceOracle;
ExternalWallet public vscWallet;
ExternalWallet public liquidityWallet;
NftSvg public nftGenerator;
bytes32 public constant VSC_KEY = keccak256(abi.encodePacked("VSC"));
uint256 public _nftMintUSDPrice;
string public _nftName;
string public _nftDescription;
address private _vscWallet;
address private _burnWallet;
address private _liquidityWallet;
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _rstatus;
struct LevelTrait {
string Key;
string Value;
}
struct Level {
LevelTrait[] LevelAttributes;
uint256 StakeRequired;
uint256 StakePeriod;
bool Status;
}
mapping(uint16 => Level) public Levels;
struct Stake {
uint16 Level;
uint256 Stake;
uint256 StakeUSD;
uint256 StakePeriod;
uint256 StakeTime;
}
mapping(uint256 => Stake) public Stakes;
mapping(address => bool) private blacklist;
mapping(uint256 => uint16) public nftLevel;
mapping(uint256 => string) public boundDevice;
event Minted(
address from,
address indexed to,
uint256 tokenId,
uint16 indexed level,
uint256 indexed stakedAmount
);
event Staked(
address indexed from,
uint256 indexed tokenId,
uint16 indexed level,
uint256 stakedAmount
);
event Unstaked(
address indexed from,
uint256 indexed tokenId,
uint16 indexed level,
uint256 stakedAmount
);
event MetadataUpdate(uint256 _tokenId);
event Blacklisted(address indexed user);
event UnBlacklisted(address indexed user);
event Bound(
address indexed from,
uint256 indexed tokenId,
string indexed device
);
event UnBound(address indexed from, uint256 indexed tokenId);
event VscBurned(uint256 amount);
constructor() {
_disableInitializers();
}
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
modifier notBlacklisted(address user) {
require(!blacklist[user], "User is blacklisted");
_;
}
modifier levelExists(uint16 level) {
require(Levels[level].StakeRequired > 0, "Level does not exist");
_;
}
modifier tokenExists(uint256 tokenId) {
require(_exists(tokenId), "Please use an existing token");
_;
}
modifier hasActiveStake(uint256 tokenId) {
require(Stakes[tokenId].Stake > 0, "No stake");
_;
}
function initialize(
string memory initName,
string memory initSymbol,
string memory description,
uint256 nftMintUSDPrice
) public initializer {
__ERC721_init(initName, initSymbol);
__ERC721URIStorage_init();
__Pausable_init();
__AccessControl_init();
__ERC721Burnable_init();
__UUPSUpgradeable_init();
_nftName = initName;
_nftDescription = description;
_nftMintUSDPrice = nftMintUSDPrice;
_tokenIdCounter._value = 1000000;
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(PAUSER_ROLE, msg.sender);
_grantRole(MINTER_ROLE, msg.sender);
_grantRole(UPGRADER_ROLE, msg.sender);
}
function pause() public onlyRole(PAUSER_ROLE) {
_pause();
}
function unpause() public onlyRole(PAUSER_ROLE) {
_unpause();
}
function updateMaxLevel(uint8 level) public onlyRole(DEFAULT_ADMIN_ROLE) {
MAX_LEVEL = level;
}
function currentTokenId() public view returns (uint256) {
return _tokenIdCounter.current();
}
function incrementTokenId() public onlyRole(MINTER_ROLE) {
_tokenIdCounter.increment();
}
function _nonReentrantBefore() private {
require(_rstatus != _ENTERED, "ReentrancyGuard: reentrant call");
_rstatus = _ENTERED;
}
function _nonReentrantAfter() private {
_rstatus = _NOT_ENTERED;
}
function _reentrancyGuardEntered() internal view returns (bool) {
return _rstatus == _ENTERED;
}
function updateVSCWallet(address _address) public onlyRole(DEFAULT_ADMIN_ROLE) {
_vscWallet = _address;
vscWallet = ExternalWallet(_address);
}
function updateLiquidityWallet(address _address) public onlyRole(DEFAULT_ADMIN_ROLE) {
_liquidityWallet = _address;
liquidityWallet = ExternalWallet(_address);
}
function updateBurnWallet(address _address) public onlyRole(DEFAULT_ADMIN_ROLE) {
_burnWallet = _address;
}
function updateNFTMetadata(string memory name, string memory description, uint256 nftPrice) public onlyRole(DEFAULT_ADMIN_ROLE) {
_nftName = name;
_nftDescription = description;
_nftMintUSDPrice = nftPrice;
}
function adminBurn(uint256 tokenId) public tokenExists(tokenId) onlyRole(MINTER_ROLE) {
_burn(tokenId);
}
function updateOracle(address _priceOracle) public onlyRole(DEFAULT_ADMIN_ROLE) {
priceOracle = IPriceOracle(_priceOracle);
}
function updateNFTGenerator(address _nftGenerator) public onlyRole(DEFAULT_ADMIN_ROLE) {
nftGenerator = NftSvg(_nftGenerator);
}
function updateLevel(uint16 levelId, uint256 _stakeRequired, uint256 _stakePeriod, bool _status, LevelTrait[] memory updatedTraits) public onlyRole(DEFAULT_ADMIN_ROLE) {
Levels[levelId].StakeRequired = _stakeRequired;
Levels[levelId].StakePeriod = _stakePeriod;
Levels[levelId].Status = _status;
delete Levels[levelId].LevelAttributes;
for (uint i = 0; i < updatedTraits.length; i++) {
Levels[levelId].LevelAttributes.push(updatedTraits[i]);
}
}
function removeLevel(uint16 levelId) public levelExists(levelId) {
delete Levels[levelId];
}
function getLevelDetails(uint16 level) public view levelExists(level) returns (Level memory) {
return Levels[level];
}
function getStakeDetails(uint256 tokenId) public view tokenExists(tokenId) returns (Stake memory) {
return Stakes[tokenId];
}
function getMintPriceInVSC() public view returns (uint256) {
(, uint256 priceUSD, ) = priceOracle.getPrice(VSC_KEY);
return (_nftMintUSDPrice / priceUSD) * 1e18;
}
function getLevelStakeRequired(uint256 tokenId, uint16 level) public view tokenExists(tokenId) levelExists(level) returns (uint256) {
(, uint256 priceUSD, ) = priceOracle.getPrice(VSC_KEY);
if (Stakes[tokenId].Stake > 0) {
require(Stakes[tokenId].Level < level, "Cannot stake at same level");
return ((Levels[level].StakeRequired - Levels[Stakes[tokenId].Level].StakeRequired) / priceUSD) * 1e18;
} else {
return (Levels[level].StakeRequired / priceUSD) * 1e18;
}
}
function getLevelStakeAmount(uint16 level, bool withMint) public view levelExists(level) returns (uint256) {
uint256 mintPriceVSC = 0;
if(withMint){
mintPriceVSC = getMintPriceInVSC();
}
(, uint256 priceUSD, ) = priceOracle.getPrice(VSC_KEY);
return ((Levels[level].StakeRequired / priceUSD) * 1e18) + mintPriceVSC;
}
function formatTokenURI(uint256 tokenId) public view returns (string memory) {
uint16 level = nftLevel[tokenId];
LevelTrait[] memory levelTraits = Levels[level].LevelAttributes;
return nftGenerator.formatTokenURI(_nftName, _nftDescription, tokenId, level, levelTraits);
}
function mint() public payable notBlacklisted(msg.sender) nonReentrant levelExists(0) {
uint256 mintPriceVSC = getMintPriceInVSC();
require(msg.value == mintPriceVSC, "Mismatching amount");
_burnMintingFee(msg.value);
_internalMint(msg.sender);
}
function mintAndStake(uint16 level) public payable notBlacklisted(msg.sender) nonReentrant levelExists(level) {
uint256 mintPriceVSC = getMintPriceInVSC();
uint256 vscStakeRequired = getLevelStakeAmount(level, false);
require(msg.value >= mintPriceVSC + vscStakeRequired, "Mismatching amount");
_burnMintingFee(mintPriceVSC);
_internalMintAndStake(msg.sender, vscStakeRequired, level, false);
}
function stake(uint256 tokenId, uint16 level) public payable levelExists(level) notBlacklisted(msg.sender) tokenExists(tokenId) nonReentrant {
uint256 vscStakeRequired = getLevelStakeRequired(tokenId, level);
require(msg.value >= vscStakeRequired, "Mismatching amount");
_internalStake(tokenId, level, vscStakeRequired, false);
}
function unstake(uint256 tokenId) public tokenExists(tokenId) nonReentrant hasActiveStake(tokenId) {
_internalUnstake(tokenId, msg.sender);
}
function _internalMint(address to) internal returns (uint256) {
uint256 tokenId = currentTokenId();
incrementTokenId();
_safeMint(to, tokenId);
nftLevel[tokenId] = 0;
return tokenId;
}
function _internalMintAndStake(address to, uint256 amount, uint16 level, bool isAdmin) internal returns (uint256) {
uint256 tokenId = _internalMint(to);
Level memory levelInfo = Levels[level];
Stakes[tokenId] = Stake(level, amount, levelInfo.StakeRequired, levelInfo.StakePeriod, block.timestamp);
if(!isAdmin) {
payable(_vscWallet).transfer(amount);
}
return tokenId;
}
function _internalStake(uint256 tokenId, uint16 level, uint256 amount, bool isAdmin) internal {
Stake storage stakeInfo = Stakes[tokenId];
Level memory levelInfo = Levels[level];
stakeInfo.Level = level;
stakeInfo.Stake += amount;
stakeInfo.StakeUSD = levelInfo.StakeRequired;
stakeInfo.StakePeriod = levelInfo.StakePeriod;
stakeInfo.StakeTime = block.timestamp;
nftLevel[tokenId] = level;
if(!isAdmin){
payable(_vscWallet).transfer(amount);
}
emit MetadataUpdate(tokenId);
emit Staked(msg.sender, tokenId, level, amount);
}
function _internalUnstake(uint256 tokenId, address to) internal {
Stake storage currentStake = Stakes[tokenId];
uint256 timePassed = block.timestamp - currentStake.StakeTime;
require(timePassed >= currentStake.StakePeriod, "Cannot Unstake");
uint256 stakedAmount = currentStake.Stake;
uint16 level = currentStake.Level;
delete Stakes[tokenId];
vscWallet.withdraw(to, stakedAmount);
nftLevel[tokenId] = 0;
emit MetadataUpdate(tokenId);
emit Unstaked(msg.sender, tokenId, level, stakedAmount);
}
function adminMint(address to, uint16 level, uint256 mintingFee) public onlyRole(MINTER_ROLE) {
if(mintingFee > 0){
(, uint256 priceUSD, ) = priceOracle.getPrice(VSC_KEY);
uint256 mintPriceVSC = (mintingFee / priceUSD) * 1e18;
liquidityWallet.withdraw(_burnWallet, mintPriceVSC);
}
uint256 vscStakeRequired = getLevelStakeAmount(level, false);
liquidityWallet.withdraw(_vscWallet, vscStakeRequired);
_internalMintAndStake(to, vscStakeRequired, level, true);
}
function adminStake(uint256 tokenId, uint16 level) public onlyRole(MINTER_ROLE) {
uint256 vscStakeRequired = getLevelStakeRequired(tokenId, level);
liquidityWallet.withdraw(_vscWallet, vscStakeRequired);
_internalStake(tokenId, level, vscStakeRequired, true);
}
function _burnMintingFee(uint256 amount) internal {
payable(_burnWallet).transfer(amount);
emit VscBurned(amount);
}
function blacklistUser(address user) public onlyRole(DEFAULT_ADMIN_ROLE) {
blacklist[user] = true;
emit Blacklisted(user);
}
function unBlacklistUser(address user) public onlyRole(DEFAULT_ADMIN_ROLE) {
blacklist[user] = false;
emit UnBlacklisted(user);
}
function bind(uint256 tokenId, string memory _macAddress) public onlyRole(MINTER_ROLE) tokenExists(tokenId) {
boundDevice[tokenId] = _macAddress;
emit Bound(msg.sender,tokenId, _macAddress);
}
function unbind(uint256 tokenId) public onlyRole(MINTER_ROLE) tokenExists(tokenId) {
delete boundDevice[tokenId];
emit UnBound(msg.sender, tokenId);
}
function canUnstake(uint256 tokenId) public view tokenExists(tokenId) returns (bool) {
Stake memory stakeInfo = Stakes[tokenId];
uint256 timePassed = block.timestamp - stakeInfo.StakeTime;
return timePassed >= stakeInfo.StakePeriod;
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId,
uint256 batchSize
) internal override whenNotPaused {
super._beforeTokenTransfer(from, to, tokenId, batchSize);
}
function _authorizeUpgrade(
address newImplementation
) internal override onlyRole(UPGRADER_ROLE) {}
function _burn(
uint256 tokenId
) internal override(ERC721Upgradeable, ERC721URIStorageUpgradeable) {
unbind(tokenId);
super._burn(tokenId);
}
function tokenURI(uint256 tokenId) public view override(ERC721Upgradeable, ERC721URIStorageUpgradeable) returns (string memory){
string memory uri = super.tokenURI(tokenId);
if (bytes(uri).length == 0) {
return formatTokenURI(tokenId);
}
return uri;
}
function supportsInterface(
bytes4 interfaceId
)
public
view
override(ERC721Upgradeable, AccessControlUpgradeable)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
function contractVersion() external pure virtual returns (uint256) {
return 1;
}
}
Contract ABI
[{"type":"constructor","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DEFAULT_ADMIN_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"StakeRequired","internalType":"uint256"},{"type":"uint256","name":"StakePeriod","internalType":"uint256"},{"type":"bool","name":"Status","internalType":"bool"}],"name":"Levels","inputs":[{"type":"uint16","name":"","internalType":"uint16"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"MAX_LEVEL","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"MINTER_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"PAUSER_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint16","name":"Level","internalType":"uint16"},{"type":"uint256","name":"Stake","internalType":"uint256"},{"type":"uint256","name":"StakeUSD","internalType":"uint256"},{"type":"uint256","name":"StakePeriod","internalType":"uint256"},{"type":"uint256","name":"StakeTime","internalType":"uint256"}],"name":"Stakes","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"UPGRADER_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"VSC_KEY","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"_nftDescription","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_nftMintUSDPrice","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"_nftName","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminBurn","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminMint","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint16","name":"level","internalType":"uint16"},{"type":"uint256","name":"mintingFee","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminStake","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"uint16","name":"level","internalType":"uint16"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"approve","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"bind","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"string","name":"_macAddress","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"blacklistUser","inputs":[{"type":"address","name":"user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"boundDevice","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burn","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"canUnstake","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"contractVersion","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"currentTokenId","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"formatTokenURI","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getApproved","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct DataNFT.Level","components":[{"type":"tuple[]","components":[{"type":"string"},{"type":"string"}]},{"type":"uint256"},{"type":"uint256"},{"type":"bool"}]}],"name":"getLevelDetails","inputs":[{"type":"uint16","name":"level","internalType":"uint16"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getLevelStakeAmount","inputs":[{"type":"uint16","name":"level","internalType":"uint16"},{"type":"bool","name":"withMint","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getLevelStakeRequired","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"uint16","name":"level","internalType":"uint16"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getMintPriceInVSC","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"getRoleAdmin","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct DataNFT.Stake","components":[{"type":"uint16"},{"type":"uint256"},{"type":"uint256"},{"type":"uint256"},{"type":"uint256"}]}],"name":"getStakeDetails","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"grantRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"incrementTokenId","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"string","name":"initName","internalType":"string"},{"type":"string","name":"initSymbol","internalType":"string"},{"type":"string","name":"description","internalType":"string"},{"type":"uint256","name":"nftMintUSDPrice","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isApprovedForAll","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"operator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract ExternalWallet"}],"name":"liquidityWallet","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"mint","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"mintAndStake","inputs":[{"type":"uint16","name":"level","internalType":"uint16"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract NftSvg"}],"name":"nftGenerator","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint16","name":"","internalType":"uint16"}],"name":"nftLevel","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"ownerOf","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IPriceOracle"}],"name":"priceOracle","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"proxiableUUID","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeLevel","inputs":[{"type":"uint16","name":"levelId","internalType":"uint16"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setApprovalForAll","inputs":[{"type":"address","name":"operator","internalType":"address"},{"type":"bool","name":"approved","internalType":"bool"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"stake","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"uint16","name":"level","internalType":"uint16"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"tokenURI","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unBlacklistUser","inputs":[{"type":"address","name":"user","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unbind","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unstake","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateBurnWallet","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateLevel","inputs":[{"type":"uint16","name":"levelId","internalType":"uint16"},{"type":"uint256","name":"_stakeRequired","internalType":"uint256"},{"type":"uint256","name":"_stakePeriod","internalType":"uint256"},{"type":"bool","name":"_status","internalType":"bool"},{"type":"tuple[]","name":"updatedTraits","internalType":"struct DataNFT.LevelTrait[]","components":[{"type":"string"},{"type":"string"}]}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateLiquidityWallet","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateMaxLevel","inputs":[{"type":"uint8","name":"level","internalType":"uint8"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateNFTGenerator","inputs":[{"type":"address","name":"_nftGenerator","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateNFTMetadata","inputs":[{"type":"string","name":"name","internalType":"string"},{"type":"string","name":"description","internalType":"string"},{"type":"uint256","name":"nftPrice","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateOracle","inputs":[{"type":"address","name":"_priceOracle","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateVSCWallet","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"upgradeTo","inputs":[{"type":"address","name":"newImplementation","internalType":"address"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"upgradeToAndCall","inputs":[{"type":"address","name":"newImplementation","internalType":"address"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract ExternalWallet"}],"name":"vscWallet","inputs":[]},{"type":"event","name":"AdminChanged","inputs":[{"type":"address","name":"previousAdmin","indexed":false},{"type":"address","name":"newAdmin","indexed":false}],"anonymous":false},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"address","name":"approved","indexed":true},{"type":"uint256","name":"tokenId","indexed":true}],"anonymous":false},{"type":"event","name":"ApprovalForAll","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"address","name":"operator","indexed":true},{"type":"bool","name":"approved","indexed":false}],"anonymous":false},{"type":"event","name":"BeaconUpgraded","inputs":[{"type":"address","name":"beacon","indexed":true}],"anonymous":false},{"type":"event","name":"Blacklisted","inputs":[{"type":"address","name":"user","indexed":true}],"anonymous":false},{"type":"event","name":"Bound","inputs":[{"type":"address","name":"from","indexed":true},{"type":"uint256","name":"tokenId","indexed":true},{"type":"string","name":"device","indexed":true}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"type":"uint8","name":"version","indexed":false}],"anonymous":false},{"type":"event","name":"MetadataUpdate","inputs":[{"type":"uint256","name":"_tokenId","indexed":false}],"anonymous":false},{"type":"event","name":"Minted","inputs":[{"type":"address","name":"from","indexed":false},{"type":"address","name":"to","indexed":true},{"type":"uint256","name":"tokenId","indexed":false},{"type":"uint16","name":"level","indexed":true},{"type":"uint256","name":"stakedAmount","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","indexed":false}],"anonymous":false},{"type":"event","name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"bytes32","name":"previousAdminRole","indexed":true},{"type":"bytes32","name":"newAdminRole","indexed":true}],"anonymous":false},{"type":"event","name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}],"anonymous":false},{"type":"event","name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}],"anonymous":false},{"type":"event","name":"Staked","inputs":[{"type":"address","name":"from","indexed":true},{"type":"uint256","name":"tokenId","indexed":true},{"type":"uint16","name":"level","indexed":true},{"type":"uint256","name":"stakedAmount","indexed":false}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","indexed":true},{"type":"address","name":"to","indexed":true},{"type":"uint256","name":"tokenId","indexed":true}],"anonymous":false},{"type":"event","name":"UnBlacklisted","inputs":[{"type":"address","name":"user","indexed":true}],"anonymous":false},{"type":"event","name":"UnBound","inputs":[{"type":"address","name":"from","indexed":true},{"type":"uint256","name":"tokenId","indexed":true}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","indexed":false}],"anonymous":false},{"type":"event","name":"Unstaked","inputs":[{"type":"address","name":"from","indexed":true},{"type":"uint256","name":"tokenId","indexed":true},{"type":"uint16","name":"level","indexed":true},{"type":"uint256","name":"stakedAmount","indexed":false}],"anonymous":false},{"type":"event","name":"Upgraded","inputs":[{"type":"address","name":"implementation","indexed":true}],"anonymous":false},{"type":"event","name":"VscBurned","inputs":[{"type":"uint256","name":"amount","indexed":false}],"anonymous":false}]
Contract Creation Code
0x60a0604052306080526101c4805460ff191660041790553480156200002357600080fd5b506200002e62000034565b620000f6565b600054610100900460ff1615620000a15760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000f4576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805161592c6200012e600039600081816117bb015281816117fb01528181611bef01528181611c2f0152611ce5015261592c6000f3fe6080604052600436106104255760003560e01c80638456cb5911610229578063badb97ff1161012e578063e0c9b0fb116100b6578063ec4ceae91161007a578063ec4ceae914610dad578063f54b46c814610dcd578063f72c0d8b14610ded578063fbda8d0814610e21578063fcbca45614610e3657600080fd5b8063e0c9b0fb14610ce2578063e37ba8f914610d02578063e38fd53114610d22578063e63ab1e914610d42578063e985e9c514610d6457600080fd5b8063c87b56dd116100fd578063c87b56dd14610c3f578063d469801614610c5f578063d539139314610c80578063d547741f14610ca2578063d6f082af14610cc257600080fd5b8063badb97ff14610ba3578063bec9869114610bc3578063c4eef79414610c08578063c61bd21414610c1f57600080fd5b8063a082a3b9116101b1578063a370381911610180578063a370381914610ab6578063a49062d414610b16578063a634fa5e14610b43578063b383938914610b63578063b88d4fde14610b8357600080fd5b8063a082a3b914610a4c578063a0a8e46014610a6d578063a217fddf14610a81578063a22cb46514610a9657600080fd5b806391d14854116101f857806391d148541461097157806395d89b4114610991578063963c9dd3146109a6578063994e5f7414610a0c5780639ffc30f414610a2c57600080fd5b80638456cb59146108d45780638dfdba8f146108e95780638eabc28b146109095780638f48b00e1461094457600080fd5b806334ca100e1161032f5780634f3130fa116102b75780635c975abb116102865780635c975abb146108475780636352211e1461085f5780636842ade41461087f57806370a082311461089f57806381c5420c146108bf57600080fd5b80634f3130fa146107e857806352d1902d146107fd578063543f764d146108125780635721421d1461082757600080fd5b806342842e0e116102fe57806342842e0e1461076257806342966c681461078257806342ea02c1146107a257806343572581146107b55780634f1ef286146107d557600080fd5b806334ca100e146106ed57806336568abe1461070d5780633659cfe61461072d5780633f4ba83a1461074d57600080fd5b80631cb44dfc116103b2578063295944241161038157806329594424146105fd5780632e17de78146106105780632f2ff15d14610630578063326008041461065057806334c763971461067057600080fd5b80631cb44dfc1461056757806323b872dd14610587578063248a9ca3146105a75780632630c12f146105d757600080fd5b8063095ea7b3116103f9578063095ea7b3146104dc5780630e69a488146104fe5780631249c58b1461051f57806312a2c9ed146105275780631c5d2b491461054757600080fd5b80629a9b7b1461042a57806301ffc9a71461045257806306fdde0314610482578063081812fc146104a4575b600080fd5b34801561043657600080fd5b5061043f610e56565b6040519081526020015b60405180910390f35b34801561045e57600080fd5b5061047261046d3660046149d7565b610e67565b6040519015158152602001610449565b34801561048e57600080fd5b50610497610e78565b6040516104499190614a44565b3480156104b057600080fd5b506104c46104bf366004614a57565b610f0a565b6040516001600160a01b039091168152602001610449565b3480156104e857600080fd5b506104fc6104f7366004614a8c565b610f31565b005b34801561050a57600080fd5b506101c7546104c4906001600160a01b031681565b6104fc61104b565b34801561053357600080fd5b5061043f610542366004614ad8565b61111b565b34801561055357600080fd5b506104fc610562366004614bf6565b611257565b34801561057357600080fd5b506104fc610582366004614c85565b611425565b34801561059357600080fd5b506104fc6105a2366004614ca0565b61145a565b3480156105b357600080fd5b5061043f6105c2366004614a57565b600090815260fb602052604090206001015490565b3480156105e357600080fd5b506101c4546104c49061010090046001600160a01b031681565b6104fc61060b366004614cdc565b61148c565b34801561061c57600080fd5b506104fc61062b366004614a57565b611568565b34801561063c57600080fd5b506104fc61064b366004614cf7565b6115f8565b34801561065c57600080fd5b506104fc61066b366004614c85565b61161d565b34801561067c57600080fd5b506106c061068b366004614a57565b6101d0602052600090815260409020805460018201546002830154600384015460049094015461ffff90931693919290919085565b6040805161ffff90961686526020860194909452928401919091526060830152608082015260a001610449565b3480156106f957600080fd5b506104fc610708366004614d1a565b611657565b34801561071957600080fd5b506104fc610728366004614cf7565b611737565b34801561073957600080fd5b506104fc610748366004614c85565b6117b1565b34801561075957600080fd5b506104fc61188d565b34801561076e57600080fd5b506104fc61077d366004614ca0565b6118ad565b34801561078e57600080fd5b506104fc61079d366004614a57565b6118c8565b6104fc6107b0366004614e81565b6118f6565b3480156107c157600080fd5b5061043f6107d0366004614e81565b6119d2565b6104fc6107e3366004614ea4565b611be5565b3480156107f457600080fd5b506104fc611cb1565b34801561080957600080fd5b5061043f611cd8565b34801561081e57600080fd5b50610497611d8b565b34801561083357600080fd5b50610497610842366004614a57565b611e1a565b34801561085357600080fd5b5060c95460ff16610472565b34801561086b57600080fd5b506104c461087a366004614a57565b61203f565b34801561088b57600080fd5b506104fc61089a366004614ef1565b61209f565b3480156108ab57600080fd5b5061043f6108ba366004614c85565b61213f565b3480156108cb57600080fd5b506104976121c5565b3480156108e057600080fd5b506104fc6121d3565b3480156108f557600080fd5b506104fc610904366004614e81565b6121f3565b34801561091557600080fd5b5061043f6040516256534360e81b60208201526023016040516020818303038152906040528051906020012081565b34801561095057600080fd5b5061096461095f366004614cdc565b612296565b6040516104499190614f9c565b34801561097d57600080fd5b5061047261098c366004614cf7565b6124c0565b34801561099d57600080fd5b506104976124eb565b3480156109b257600080fd5b506109c66109c1366004614a57565b6124fa565b6040516104499190600060a08201905061ffff83511682526020830151602083015260408301516040830152606083015160608301526080830151608083015292915050565b348015610a1857600080fd5b506104fc610a27366004614a57565b6125ab565b348015610a3857600080fd5b506104fc610a47366004614fe4565b612633565b348015610a5857600080fd5b506101c5546104c4906001600160a01b031681565b348015610a7957600080fd5b50600161043f565b348015610a8d57600080fd5b5061043f600081565b348015610aa257600080fd5b506104fc610ab1366004615010565b612814565b348015610ac257600080fd5b50610af9610ad1366004614cdc565b6101cf6020526000908152604090206001810154600282015460039092015490919060ff1683565b604080519384526020840192909252151590820152606001610449565b348015610b2257600080fd5b506101c454610b319060ff1681565b60405160ff9091168152602001610449565b348015610b4f57600080fd5b50610497610b5e366004614a57565b61281f565b348015610b6f57600080fd5b506104fc610b7e366004614c85565b612839565b348015610b8f57600080fd5b506104fc610b9e36600461502c565b612868565b348015610baf57600080fd5b506104fc610bbe366004614a57565b61289a565b348015610bcf57600080fd5b50610bf5610bde366004614a57565b6101d26020526000908152604090205461ffff1681565b60405161ffff9091168152602001610449565b348015610c1457600080fd5b5061043f6101c85481565b348015610c2b57600080fd5b50610472610c3a366004614a57565b6128e1565b348015610c4b57600080fd5b50610497610c5a366004614a57565b612978565b348015610c6b57600080fd5b506101c6546104c4906001600160a01b031681565b348015610c8c57600080fd5b5061043f6000805160206158d783398151915281565b348015610cae57600080fd5b506104fc610cbd366004614cf7565b6129a0565b348015610cce57600080fd5b506104fc610cdd3660046150a2565b6129c5565b348015610cee57600080fd5b506104fc610cfd366004614c85565b6129e8565b348015610d0e57600080fd5b506104fc610d1d366004614c85565b612a17565b348015610d2e57600080fd5b506104fc610d3d366004614cdc565b612a51565b348015610d4e57600080fd5b5061043f60008051602061589083398151915281565b348015610d7057600080fd5b50610472610d7f3660046150bf565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b348015610db957600080fd5b506104fc610dc8366004614c85565b612ac4565b348015610dd957600080fd5b506104fc610de83660046150e9565b612b1a565b348015610df957600080fd5b5061043f7f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e381565b348015610e2d57600080fd5b5061043f612b4a565b348015610e4257600080fd5b506104fc610e51366004614c85565b612c2b565b6000610e626101c35490565b905090565b6000610e7282612c84565b92915050565b606060658054610e8790615155565b80601f0160208091040260200160405190810160405280929190818152602001828054610eb390615155565b8015610f005780601f10610ed557610100808354040283529160200191610f00565b820191906000526020600020905b815481529060010190602001808311610ee357829003601f168201915b5050505050905090565b6000610f1582612ca9565b506000908152606960205260409020546001600160a01b031690565b6000610f3c8261203f565b9050806001600160a01b0316836001600160a01b031603610fae5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610fca5750610fca8133610d7f565b61103c5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610fa5565b6110468383612cf9565b505050565b3360008181526101d1602052604090205460ff161561107c5760405162461bcd60e51b8152600401610fa590615189565b611084612d67565b60008080526101cf6020527f2d2fc4bb6645508fe4969401c5a240a96cbb65595ed048afee4dd335456f01eb546110cd5760405162461bcd60e51b8152600401610fa5906151b6565b60006110d7612b4a565b90508034146110f85760405162461bcd60e51b8152600401610fa5906151e4565b61110134612dc2565b61110a33612e34565b50505061111860016101ce55565b50565b61ffff821660009081526101cf602052604081206001015483906111515760405162461bcd60e51b8152600401610fa5906151b6565b6000831561116457611161612b4a565b90505b6101c4546040516256534360e81b602082015260009161010090046001600160a01b0316906331d98b3f90602301604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016111c691815260200190565b606060405180830381865afa1580156111e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112079190615210565b5061ffff881660009081526101cf602052604090206001015490925083915061123190839061525f565b61124390670de0b6b3a7640000615281565b61124d9190615298565b9695505050505050565b600054610100900460ff16158080156112775750600054600160ff909116105b806112915750303b158015611291575060005460ff166001145b6112f45760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610fa5565b6000805460ff191660011790558015611317576000805461ff0019166101001790555b6113218585612e71565b611329612ea2565b611331612ecb565b611339612ea2565b611341612ea2565b611349612ea2565b6101c961135686826152f1565b506101ca61136484826152f1565b506101c8829055620f42406101c35561137e600033612efa565b61139660008051602061589083398151915233612efa565b6113ae6000805160206158d783398151915233612efa565b6113d87f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e333612efa565b801561141e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b600061143081612f80565b506101c480546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b611465335b82612f8a565b6114815760405162461bcd60e51b8152600401610fa5906153b0565b611046838383613008565b3360008181526101d1602052604090205460ff16156114bd5760405162461bcd60e51b8152600401610fa590615189565b6114c5612d67565b61ffff821660009081526101cf602052604090206001015482906114fb5760405162461bcd60e51b8152600401610fa5906151b6565b6000611505612b4a565b9050600061151485600061111b565b90506115208183615298565b34101561153f5760405162461bcd60e51b8152600401610fa5906151e4565b61154882612dc2565b6115553382876000613179565b5050505061156460016101ce55565b5050565b806115728161340d565b61158e5760405162461bcd60e51b8152600401610fa5906153fd565b611596612d67565b60008281526101d0602052604090206001015482906115e25760405162461bcd60e51b81526020600482015260086024820152674e6f207374616b6560c01b6044820152606401610fa5565b6115ec833361342a565b5061156460016101ce55565b600082815260fb602052604090206001015461161381612f80565b6110468383612efa565b600061162881612f80565b506101cb80546001600160a01b039092166001600160a01b031992831681179091556101c58054909216179055565b600061166281612f80565b61ffff861660009081526101cf60205260408120600181018790556002810186905560038101805460ff191686151517905561169d91614922565b60005b825181101561172e5761ffff871660009081526101cf6020526040902083518490839081106116d1576116d1615434565b6020908102919091018101518254600181018455600093845291909220825160029092020190819061170390826152f1565b506020820151600182019061171890826152f1565b50505080806117269061544a565b9150506116a0565b50505050505050565b6001600160a01b03811633146117a75760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610fa5565b61156482826135e3565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036117f95760405162461bcd60e51b8152600401610fa590615463565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611842600080516020615870833981519152546001600160a01b031690565b6001600160a01b0316146118685760405162461bcd60e51b8152600401610fa5906154af565b6118718161364a565b6040805160008082526020820190925261111891839190613674565b6000805160206158908339815191526118a581612f80565b6111186137df565b61104683838360405180602001604052806000815250612868565b6118d13361145f565b6118ed5760405162461bcd60e51b8152600401610fa5906153b0565b61111881613831565b61ffff811660009081526101cf6020526040902060010154819061192c5760405162461bcd60e51b8152600401610fa5906151b6565b3360008181526101d1602052604090205460ff161561195d5760405162461bcd60e51b8152600401610fa590615189565b836119678161340d565b6119835760405162461bcd60e51b8152600401610fa5906153fd565b61198b612d67565b600061199786866119d2565b9050803410156119b95760405162461bcd60e51b8152600401610fa5906151e4565b6119c68686836000613843565b5061141e60016101ce55565b6000826119de8161340d565b6119fa5760405162461bcd60e51b8152600401610fa5906153fd565b61ffff831660009081526101cf60205260409020600101548390611a305760405162461bcd60e51b8152600401610fa5906151b6565b6101c4546040516256534360e81b602082015260009161010090046001600160a01b0316906331d98b3f90602301604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611a9291815260200190565b606060405180830381865afa158015611aaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ad39190615210565b5060008881526101d06020526040902060010154909250159050611bba5760008681526101d0602052604090205461ffff808716911610611b565760405162461bcd60e51b815260206004820152601a60248201527f43616e6e6f74207374616b652061742073616d65206c6576656c0000000000006044820152606401610fa5565b60008681526101d0602090815260408083205461ffff90811684526101cf90925280832060019081015492891684529220909101548291611b96916154fb565b611ba0919061525f565b611bb290670de0b6b3a7640000615281565b935050611bdd565b61ffff851660009081526101cf6020526040902060010154611ba090829061525f565b505092915050565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003611c2d5760405162461bcd60e51b8152600401610fa590615463565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611c76600080516020615870833981519152546001600160a01b031690565b6001600160a01b031614611c9c5760405162461bcd60e51b8152600401610fa5906154af565b611ca58261364a565b61156482826001613674565b6000805160206158d7833981519152611cc981612f80565b6111186101c380546001019055565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611d785760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610fa5565b5060008051602061587083398151915290565b6101c98054611d9990615155565b80601f0160208091040260200160405190810160405280929190818152602001828054611dc590615155565b8015611e125780601f10611de757610100808354040283529160200191611e12565b820191906000526020600020905b815481529060010190602001808311611df557829003601f168201915b505050505081565b60008181526101d2602090815260408083205461ffff168084526101cf835281842080548351818602810186019094528084526060959294929392849084015b82821015611fb05783829060005260206000209060020201604051806040016040529081600082018054611e8d90615155565b80601f0160208091040260200160405190810160405280929190818152602001828054611eb990615155565b8015611f065780601f10611edb57610100808354040283529160200191611f06565b820191906000526020600020905b815481529060010190602001808311611ee957829003601f168201915b50505050508152602001600182018054611f1f90615155565b80601f0160208091040260200160405190810160405280929190818152602001828054611f4b90615155565b8015611f985780601f10611f6d57610100808354040283529160200191611f98565b820191906000526020600020905b815481529060010190602001808311611f7b57829003601f168201915b50505050508152505081526020019060010190611e5a565b50506101c754604051638c865df560e01b81529394506001600160a01b031692638c865df59250611ff291506101c9906101ca9089908890889060040161558b565b600060405180830381865afa15801561200f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261203791908101906155e0565b949350505050565b6000818152606760205260408120546001600160a01b031680610e725760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610fa5565b6000805160206158d78339815191526120b781612f80565b826120c18161340d565b6120dd5760405162461bcd60e51b8152600401610fa5906153fd565b60008481526101d3602052604090206120f684826152f1565b5082604051612105919061564d565b60405190819003812090859033907fc521d4c3b942e2404481c6db577caf883385a0d4f1603561ff1a46789332e48190600090a450505050565b60006001600160a01b0382166121a95760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610fa5565b506001600160a01b031660009081526068602052604090205490565b6101ca8054611d9990615155565b6000805160206158908339815191526121eb81612f80565b611118613b2a565b6000805160206158d783398151915261220b81612f80565b600061221784846119d2565b6101c6546101cb5460405163f3fef3a360e01b81526001600160a01b03918216600482015260248101849052929350169063f3fef3a390604401600060405180830381600087803b15801561226b57600080fd5b505af115801561227f573d6000803e3d6000fd5b505050506122908484836001613843565b50505050565b6122c360405180608001604052806060815260200160008152602001600081526020016000151581525090565b61ffff821660009081526101cf602052604090206001015482906122f95760405162461bcd60e51b8152600401610fa5906151b6565b61ffff831660009081526101cf602090815260408083208151815460a09481028201850190935260808101838152909491938593919285929185015b8282101561248b578382906000526020600020906002020160405180604001604052908160008201805461236890615155565b80601f016020809104026020016040519081016040528092919081815260200182805461239490615155565b80156123e15780601f106123b6576101008083540402835291602001916123e1565b820191906000526020600020905b8154815290600101906020018083116123c457829003601f168201915b505050505081526020016001820180546123fa90615155565b80601f016020809104026020016040519081016040528092919081815260200182805461242690615155565b80156124735780601f1061244857610100808354040283529160200191612473565b820191906000526020600020905b81548152906001019060200180831161245657829003601f168201915b50505050508152505081526020019060010190612335565b50505090825250600182015460208201526002820154604082015260039091015460ff16151560609091015291505b50919050565b600091825260fb602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060668054610e8790615155565b6125306040518060a00160405280600061ffff168152602001600081526020016000815260200160008152602001600081525090565b8161253a8161340d565b6125565760405162461bcd60e51b8152600401610fa5906153fd565b505060009081526101d06020908152604091829020825160a081018452815461ffff16815260018201549281019290925260028101549282019290925260038201546060820152600490910154608082015290565b6000805160206158d78339815191526125c381612f80565b816125cd8161340d565b6125e95760405162461bcd60e51b8152600401610fa5906153fd565b60008381526101d36020526040812061260191614943565b604051839033907fef385c7d2272ff9be52346e5241ea5c033a38a5b204ab614d08662e4bd96bb2290600090a3505050565b6000805160206158d783398151915261264b81612f80565b8115612786576101c4546040516256534360e81b602082015260009161010090046001600160a01b0316906331d98b3f90602301604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016126b391815260200190565b606060405180830381865afa1580156126d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126f49190615210565b50915060009050612705828561525f565b61271790670de0b6b3a7640000615281565b6101c6546101cc5460405163f3fef3a360e01b81526001600160a01b03918216600482015260248101849052929350169063f3fef3a390604401600060405180830381600087803b15801561276b57600080fd5b505af115801561277f573d6000803e3d6000fd5b5050505050505b600061279384600061111b565b6101c6546101cb5460405163f3fef3a360e01b81526001600160a01b03918216600482015260248101849052929350169063f3fef3a390604401600060405180830381600087803b1580156127e757600080fd5b505af11580156127fb573d6000803e3d6000fd5b5050505061280c8582866001613179565b505050505050565b611564338383613b67565b6101d36020526000908152604090208054611d9990615155565b600061284481612f80565b506101cc80546001600160a01b0319166001600160a01b0392909216919091179055565b6128723383612f8a565b61288e5760405162461bcd60e51b8152600401610fa5906153b0565b61229084848484613c35565b806128a48161340d565b6128c05760405162461bcd60e51b8152600401610fa5906153fd565b6000805160206158d78339815191526128d881612f80565b61104683613831565b6000816128ed8161340d565b6129095760405162461bcd60e51b8152600401610fa5906153fd565b60008381526101d060209081526040808320815160a081018352815461ffff16815260018201549381019390935260028101549183019190915260038101546060830152600401546080820181905290919061296590426154fb565b6060909201519091101592505050919050565b6060600061298583613c68565b90508051600003610e725761299983611e1a565b9392505050565b600082815260fb60205260409020600101546129bb81612f80565b61104683836135e3565b60006129d081612f80565b506101c4805460ff191660ff92909216919091179055565b60006129f381612f80565b506101c780546001600160a01b0319166001600160a01b0392909216919091179055565b6000612a2281612f80565b506101cd80546001600160a01b039092166001600160a01b031992831681179091556101c68054909216179055565b61ffff811660009081526101cf60205260409020600101548190612a875760405162461bcd60e51b8152600401610fa5906151b6565b61ffff821660009081526101cf6020526040812090612aa68282614922565b506000600182018190556002820155600301805460ff191690555050565b6000612acf81612f80565b6001600160a01b03821660008181526101d16020526040808220805460ff19169055517f117e3210bb9aa7d9baff172026820255c6f6c30ba8999d1c2fd88e2848137c4e9190a25050565b6000612b2581612f80565b6101c9612b3285826152f1565b506101ca612b4084826152f1565b50506101c8555050565b6000806101c460019054906101000a90046001600160a01b03166001600160a01b03166331d98b3f604051602001612b8b906256534360e81b815260030190565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401612bbf91815260200190565b606060405180830381865afa158015612bdc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c009190615210565b50915050806101c854612c13919061525f565b612c2590670de0b6b3a7640000615281565b91505090565b6000612c3681612f80565b6001600160a01b03821660008181526101d16020526040808220805460ff19166001179055517fffa4e6181777692565cf28528fc88fd1516ea86b56da075235fa575af6a4b8559190a25050565b60006001600160e01b03198216637965db0b60e01b1480610e725750610e7282613d70565b612cb28161340d565b6111185760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610fa5565b600081815260696020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612d2e8261203f565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60026101ce5403612dba5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610fa5565b60026101ce55565b6101cc546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015612dfd573d6000803e3d6000fd5b506040518181527fcc55fc2fff63b71d919070233c1eec846505535cba8c86764109152fc8d474b99060200160405180910390a150565b600080612e3f610e56565b9050612e49611cb1565b612e538382613dc0565b60008181526101d260205260409020805461ffff1916905592915050565b600054610100900460ff16612e985760405162461bcd60e51b8152600401610fa590615669565b6115648282613dda565b600054610100900460ff16612ec95760405162461bcd60e51b8152600401610fa590615669565b565b600054610100900460ff16612ef25760405162461bcd60e51b8152600401610fa590615669565b612ec9613e1a565b612f0482826124c0565b61156457600082815260fb602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612f3c3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6111188133613e4d565b600080612f968361203f565b9050806001600160a01b0316846001600160a01b03161480612fdd57506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b806120375750836001600160a01b0316612ff684610f0a565b6001600160a01b031614949350505050565b826001600160a01b031661301b8261203f565b6001600160a01b0316146130415760405162461bcd60e51b8152600401610fa5906156b4565b6001600160a01b0382166130a35760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610fa5565b6130b08383836001613ea6565b826001600160a01b03166130c38261203f565b6001600160a01b0316146130e95760405162461bcd60e51b8152600401610fa5906156b4565b600081815260696020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260688552838620805460001901905590871680865283862080546001019055868652606790945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60008061318586612e34565b61ffff851660009081526101cf602090815260408083208151815460a094810282018501909352608081018381529596509394909284928491879085015b8282101561331957838290600052602060002090600202016040518060400160405290816000820180546131f690615155565b80601f016020809104026020016040519081016040528092919081815260200182805461322290615155565b801561326f5780601f106132445761010080835404028352916020019161326f565b820191906000526020600020905b81548152906001019060200180831161325257829003601f168201915b5050505050815260200160018201805461328890615155565b80601f01602080910402602001604051908101604052809291908181526020018280546132b490615155565b80156133015780601f106132d657610100808354040283529160200191613301565b820191906000526020600020905b8154815290600101906020018083116132e457829003601f168201915b505050505081525050815260200190600101906131c3565b5050509082525060018281015460208084019190915260028085015460408086019190915260039586015460ff161515606095860152805160a08101825261ffff8d811682528185018f8152898601518385019081528a850151988401988952426080850190815260008e81526101d0909852949096209251835461ffff19169216919091178255519481019490945591519083015591519281019290925551600490910155905083613403576101cb546040516001600160a01b039091169087156108fc029088906000818181858888f19350505050158015613401573d6000803e3d6000fd5b505b5095945050505050565b6000908152606760205260409020546001600160a01b0316151590565b60008281526101d060205260408120600481015490919061344b90426154fb565b905081600301548110156134925760405162461bcd60e51b815260206004820152600e60248201526d43616e6e6f7420556e7374616b6560901b6044820152606401610fa5565b600182810154835460008781526101d06020526040808220805461ffff1916815594850182905560028501829055600385018290556004948501919091556101c554905163f3fef3a360e01b81526001600160a01b038881169582019590955260248101849052929361ffff9092169291169063f3fef3a390604401600060405180830381600087803b15801561352857600080fd5b505af115801561353c573d6000803e3d6000fd5b50505060008781526101d2602052604090819020805461ffff19169055517ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7915061358a9088815260200190565b60405180910390a18061ffff1686336001600160a01b03167fd99f2a3a2655a0c8f6cbfae020a25ff5eb0a4178090ec061c76dc767238eaef6856040516135d391815260200190565b60405180910390a4505050505050565b6135ed82826124c0565b1561156457600082815260fb602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b7f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e361156481612f80565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156136a75761104683613eba565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015613701575060408051601f3d908101601f191682019092526136fe918101906156f9565b60015b6137645760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610fa5565b60008051602061587083398151915281146137d35760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610fa5565b50611046838383613f56565b6137e7613f7b565b60c9805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b61383a816125ab565b61111881613fc4565b60008481526101d06020908152604080832061ffff871684526101cf83528184208251815460a095810282018601909452608081018481529295949093919284929091849190879085015b828210156139e457838290600052602060002090600202016040518060400160405290816000820180546138c190615155565b80601f01602080910402602001604051908101604052809291908181526020018280546138ed90615155565b801561393a5780601f1061390f5761010080835404028352916020019161393a565b820191906000526020600020905b81548152906001019060200180831161391d57829003601f168201915b5050505050815260200160018201805461395390615155565b80601f016020809104026020016040519081016040528092919081815260200182805461397f90615155565b80156139cc5780601f106139a1576101008083540402835291602001916139cc565b820191906000526020600020905b8154815290600101906020018083116139af57829003601f168201915b5050505050815250508152602001906001019061388e565b5050509082525060018281015460208301526002830154604083015260039092015460ff161515606090910152835461ffff191661ffff8816178455830180549192508591600090613a37908490615298565b90915550506020818101516002840155604080830151600385015542600485015560008881526101d29092529020805461ffff191661ffff871617905582613ab6576101cb546040516001600160a01b039091169085156108fc029086906000818181858888f19350505050158015613ab4573d6000803e3d6000fd5b505b6040518681527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a18461ffff1686336001600160a01b03167fc8ae0a10c859e25b53866f6791503bf282a4973dfbf22ab2321f3130afc2e120876040516135d391815260200190565b613b32614004565b60c9805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586138143390565b816001600160a01b0316836001600160a01b031603613bc85760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610fa5565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b613c40848484613008565b613c4c8484848461404a565b6122905760405162461bcd60e51b8152600401610fa590615712565b6060613c7382612ca9565b60008281526097602052604081208054613c8c90615155565b80601f0160208091040260200160405190810160405280929190818152602001828054613cb890615155565b8015613d055780601f10613cda57610100808354040283529160200191613d05565b820191906000526020600020905b815481529060010190602001808311613ce857829003601f168201915b505050505090506000613d2360408051602081019091526000815290565b90508051600003613d35575092915050565b815115613d67578082604051602001613d4f929190615764565b60405160208183030381529060405292505050919050565b61203784614148565b60006001600160e01b031982166380ac58cd60e01b1480613da157506001600160e01b03198216635b5e139f60e01b145b80610e7257506301ffc9a760e01b6001600160e01b0319831614610e72565b6115648282604051806020016040528060008152506141bb565b600054610100900460ff16613e015760405162461bcd60e51b8152600401610fa590615669565b6065613e0d83826152f1565b50606661104682826152f1565b600054610100900460ff16613e415760405162461bcd60e51b8152600401610fa590615669565b60c9805460ff19169055565b613e5782826124c0565b61156457613e64816141ee565b613e6f836020614200565b604051602001613e80929190615793565b60408051601f198184030181529082905262461bcd60e51b8252610fa591600401614a44565b613eae614004565b6122908484848461439b565b6001600160a01b0381163b613f275760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610fa5565b60008051602061587083398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b613f5f83614423565b600082511180613f6c5750805b15611046576122908383614463565b60c95460ff16612ec95760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610fa5565b613fcd81614557565b60008181526097602052604090208054613fe690615155565b15905061111857600081815260976020526040812061111891614943565b60c95460ff1615612ec95760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610fa5565b60006001600160a01b0384163b1561414057604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061408e903390899088908890600401615808565b6020604051808303816000875af19250505080156140c9575060408051601f3d908101601f191682019092526140c69181019061583b565b60015b614126573d8080156140f7576040519150601f19603f3d011682016040523d82523d6000602084013e6140fc565b606091505b50805160000361411e5760405162461bcd60e51b8152600401610fa590615712565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612037565b506001612037565b606061415382612ca9565b600061416a60408051602081019091526000815290565b9050600081511161418a5760405180602001604052806000815250612999565b80614194846145fa565b6040516020016141a5929190615764565b6040516020818303038152906040529392505050565b6141c5838361468c565b6141d2600084848461404a565b6110465760405162461bcd60e51b8152600401610fa590615712565b6060610e726001600160a01b03831660145b6060600061420f836002615281565b61421a906002615298565b6001600160401b0381111561423157614231614b0b565b6040519080825280601f01601f19166020018201604052801561425b576020820181803683370190505b509050600360fc1b8160008151811061427657614276615434565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106142a5576142a5615434565b60200101906001600160f81b031916908160001a90535060006142c9846002615281565b6142d4906001615298565b90505b600181111561434c576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061430857614308615434565b1a60f81b82828151811061431e5761431e615434565b60200101906001600160f81b031916908160001a90535060049490941c9361434581615858565b90506142d7565b5083156129995760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610fa5565b6001811115612290576001600160a01b038416156143e1576001600160a01b038416600090815260686020526040812080548392906143db9084906154fb565b90915550505b6001600160a01b03831615612290576001600160a01b03831660009081526068602052604081208054839290614418908490615298565b909155505050505050565b61442c81613eba565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6144cb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610fa5565b600080846001600160a01b0316846040516144e6919061564d565b600060405180830381855af49150503d8060008114614521576040519150601f19603f3d011682016040523d82523d6000602084013e614526565b606091505b509150915061454e82826040518060600160405280602781526020016158b060279139614807565b95945050505050565b60006145628261203f565b9050614572816000846001613ea6565b61457b8261203f565b600083815260696020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526068845282852080546000190190558785526067909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6060600061460783614820565b60010190506000816001600160401b0381111561462657614626614b0b565b6040519080825280601f01601f191660200182016040528015614650576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461465a57509392505050565b6001600160a01b0382166146e25760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610fa5565b6146eb8161340d565b156147385760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610fa5565b614746600083836001613ea6565b61474f8161340d565b1561479c5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610fa5565b6001600160a01b038216600081815260686020908152604080832080546001019055848352606790915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60608315614816575081612999565b61299983836148f8565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b831061485f5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061488b576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106148a957662386f26fc10000830492506010015b6305f5e10083106148c1576305f5e100830492506008015b61271083106148d557612710830492506004015b606483106148e7576064830492506002015b600a8310610e725760010192915050565b8151156149085781518083602001fd5b8060405162461bcd60e51b8152600401610fa59190614a44565b5080546000825560020290600052602060002090810190611118919061497d565b50805461494f90615155565b6000825580601f1061495f575050565b601f01602090049060005260206000209081019061111891906149ac565b808211156149a85760006149918282614943565b61499f600183016000614943565b5060020161497d565b5090565b5b808211156149a857600081556001016149ad565b6001600160e01b03198116811461111857600080fd5b6000602082840312156149e957600080fd5b8135612999816149c1565b60005b83811015614a0f5781810151838201526020016149f7565b50506000910152565b60008151808452614a308160208601602086016149f4565b601f01601f19169290920160200192915050565b6020815260006129996020830184614a18565b600060208284031215614a6957600080fd5b5035919050565b80356001600160a01b0381168114614a8757600080fd5b919050565b60008060408385031215614a9f57600080fd5b614aa883614a70565b946020939093013593505050565b803561ffff81168114614a8757600080fd5b80358015158114614a8757600080fd5b60008060408385031215614aeb57600080fd5b614af483614ab6565b9150614b0260208401614ac8565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715614b4357614b43614b0b565b60405290565b604051601f8201601f191681016001600160401b0381118282101715614b7157614b71614b0b565b604052919050565b60006001600160401b03821115614b9257614b92614b0b565b50601f01601f191660200190565b600082601f830112614bb157600080fd5b8135614bc4614bbf82614b79565b614b49565b818152846020838601011115614bd957600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215614c0c57600080fd5b84356001600160401b0380821115614c2357600080fd5b614c2f88838901614ba0565b95506020870135915080821115614c4557600080fd5b614c5188838901614ba0565b94506040870135915080821115614c6757600080fd5b50614c7487828801614ba0565b949793965093946060013593505050565b600060208284031215614c9757600080fd5b61299982614a70565b600080600060608486031215614cb557600080fd5b614cbe84614a70565b9250614ccc60208501614a70565b9150604084013590509250925092565b600060208284031215614cee57600080fd5b61299982614ab6565b60008060408385031215614d0a57600080fd5b82359150614b0260208401614a70565b600080600080600060a08688031215614d3257600080fd5b614d3b86614ab6565b94506020860135935060408601359250614d5760608701614ac8565b91506001600160401b038060808801351115614d7257600080fd5b6080870135870188601f820112614d8857600080fd5b8181351115614d9957614d99614b0b565b614da96020823560051b01614b49565b81358082526020808301929160051b8401018b1015614dc757600080fd5b602083015b6020843560051b850101811015614e6f578481351115614deb57600080fd5b803584016040818e03601f19011215614e0357600080fd5b614e0b614b21565b8660208301351115614e1c57600080fd5b614e2e8e602080850135850101614ba0565b81528660408301351115614e4157600080fd5b614e548e60206040850135850101614ba0565b60208201528085525050602083019250602081019050614dcc565b50809450505050509295509295909350565b60008060408385031215614e9457600080fd5b82359150614b0260208401614ab6565b60008060408385031215614eb757600080fd5b614ec083614a70565b915060208301356001600160401b03811115614edb57600080fd5b614ee785828601614ba0565b9150509250929050565b60008060408385031215614f0457600080fd5b8235915060208301356001600160401b03811115614edb57600080fd5b600081518084526020808501808196508360051b8101915082860160005b85811015614f8f578284038952815160408151818752614f6182880182614a18565b91505086820151915085810387870152614f7b8183614a18565b9a87019a9550505090840190600101614f3f565b5091979650505050505050565b602081526000825160806020840152614fb860a0840182614f21565b905060208401516040840152604084015160608401526060840151151560808401528091505092915050565b600080600060608486031215614ff957600080fd5b61500284614a70565b9250614ccc60208501614ab6565b6000806040838503121561502357600080fd5b614af483614a70565b6000806000806080858703121561504257600080fd5b61504b85614a70565b935061505960208601614a70565b92506040850135915060608501356001600160401b0381111561507b57600080fd5b61508787828801614ba0565b91505092959194509250565b60ff8116811461111857600080fd5b6000602082840312156150b457600080fd5b813561299981615093565b600080604083850312156150d257600080fd5b6150db83614a70565b9150614b0260208401614a70565b6000806000606084860312156150fe57600080fd5b83356001600160401b038082111561511557600080fd5b61512187838801614ba0565b9450602086013591508082111561513757600080fd5b5061514486828701614ba0565b925050604084013590509250925092565b600181811c9082168061516957607f821691505b6020821081036124ba57634e487b7160e01b600052602260045260246000fd5b602080825260139082015272155cd95c881a5cc8189b1858dadb1a5cdd1959606a1b604082015260600190565b60208082526014908201527313195d995b08191bd95cc81b9bdd08195e1a5cdd60621b604082015260600190565b602080825260129082015271135a5cdb585d18da1a5b99c8185b5bdd5b9d60721b604082015260600190565b60008060006060848603121561522557600080fd5b8351925060208401519150604084015161523e81615093565b809150509250925092565b634e487b7160e01b600052601160045260246000fd5b60008261527c57634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610e7257610e72615249565b80820180821115610e7257610e72615249565b601f82111561104657600081815260208120601f850160051c810160208610156152d25750805b601f850160051c820191505b8181101561280c578281556001016152de565b81516001600160401b0381111561530a5761530a614b0b565b61531e816153188454615155565b846152ab565b602080601f831160018114615353576000841561533b5750858301515b600019600386901b1c1916600185901b17855561280c565b600085815260208120601f198616915b8281101561538257888601518255948401946001909101908401615363565b50858210156153a05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b6020808252601c908201527f506c656173652075736520616e206578697374696e6720746f6b656e00000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006001820161545c5761545c615249565b5060010190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b81810381811115610e7257610e72615249565b6000815461551b81615155565b808552602060018381168015615538576001811461555257615580565b60ff1985168884015283151560051b880183019550615580565b866000528260002060005b858110156155785781548a820186015290830190840161555d565b890184019650505b505050505092915050565b60a08152600061559e60a083018861550e565b82810360208401526155b0818861550e565b905085604084015261ffff8516606084015282810360808401526155d48185614f21565b98975050505050505050565b6000602082840312156155f257600080fd5b81516001600160401b0381111561560857600080fd5b8201601f8101841361561957600080fd5b8051615627614bbf82614b79565b81815285602083850101111561563c57600080fd5b61454e8260208301602086016149f4565b6000825161565f8184602087016149f4565b9190910192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60006020828403121561570b57600080fd5b5051919050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600083516157768184602088016149f4565b83519083019061578a8183602088016149f4565b01949350505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516157cb8160178501602088016149f4565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516157fc8160288401602088016149f4565b01602801949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061124d90830184614a18565b60006020828403121561584d57600080fd5b8151612999816149c1565b60008161586757615867615249565b50600019019056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65649f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6a26469706673582212208fddacb7a74d90512ac86c83d6805483cfba6c9ecabcfc056a1888affc8861e064736f6c63430008110033
Deployed ByteCode
0x6080604052600436106104255760003560e01c80638456cb5911610229578063badb97ff1161012e578063e0c9b0fb116100b6578063ec4ceae91161007a578063ec4ceae914610dad578063f54b46c814610dcd578063f72c0d8b14610ded578063fbda8d0814610e21578063fcbca45614610e3657600080fd5b8063e0c9b0fb14610ce2578063e37ba8f914610d02578063e38fd53114610d22578063e63ab1e914610d42578063e985e9c514610d6457600080fd5b8063c87b56dd116100fd578063c87b56dd14610c3f578063d469801614610c5f578063d539139314610c80578063d547741f14610ca2578063d6f082af14610cc257600080fd5b8063badb97ff14610ba3578063bec9869114610bc3578063c4eef79414610c08578063c61bd21414610c1f57600080fd5b8063a082a3b9116101b1578063a370381911610180578063a370381914610ab6578063a49062d414610b16578063a634fa5e14610b43578063b383938914610b63578063b88d4fde14610b8357600080fd5b8063a082a3b914610a4c578063a0a8e46014610a6d578063a217fddf14610a81578063a22cb46514610a9657600080fd5b806391d14854116101f857806391d148541461097157806395d89b4114610991578063963c9dd3146109a6578063994e5f7414610a0c5780639ffc30f414610a2c57600080fd5b80638456cb59146108d45780638dfdba8f146108e95780638eabc28b146109095780638f48b00e1461094457600080fd5b806334ca100e1161032f5780634f3130fa116102b75780635c975abb116102865780635c975abb146108475780636352211e1461085f5780636842ade41461087f57806370a082311461089f57806381c5420c146108bf57600080fd5b80634f3130fa146107e857806352d1902d146107fd578063543f764d146108125780635721421d1461082757600080fd5b806342842e0e116102fe57806342842e0e1461076257806342966c681461078257806342ea02c1146107a257806343572581146107b55780634f1ef286146107d557600080fd5b806334ca100e146106ed57806336568abe1461070d5780633659cfe61461072d5780633f4ba83a1461074d57600080fd5b80631cb44dfc116103b2578063295944241161038157806329594424146105fd5780632e17de78146106105780632f2ff15d14610630578063326008041461065057806334c763971461067057600080fd5b80631cb44dfc1461056757806323b872dd14610587578063248a9ca3146105a75780632630c12f146105d757600080fd5b8063095ea7b3116103f9578063095ea7b3146104dc5780630e69a488146104fe5780631249c58b1461051f57806312a2c9ed146105275780631c5d2b491461054757600080fd5b80629a9b7b1461042a57806301ffc9a71461045257806306fdde0314610482578063081812fc146104a4575b600080fd5b34801561043657600080fd5b5061043f610e56565b6040519081526020015b60405180910390f35b34801561045e57600080fd5b5061047261046d3660046149d7565b610e67565b6040519015158152602001610449565b34801561048e57600080fd5b50610497610e78565b6040516104499190614a44565b3480156104b057600080fd5b506104c46104bf366004614a57565b610f0a565b6040516001600160a01b039091168152602001610449565b3480156104e857600080fd5b506104fc6104f7366004614a8c565b610f31565b005b34801561050a57600080fd5b506101c7546104c4906001600160a01b031681565b6104fc61104b565b34801561053357600080fd5b5061043f610542366004614ad8565b61111b565b34801561055357600080fd5b506104fc610562366004614bf6565b611257565b34801561057357600080fd5b506104fc610582366004614c85565b611425565b34801561059357600080fd5b506104fc6105a2366004614ca0565b61145a565b3480156105b357600080fd5b5061043f6105c2366004614a57565b600090815260fb602052604090206001015490565b3480156105e357600080fd5b506101c4546104c49061010090046001600160a01b031681565b6104fc61060b366004614cdc565b61148c565b34801561061c57600080fd5b506104fc61062b366004614a57565b611568565b34801561063c57600080fd5b506104fc61064b366004614cf7565b6115f8565b34801561065c57600080fd5b506104fc61066b366004614c85565b61161d565b34801561067c57600080fd5b506106c061068b366004614a57565b6101d0602052600090815260409020805460018201546002830154600384015460049094015461ffff90931693919290919085565b6040805161ffff90961686526020860194909452928401919091526060830152608082015260a001610449565b3480156106f957600080fd5b506104fc610708366004614d1a565b611657565b34801561071957600080fd5b506104fc610728366004614cf7565b611737565b34801561073957600080fd5b506104fc610748366004614c85565b6117b1565b34801561075957600080fd5b506104fc61188d565b34801561076e57600080fd5b506104fc61077d366004614ca0565b6118ad565b34801561078e57600080fd5b506104fc61079d366004614a57565b6118c8565b6104fc6107b0366004614e81565b6118f6565b3480156107c157600080fd5b5061043f6107d0366004614e81565b6119d2565b6104fc6107e3366004614ea4565b611be5565b3480156107f457600080fd5b506104fc611cb1565b34801561080957600080fd5b5061043f611cd8565b34801561081e57600080fd5b50610497611d8b565b34801561083357600080fd5b50610497610842366004614a57565b611e1a565b34801561085357600080fd5b5060c95460ff16610472565b34801561086b57600080fd5b506104c461087a366004614a57565b61203f565b34801561088b57600080fd5b506104fc61089a366004614ef1565b61209f565b3480156108ab57600080fd5b5061043f6108ba366004614c85565b61213f565b3480156108cb57600080fd5b506104976121c5565b3480156108e057600080fd5b506104fc6121d3565b3480156108f557600080fd5b506104fc610904366004614e81565b6121f3565b34801561091557600080fd5b5061043f6040516256534360e81b60208201526023016040516020818303038152906040528051906020012081565b34801561095057600080fd5b5061096461095f366004614cdc565b612296565b6040516104499190614f9c565b34801561097d57600080fd5b5061047261098c366004614cf7565b6124c0565b34801561099d57600080fd5b506104976124eb565b3480156109b257600080fd5b506109c66109c1366004614a57565b6124fa565b6040516104499190600060a08201905061ffff83511682526020830151602083015260408301516040830152606083015160608301526080830151608083015292915050565b348015610a1857600080fd5b506104fc610a27366004614a57565b6125ab565b348015610a3857600080fd5b506104fc610a47366004614fe4565b612633565b348015610a5857600080fd5b506101c5546104c4906001600160a01b031681565b348015610a7957600080fd5b50600161043f565b348015610a8d57600080fd5b5061043f600081565b348015610aa257600080fd5b506104fc610ab1366004615010565b612814565b348015610ac257600080fd5b50610af9610ad1366004614cdc565b6101cf6020526000908152604090206001810154600282015460039092015490919060ff1683565b604080519384526020840192909252151590820152606001610449565b348015610b2257600080fd5b506101c454610b319060ff1681565b60405160ff9091168152602001610449565b348015610b4f57600080fd5b50610497610b5e366004614a57565b61281f565b348015610b6f57600080fd5b506104fc610b7e366004614c85565b612839565b348015610b8f57600080fd5b506104fc610b9e36600461502c565b612868565b348015610baf57600080fd5b506104fc610bbe366004614a57565b61289a565b348015610bcf57600080fd5b50610bf5610bde366004614a57565b6101d26020526000908152604090205461ffff1681565b60405161ffff9091168152602001610449565b348015610c1457600080fd5b5061043f6101c85481565b348015610c2b57600080fd5b50610472610c3a366004614a57565b6128e1565b348015610c4b57600080fd5b50610497610c5a366004614a57565b612978565b348015610c6b57600080fd5b506101c6546104c4906001600160a01b031681565b348015610c8c57600080fd5b5061043f6000805160206158d783398151915281565b348015610cae57600080fd5b506104fc610cbd366004614cf7565b6129a0565b348015610cce57600080fd5b506104fc610cdd3660046150a2565b6129c5565b348015610cee57600080fd5b506104fc610cfd366004614c85565b6129e8565b348015610d0e57600080fd5b506104fc610d1d366004614c85565b612a17565b348015610d2e57600080fd5b506104fc610d3d366004614cdc565b612a51565b348015610d4e57600080fd5b5061043f60008051602061589083398151915281565b348015610d7057600080fd5b50610472610d7f3660046150bf565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b348015610db957600080fd5b506104fc610dc8366004614c85565b612ac4565b348015610dd957600080fd5b506104fc610de83660046150e9565b612b1a565b348015610df957600080fd5b5061043f7f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e381565b348015610e2d57600080fd5b5061043f612b4a565b348015610e4257600080fd5b506104fc610e51366004614c85565b612c2b565b6000610e626101c35490565b905090565b6000610e7282612c84565b92915050565b606060658054610e8790615155565b80601f0160208091040260200160405190810160405280929190818152602001828054610eb390615155565b8015610f005780601f10610ed557610100808354040283529160200191610f00565b820191906000526020600020905b815481529060010190602001808311610ee357829003601f168201915b5050505050905090565b6000610f1582612ca9565b506000908152606960205260409020546001600160a01b031690565b6000610f3c8261203f565b9050806001600160a01b0316836001600160a01b031603610fae5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610fca5750610fca8133610d7f565b61103c5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610fa5565b6110468383612cf9565b505050565b3360008181526101d1602052604090205460ff161561107c5760405162461bcd60e51b8152600401610fa590615189565b611084612d67565b60008080526101cf6020527f2d2fc4bb6645508fe4969401c5a240a96cbb65595ed048afee4dd335456f01eb546110cd5760405162461bcd60e51b8152600401610fa5906151b6565b60006110d7612b4a565b90508034146110f85760405162461bcd60e51b8152600401610fa5906151e4565b61110134612dc2565b61110a33612e34565b50505061111860016101ce55565b50565b61ffff821660009081526101cf602052604081206001015483906111515760405162461bcd60e51b8152600401610fa5906151b6565b6000831561116457611161612b4a565b90505b6101c4546040516256534360e81b602082015260009161010090046001600160a01b0316906331d98b3f90602301604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016111c691815260200190565b606060405180830381865afa1580156111e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112079190615210565b5061ffff881660009081526101cf602052604090206001015490925083915061123190839061525f565b61124390670de0b6b3a7640000615281565b61124d9190615298565b9695505050505050565b600054610100900460ff16158080156112775750600054600160ff909116105b806112915750303b158015611291575060005460ff166001145b6112f45760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610fa5565b6000805460ff191660011790558015611317576000805461ff0019166101001790555b6113218585612e71565b611329612ea2565b611331612ecb565b611339612ea2565b611341612ea2565b611349612ea2565b6101c961135686826152f1565b506101ca61136484826152f1565b506101c8829055620f42406101c35561137e600033612efa565b61139660008051602061589083398151915233612efa565b6113ae6000805160206158d783398151915233612efa565b6113d87f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e333612efa565b801561141e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b600061143081612f80565b506101c480546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b611465335b82612f8a565b6114815760405162461bcd60e51b8152600401610fa5906153b0565b611046838383613008565b3360008181526101d1602052604090205460ff16156114bd5760405162461bcd60e51b8152600401610fa590615189565b6114c5612d67565b61ffff821660009081526101cf602052604090206001015482906114fb5760405162461bcd60e51b8152600401610fa5906151b6565b6000611505612b4a565b9050600061151485600061111b565b90506115208183615298565b34101561153f5760405162461bcd60e51b8152600401610fa5906151e4565b61154882612dc2565b6115553382876000613179565b5050505061156460016101ce55565b5050565b806115728161340d565b61158e5760405162461bcd60e51b8152600401610fa5906153fd565b611596612d67565b60008281526101d0602052604090206001015482906115e25760405162461bcd60e51b81526020600482015260086024820152674e6f207374616b6560c01b6044820152606401610fa5565b6115ec833361342a565b5061156460016101ce55565b600082815260fb602052604090206001015461161381612f80565b6110468383612efa565b600061162881612f80565b506101cb80546001600160a01b039092166001600160a01b031992831681179091556101c58054909216179055565b600061166281612f80565b61ffff861660009081526101cf60205260408120600181018790556002810186905560038101805460ff191686151517905561169d91614922565b60005b825181101561172e5761ffff871660009081526101cf6020526040902083518490839081106116d1576116d1615434565b6020908102919091018101518254600181018455600093845291909220825160029092020190819061170390826152f1565b506020820151600182019061171890826152f1565b50505080806117269061544a565b9150506116a0565b50505050505050565b6001600160a01b03811633146117a75760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610fa5565b61156482826135e3565b6001600160a01b037f000000000000000000000000a98e73bb2f0f4d28e399cacb71b753ba5b2aa2d11630036117f95760405162461bcd60e51b8152600401610fa590615463565b7f000000000000000000000000a98e73bb2f0f4d28e399cacb71b753ba5b2aa2d16001600160a01b0316611842600080516020615870833981519152546001600160a01b031690565b6001600160a01b0316146118685760405162461bcd60e51b8152600401610fa5906154af565b6118718161364a565b6040805160008082526020820190925261111891839190613674565b6000805160206158908339815191526118a581612f80565b6111186137df565b61104683838360405180602001604052806000815250612868565b6118d13361145f565b6118ed5760405162461bcd60e51b8152600401610fa5906153b0565b61111881613831565b61ffff811660009081526101cf6020526040902060010154819061192c5760405162461bcd60e51b8152600401610fa5906151b6565b3360008181526101d1602052604090205460ff161561195d5760405162461bcd60e51b8152600401610fa590615189565b836119678161340d565b6119835760405162461bcd60e51b8152600401610fa5906153fd565b61198b612d67565b600061199786866119d2565b9050803410156119b95760405162461bcd60e51b8152600401610fa5906151e4565b6119c68686836000613843565b5061141e60016101ce55565b6000826119de8161340d565b6119fa5760405162461bcd60e51b8152600401610fa5906153fd565b61ffff831660009081526101cf60205260409020600101548390611a305760405162461bcd60e51b8152600401610fa5906151b6565b6101c4546040516256534360e81b602082015260009161010090046001600160a01b0316906331d98b3f90602301604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611a9291815260200190565b606060405180830381865afa158015611aaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ad39190615210565b5060008881526101d06020526040902060010154909250159050611bba5760008681526101d0602052604090205461ffff808716911610611b565760405162461bcd60e51b815260206004820152601a60248201527f43616e6e6f74207374616b652061742073616d65206c6576656c0000000000006044820152606401610fa5565b60008681526101d0602090815260408083205461ffff90811684526101cf90925280832060019081015492891684529220909101548291611b96916154fb565b611ba0919061525f565b611bb290670de0b6b3a7640000615281565b935050611bdd565b61ffff851660009081526101cf6020526040902060010154611ba090829061525f565b505092915050565b6001600160a01b037f000000000000000000000000a98e73bb2f0f4d28e399cacb71b753ba5b2aa2d1163003611c2d5760405162461bcd60e51b8152600401610fa590615463565b7f000000000000000000000000a98e73bb2f0f4d28e399cacb71b753ba5b2aa2d16001600160a01b0316611c76600080516020615870833981519152546001600160a01b031690565b6001600160a01b031614611c9c5760405162461bcd60e51b8152600401610fa5906154af565b611ca58261364a565b61156482826001613674565b6000805160206158d7833981519152611cc981612f80565b6111186101c380546001019055565b6000306001600160a01b037f000000000000000000000000a98e73bb2f0f4d28e399cacb71b753ba5b2aa2d11614611d785760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610fa5565b5060008051602061587083398151915290565b6101c98054611d9990615155565b80601f0160208091040260200160405190810160405280929190818152602001828054611dc590615155565b8015611e125780601f10611de757610100808354040283529160200191611e12565b820191906000526020600020905b815481529060010190602001808311611df557829003601f168201915b505050505081565b60008181526101d2602090815260408083205461ffff168084526101cf835281842080548351818602810186019094528084526060959294929392849084015b82821015611fb05783829060005260206000209060020201604051806040016040529081600082018054611e8d90615155565b80601f0160208091040260200160405190810160405280929190818152602001828054611eb990615155565b8015611f065780601f10611edb57610100808354040283529160200191611f06565b820191906000526020600020905b815481529060010190602001808311611ee957829003601f168201915b50505050508152602001600182018054611f1f90615155565b80601f0160208091040260200160405190810160405280929190818152602001828054611f4b90615155565b8015611f985780601f10611f6d57610100808354040283529160200191611f98565b820191906000526020600020905b815481529060010190602001808311611f7b57829003601f168201915b50505050508152505081526020019060010190611e5a565b50506101c754604051638c865df560e01b81529394506001600160a01b031692638c865df59250611ff291506101c9906101ca9089908890889060040161558b565b600060405180830381865afa15801561200f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261203791908101906155e0565b949350505050565b6000818152606760205260408120546001600160a01b031680610e725760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610fa5565b6000805160206158d78339815191526120b781612f80565b826120c18161340d565b6120dd5760405162461bcd60e51b8152600401610fa5906153fd565b60008481526101d3602052604090206120f684826152f1565b5082604051612105919061564d565b60405190819003812090859033907fc521d4c3b942e2404481c6db577caf883385a0d4f1603561ff1a46789332e48190600090a450505050565b60006001600160a01b0382166121a95760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610fa5565b506001600160a01b031660009081526068602052604090205490565b6101ca8054611d9990615155565b6000805160206158908339815191526121eb81612f80565b611118613b2a565b6000805160206158d783398151915261220b81612f80565b600061221784846119d2565b6101c6546101cb5460405163f3fef3a360e01b81526001600160a01b03918216600482015260248101849052929350169063f3fef3a390604401600060405180830381600087803b15801561226b57600080fd5b505af115801561227f573d6000803e3d6000fd5b505050506122908484836001613843565b50505050565b6122c360405180608001604052806060815260200160008152602001600081526020016000151581525090565b61ffff821660009081526101cf602052604090206001015482906122f95760405162461bcd60e51b8152600401610fa5906151b6565b61ffff831660009081526101cf602090815260408083208151815460a09481028201850190935260808101838152909491938593919285929185015b8282101561248b578382906000526020600020906002020160405180604001604052908160008201805461236890615155565b80601f016020809104026020016040519081016040528092919081815260200182805461239490615155565b80156123e15780601f106123b6576101008083540402835291602001916123e1565b820191906000526020600020905b8154815290600101906020018083116123c457829003601f168201915b505050505081526020016001820180546123fa90615155565b80601f016020809104026020016040519081016040528092919081815260200182805461242690615155565b80156124735780601f1061244857610100808354040283529160200191612473565b820191906000526020600020905b81548152906001019060200180831161245657829003601f168201915b50505050508152505081526020019060010190612335565b50505090825250600182015460208201526002820154604082015260039091015460ff16151560609091015291505b50919050565b600091825260fb602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060668054610e8790615155565b6125306040518060a00160405280600061ffff168152602001600081526020016000815260200160008152602001600081525090565b8161253a8161340d565b6125565760405162461bcd60e51b8152600401610fa5906153fd565b505060009081526101d06020908152604091829020825160a081018452815461ffff16815260018201549281019290925260028101549282019290925260038201546060820152600490910154608082015290565b6000805160206158d78339815191526125c381612f80565b816125cd8161340d565b6125e95760405162461bcd60e51b8152600401610fa5906153fd565b60008381526101d36020526040812061260191614943565b604051839033907fef385c7d2272ff9be52346e5241ea5c033a38a5b204ab614d08662e4bd96bb2290600090a3505050565b6000805160206158d783398151915261264b81612f80565b8115612786576101c4546040516256534360e81b602082015260009161010090046001600160a01b0316906331d98b3f90602301604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016126b391815260200190565b606060405180830381865afa1580156126d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126f49190615210565b50915060009050612705828561525f565b61271790670de0b6b3a7640000615281565b6101c6546101cc5460405163f3fef3a360e01b81526001600160a01b03918216600482015260248101849052929350169063f3fef3a390604401600060405180830381600087803b15801561276b57600080fd5b505af115801561277f573d6000803e3d6000fd5b5050505050505b600061279384600061111b565b6101c6546101cb5460405163f3fef3a360e01b81526001600160a01b03918216600482015260248101849052929350169063f3fef3a390604401600060405180830381600087803b1580156127e757600080fd5b505af11580156127fb573d6000803e3d6000fd5b5050505061280c8582866001613179565b505050505050565b611564338383613b67565b6101d36020526000908152604090208054611d9990615155565b600061284481612f80565b506101cc80546001600160a01b0319166001600160a01b0392909216919091179055565b6128723383612f8a565b61288e5760405162461bcd60e51b8152600401610fa5906153b0565b61229084848484613c35565b806128a48161340d565b6128c05760405162461bcd60e51b8152600401610fa5906153fd565b6000805160206158d78339815191526128d881612f80565b61104683613831565b6000816128ed8161340d565b6129095760405162461bcd60e51b8152600401610fa5906153fd565b60008381526101d060209081526040808320815160a081018352815461ffff16815260018201549381019390935260028101549183019190915260038101546060830152600401546080820181905290919061296590426154fb565b6060909201519091101592505050919050565b6060600061298583613c68565b90508051600003610e725761299983611e1a565b9392505050565b600082815260fb60205260409020600101546129bb81612f80565b61104683836135e3565b60006129d081612f80565b506101c4805460ff191660ff92909216919091179055565b60006129f381612f80565b506101c780546001600160a01b0319166001600160a01b0392909216919091179055565b6000612a2281612f80565b506101cd80546001600160a01b039092166001600160a01b031992831681179091556101c68054909216179055565b61ffff811660009081526101cf60205260409020600101548190612a875760405162461bcd60e51b8152600401610fa5906151b6565b61ffff821660009081526101cf6020526040812090612aa68282614922565b506000600182018190556002820155600301805460ff191690555050565b6000612acf81612f80565b6001600160a01b03821660008181526101d16020526040808220805460ff19169055517f117e3210bb9aa7d9baff172026820255c6f6c30ba8999d1c2fd88e2848137c4e9190a25050565b6000612b2581612f80565b6101c9612b3285826152f1565b506101ca612b4084826152f1565b50506101c8555050565b6000806101c460019054906101000a90046001600160a01b03166001600160a01b03166331d98b3f604051602001612b8b906256534360e81b815260030190565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401612bbf91815260200190565b606060405180830381865afa158015612bdc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c009190615210565b50915050806101c854612c13919061525f565b612c2590670de0b6b3a7640000615281565b91505090565b6000612c3681612f80565b6001600160a01b03821660008181526101d16020526040808220805460ff19166001179055517fffa4e6181777692565cf28528fc88fd1516ea86b56da075235fa575af6a4b8559190a25050565b60006001600160e01b03198216637965db0b60e01b1480610e725750610e7282613d70565b612cb28161340d565b6111185760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610fa5565b600081815260696020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612d2e8261203f565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60026101ce5403612dba5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610fa5565b60026101ce55565b6101cc546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015612dfd573d6000803e3d6000fd5b506040518181527fcc55fc2fff63b71d919070233c1eec846505535cba8c86764109152fc8d474b99060200160405180910390a150565b600080612e3f610e56565b9050612e49611cb1565b612e538382613dc0565b60008181526101d260205260409020805461ffff1916905592915050565b600054610100900460ff16612e985760405162461bcd60e51b8152600401610fa590615669565b6115648282613dda565b600054610100900460ff16612ec95760405162461bcd60e51b8152600401610fa590615669565b565b600054610100900460ff16612ef25760405162461bcd60e51b8152600401610fa590615669565b612ec9613e1a565b612f0482826124c0565b61156457600082815260fb602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612f3c3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6111188133613e4d565b600080612f968361203f565b9050806001600160a01b0316846001600160a01b03161480612fdd57506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b806120375750836001600160a01b0316612ff684610f0a565b6001600160a01b031614949350505050565b826001600160a01b031661301b8261203f565b6001600160a01b0316146130415760405162461bcd60e51b8152600401610fa5906156b4565b6001600160a01b0382166130a35760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610fa5565b6130b08383836001613ea6565b826001600160a01b03166130c38261203f565b6001600160a01b0316146130e95760405162461bcd60e51b8152600401610fa5906156b4565b600081815260696020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260688552838620805460001901905590871680865283862080546001019055868652606790945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60008061318586612e34565b61ffff851660009081526101cf602090815260408083208151815460a094810282018501909352608081018381529596509394909284928491879085015b8282101561331957838290600052602060002090600202016040518060400160405290816000820180546131f690615155565b80601f016020809104026020016040519081016040528092919081815260200182805461322290615155565b801561326f5780601f106132445761010080835404028352916020019161326f565b820191906000526020600020905b81548152906001019060200180831161325257829003601f168201915b5050505050815260200160018201805461328890615155565b80601f01602080910402602001604051908101604052809291908181526020018280546132b490615155565b80156133015780601f106132d657610100808354040283529160200191613301565b820191906000526020600020905b8154815290600101906020018083116132e457829003601f168201915b505050505081525050815260200190600101906131c3565b5050509082525060018281015460208084019190915260028085015460408086019190915260039586015460ff161515606095860152805160a08101825261ffff8d811682528185018f8152898601518385019081528a850151988401988952426080850190815260008e81526101d0909852949096209251835461ffff19169216919091178255519481019490945591519083015591519281019290925551600490910155905083613403576101cb546040516001600160a01b039091169087156108fc029088906000818181858888f19350505050158015613401573d6000803e3d6000fd5b505b5095945050505050565b6000908152606760205260409020546001600160a01b0316151590565b60008281526101d060205260408120600481015490919061344b90426154fb565b905081600301548110156134925760405162461bcd60e51b815260206004820152600e60248201526d43616e6e6f7420556e7374616b6560901b6044820152606401610fa5565b600182810154835460008781526101d06020526040808220805461ffff1916815594850182905560028501829055600385018290556004948501919091556101c554905163f3fef3a360e01b81526001600160a01b038881169582019590955260248101849052929361ffff9092169291169063f3fef3a390604401600060405180830381600087803b15801561352857600080fd5b505af115801561353c573d6000803e3d6000fd5b50505060008781526101d2602052604090819020805461ffff19169055517ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7915061358a9088815260200190565b60405180910390a18061ffff1686336001600160a01b03167fd99f2a3a2655a0c8f6cbfae020a25ff5eb0a4178090ec061c76dc767238eaef6856040516135d391815260200190565b60405180910390a4505050505050565b6135ed82826124c0565b1561156457600082815260fb602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b7f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e361156481612f80565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156136a75761104683613eba565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015613701575060408051601f3d908101601f191682019092526136fe918101906156f9565b60015b6137645760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610fa5565b60008051602061587083398151915281146137d35760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610fa5565b50611046838383613f56565b6137e7613f7b565b60c9805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b61383a816125ab565b61111881613fc4565b60008481526101d06020908152604080832061ffff871684526101cf83528184208251815460a095810282018601909452608081018481529295949093919284929091849190879085015b828210156139e457838290600052602060002090600202016040518060400160405290816000820180546138c190615155565b80601f01602080910402602001604051908101604052809291908181526020018280546138ed90615155565b801561393a5780601f1061390f5761010080835404028352916020019161393a565b820191906000526020600020905b81548152906001019060200180831161391d57829003601f168201915b5050505050815260200160018201805461395390615155565b80601f016020809104026020016040519081016040528092919081815260200182805461397f90615155565b80156139cc5780601f106139a1576101008083540402835291602001916139cc565b820191906000526020600020905b8154815290600101906020018083116139af57829003601f168201915b5050505050815250508152602001906001019061388e565b5050509082525060018281015460208301526002830154604083015260039092015460ff161515606090910152835461ffff191661ffff8816178455830180549192508591600090613a37908490615298565b90915550506020818101516002840155604080830151600385015542600485015560008881526101d29092529020805461ffff191661ffff871617905582613ab6576101cb546040516001600160a01b039091169085156108fc029086906000818181858888f19350505050158015613ab4573d6000803e3d6000fd5b505b6040518681527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a18461ffff1686336001600160a01b03167fc8ae0a10c859e25b53866f6791503bf282a4973dfbf22ab2321f3130afc2e120876040516135d391815260200190565b613b32614004565b60c9805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586138143390565b816001600160a01b0316836001600160a01b031603613bc85760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610fa5565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b613c40848484613008565b613c4c8484848461404a565b6122905760405162461bcd60e51b8152600401610fa590615712565b6060613c7382612ca9565b60008281526097602052604081208054613c8c90615155565b80601f0160208091040260200160405190810160405280929190818152602001828054613cb890615155565b8015613d055780601f10613cda57610100808354040283529160200191613d05565b820191906000526020600020905b815481529060010190602001808311613ce857829003601f168201915b505050505090506000613d2360408051602081019091526000815290565b90508051600003613d35575092915050565b815115613d67578082604051602001613d4f929190615764565b60405160208183030381529060405292505050919050565b61203784614148565b60006001600160e01b031982166380ac58cd60e01b1480613da157506001600160e01b03198216635b5e139f60e01b145b80610e7257506301ffc9a760e01b6001600160e01b0319831614610e72565b6115648282604051806020016040528060008152506141bb565b600054610100900460ff16613e015760405162461bcd60e51b8152600401610fa590615669565b6065613e0d83826152f1565b50606661104682826152f1565b600054610100900460ff16613e415760405162461bcd60e51b8152600401610fa590615669565b60c9805460ff19169055565b613e5782826124c0565b61156457613e64816141ee565b613e6f836020614200565b604051602001613e80929190615793565b60408051601f198184030181529082905262461bcd60e51b8252610fa591600401614a44565b613eae614004565b6122908484848461439b565b6001600160a01b0381163b613f275760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610fa5565b60008051602061587083398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b613f5f83614423565b600082511180613f6c5750805b15611046576122908383614463565b60c95460ff16612ec95760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610fa5565b613fcd81614557565b60008181526097602052604090208054613fe690615155565b15905061111857600081815260976020526040812061111891614943565b60c95460ff1615612ec95760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610fa5565b60006001600160a01b0384163b1561414057604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061408e903390899088908890600401615808565b6020604051808303816000875af19250505080156140c9575060408051601f3d908101601f191682019092526140c69181019061583b565b60015b614126573d8080156140f7576040519150601f19603f3d011682016040523d82523d6000602084013e6140fc565b606091505b50805160000361411e5760405162461bcd60e51b8152600401610fa590615712565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612037565b506001612037565b606061415382612ca9565b600061416a60408051602081019091526000815290565b9050600081511161418a5760405180602001604052806000815250612999565b80614194846145fa565b6040516020016141a5929190615764565b6040516020818303038152906040529392505050565b6141c5838361468c565b6141d2600084848461404a565b6110465760405162461bcd60e51b8152600401610fa590615712565b6060610e726001600160a01b03831660145b6060600061420f836002615281565b61421a906002615298565b6001600160401b0381111561423157614231614b0b565b6040519080825280601f01601f19166020018201604052801561425b576020820181803683370190505b509050600360fc1b8160008151811061427657614276615434565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106142a5576142a5615434565b60200101906001600160f81b031916908160001a90535060006142c9846002615281565b6142d4906001615298565b90505b600181111561434c576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061430857614308615434565b1a60f81b82828151811061431e5761431e615434565b60200101906001600160f81b031916908160001a90535060049490941c9361434581615858565b90506142d7565b5083156129995760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610fa5565b6001811115612290576001600160a01b038416156143e1576001600160a01b038416600090815260686020526040812080548392906143db9084906154fb565b90915550505b6001600160a01b03831615612290576001600160a01b03831660009081526068602052604081208054839290614418908490615298565b909155505050505050565b61442c81613eba565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6144cb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610fa5565b600080846001600160a01b0316846040516144e6919061564d565b600060405180830381855af49150503d8060008114614521576040519150601f19603f3d011682016040523d82523d6000602084013e614526565b606091505b509150915061454e82826040518060600160405280602781526020016158b060279139614807565b95945050505050565b60006145628261203f565b9050614572816000846001613ea6565b61457b8261203f565b600083815260696020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526068845282852080546000190190558785526067909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6060600061460783614820565b60010190506000816001600160401b0381111561462657614626614b0b565b6040519080825280601f01601f191660200182016040528015614650576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461465a57509392505050565b6001600160a01b0382166146e25760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610fa5565b6146eb8161340d565b156147385760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610fa5565b614746600083836001613ea6565b61474f8161340d565b1561479c5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610fa5565b6001600160a01b038216600081815260686020908152604080832080546001019055848352606790915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60608315614816575081612999565b61299983836148f8565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b831061485f5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061488b576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106148a957662386f26fc10000830492506010015b6305f5e10083106148c1576305f5e100830492506008015b61271083106148d557612710830492506004015b606483106148e7576064830492506002015b600a8310610e725760010192915050565b8151156149085781518083602001fd5b8060405162461bcd60e51b8152600401610fa59190614a44565b5080546000825560020290600052602060002090810190611118919061497d565b50805461494f90615155565b6000825580601f1061495f575050565b601f01602090049060005260206000209081019061111891906149ac565b808211156149a85760006149918282614943565b61499f600183016000614943565b5060020161497d565b5090565b5b808211156149a857600081556001016149ad565b6001600160e01b03198116811461111857600080fd5b6000602082840312156149e957600080fd5b8135612999816149c1565b60005b83811015614a0f5781810151838201526020016149f7565b50506000910152565b60008151808452614a308160208601602086016149f4565b601f01601f19169290920160200192915050565b6020815260006129996020830184614a18565b600060208284031215614a6957600080fd5b5035919050565b80356001600160a01b0381168114614a8757600080fd5b919050565b60008060408385031215614a9f57600080fd5b614aa883614a70565b946020939093013593505050565b803561ffff81168114614a8757600080fd5b80358015158114614a8757600080fd5b60008060408385031215614aeb57600080fd5b614af483614ab6565b9150614b0260208401614ac8565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715614b4357614b43614b0b565b60405290565b604051601f8201601f191681016001600160401b0381118282101715614b7157614b71614b0b565b604052919050565b60006001600160401b03821115614b9257614b92614b0b565b50601f01601f191660200190565b600082601f830112614bb157600080fd5b8135614bc4614bbf82614b79565b614b49565b818152846020838601011115614bd957600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215614c0c57600080fd5b84356001600160401b0380821115614c2357600080fd5b614c2f88838901614ba0565b95506020870135915080821115614c4557600080fd5b614c5188838901614ba0565b94506040870135915080821115614c6757600080fd5b50614c7487828801614ba0565b949793965093946060013593505050565b600060208284031215614c9757600080fd5b61299982614a70565b600080600060608486031215614cb557600080fd5b614cbe84614a70565b9250614ccc60208501614a70565b9150604084013590509250925092565b600060208284031215614cee57600080fd5b61299982614ab6565b60008060408385031215614d0a57600080fd5b82359150614b0260208401614a70565b600080600080600060a08688031215614d3257600080fd5b614d3b86614ab6565b94506020860135935060408601359250614d5760608701614ac8565b91506001600160401b038060808801351115614d7257600080fd5b6080870135870188601f820112614d8857600080fd5b8181351115614d9957614d99614b0b565b614da96020823560051b01614b49565b81358082526020808301929160051b8401018b1015614dc757600080fd5b602083015b6020843560051b850101811015614e6f578481351115614deb57600080fd5b803584016040818e03601f19011215614e0357600080fd5b614e0b614b21565b8660208301351115614e1c57600080fd5b614e2e8e602080850135850101614ba0565b81528660408301351115614e4157600080fd5b614e548e60206040850135850101614ba0565b60208201528085525050602083019250602081019050614dcc565b50809450505050509295509295909350565b60008060408385031215614e9457600080fd5b82359150614b0260208401614ab6565b60008060408385031215614eb757600080fd5b614ec083614a70565b915060208301356001600160401b03811115614edb57600080fd5b614ee785828601614ba0565b9150509250929050565b60008060408385031215614f0457600080fd5b8235915060208301356001600160401b03811115614edb57600080fd5b600081518084526020808501808196508360051b8101915082860160005b85811015614f8f578284038952815160408151818752614f6182880182614a18565b91505086820151915085810387870152614f7b8183614a18565b9a87019a9550505090840190600101614f3f565b5091979650505050505050565b602081526000825160806020840152614fb860a0840182614f21565b905060208401516040840152604084015160608401526060840151151560808401528091505092915050565b600080600060608486031215614ff957600080fd5b61500284614a70565b9250614ccc60208501614ab6565b6000806040838503121561502357600080fd5b614af483614a70565b6000806000806080858703121561504257600080fd5b61504b85614a70565b935061505960208601614a70565b92506040850135915060608501356001600160401b0381111561507b57600080fd5b61508787828801614ba0565b91505092959194509250565b60ff8116811461111857600080fd5b6000602082840312156150b457600080fd5b813561299981615093565b600080604083850312156150d257600080fd5b6150db83614a70565b9150614b0260208401614a70565b6000806000606084860312156150fe57600080fd5b83356001600160401b038082111561511557600080fd5b61512187838801614ba0565b9450602086013591508082111561513757600080fd5b5061514486828701614ba0565b925050604084013590509250925092565b600181811c9082168061516957607f821691505b6020821081036124ba57634e487b7160e01b600052602260045260246000fd5b602080825260139082015272155cd95c881a5cc8189b1858dadb1a5cdd1959606a1b604082015260600190565b60208082526014908201527313195d995b08191bd95cc81b9bdd08195e1a5cdd60621b604082015260600190565b602080825260129082015271135a5cdb585d18da1a5b99c8185b5bdd5b9d60721b604082015260600190565b60008060006060848603121561522557600080fd5b8351925060208401519150604084015161523e81615093565b809150509250925092565b634e487b7160e01b600052601160045260246000fd5b60008261527c57634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610e7257610e72615249565b80820180821115610e7257610e72615249565b601f82111561104657600081815260208120601f850160051c810160208610156152d25750805b601f850160051c820191505b8181101561280c578281556001016152de565b81516001600160401b0381111561530a5761530a614b0b565b61531e816153188454615155565b846152ab565b602080601f831160018114615353576000841561533b5750858301515b600019600386901b1c1916600185901b17855561280c565b600085815260208120601f198616915b8281101561538257888601518255948401946001909101908401615363565b50858210156153a05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b6020808252601c908201527f506c656173652075736520616e206578697374696e6720746f6b656e00000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006001820161545c5761545c615249565b5060010190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b81810381811115610e7257610e72615249565b6000815461551b81615155565b808552602060018381168015615538576001811461555257615580565b60ff1985168884015283151560051b880183019550615580565b866000528260002060005b858110156155785781548a820186015290830190840161555d565b890184019650505b505050505092915050565b60a08152600061559e60a083018861550e565b82810360208401526155b0818861550e565b905085604084015261ffff8516606084015282810360808401526155d48185614f21565b98975050505050505050565b6000602082840312156155f257600080fd5b81516001600160401b0381111561560857600080fd5b8201601f8101841361561957600080fd5b8051615627614bbf82614b79565b81815285602083850101111561563c57600080fd5b61454e8260208301602086016149f4565b6000825161565f8184602087016149f4565b9190910192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60006020828403121561570b57600080fd5b5051919050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600083516157768184602088016149f4565b83519083019061578a8183602088016149f4565b01949350505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516157cb8160178501602088016149f4565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516157fc8160288401602088016149f4565b01602801949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061124d90830184614a18565b60006020828403121561584d57600080fd5b8151612999816149c1565b60008161586757615867615249565b50600019019056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65649f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6a26469706673582212208fddacb7a74d90512ac86c83d6805483cfba6c9ecabcfc056a1888affc8861e064736f6c63430008110033