Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Initialize | 18158111 | 505 days ago | IN | 0 ETH | 0.0018087 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
PaymentPlan
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
No with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.21; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import { UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { IPaymentPlan } from "./interfaces/IPaymentPlan.sol"; interface AggregatorV3Interface { function latestAnswer() external view returns (int256); } /// @notice Payment Subscription Contract contract PaymentPlan is Initializable, UUPSUpgradeable, OwnableUpgradeable, IPaymentPlan { using SafeERC20 for IERC20; address private _teamWallet; uint256 private constant _BASIS_POINTS = 10_000; uint256 private constant _PAYMENT_BUFFER_PERCENTAGE = 9_500; uint256 private _referralFee; uint256 private constant _AGGREGATOR_DECIMALS = 1e8; AggregatorV3Interface internal dataFeed; mapping(string planId => Plan plan) public plans; mapping(string userId => Subscription subscription) public userSubscription; mapping(string code => address referrer) public referralToBeneficiary; mapping(address token => bool supported) public supportedTokens; function initialize(address team) public initializer { if (team == address(0)) revert NullAddress(team); _teamWallet = team; _referralFee = 500; dataFeed = AggregatorV3Interface( 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419 // Goerli: 0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e ); supportedTokens[0xdAC17F958D2ee523a2206206994597C13D831ec7] = true; // Goerli: 0xC2C527C0CACF457746Bd31B2a698Fe89de2b6d49 supportedTokens[0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48] = true; // Goerli: 0x07865c6E87B9F70255377e024ace6630C1Eaa37F supportedTokens[address(0)] = true; __Ownable_init(); } function _authorizeUpgrade(address) internal override onlyOwner {} function getLatestETHPrice() public view returns (int256) { int256 answer = dataFeed.latestAnswer(); return answer; } function subscribe(string calldata userId, string calldata invoice, string calldata planId, address token, string calldata code) external payable { if (!supportedTokens[token]) revert UnsupportedPaymentToken(token); Plan memory plan = plans[planId]; if (plan.price == 0) revert NonExistentPlan(planId); if (userSubscription[userId].expiration != 0) revert AlreadySubscribed(userId); bool paymentTokenIsEth = token == address(0); if (paymentTokenIsEth) { uint256 ethPrice = uint256(getLatestETHPrice()); uint256 minimumEth = (_PAYMENT_BUFFER_PERCENTAGE * (plan.price / (ethPrice / _AGGREGATOR_DECIMALS))) / _BASIS_POINTS; if (msg.value < minimumEth) revert NotEnoughFunds(msg.value); } address referral = referralToBeneficiary[code]; if (paymentTokenIsEth) { if (referral != address(0)) { (bool success, ) = referral.call{value: (msg.value * _referralFee) / _BASIS_POINTS}(""); if (!success) revert PaymentFailed(); } } else { uint256 totalTokensLeft = (plan.price / 1e18) * 1e6; if (referral != address(0)) { IERC20(token).safeTransferFrom(msg.sender, referral, (totalTokensLeft * _referralFee) / _BASIS_POINTS); totalTokensLeft = totalTokensLeft - (totalTokensLeft * _referralFee) / _BASIS_POINTS; } IERC20(token).safeTransferFrom(msg.sender, _teamWallet, totalTokensLeft); } uint128 expiryTime = uint128(block.timestamp) + plan.length; userSubscription[userId] = Subscription(plan, expiryTime); emit SubscriptionCreated(invoice, code, userId, expiryTime); } function renewSubscription(string calldata userId, string calldata invoice, string calldata planId, address token) external payable { if (!supportedTokens[token]) revert UnsupportedPaymentToken(token); Plan memory plan = plans[planId]; if (plan.price == 0) revert NonExistentPlan(planId); if (userSubscription[userId].expiration == 0) revert NotSubscribed(userId); bool paymentTokenIsEth = token == address(0); if (paymentTokenIsEth) { uint256 ethPrice = uint256(getLatestETHPrice()); uint256 minimumEth = (_PAYMENT_BUFFER_PERCENTAGE * (plan.price / (ethPrice / _AGGREGATOR_DECIMALS))) / _BASIS_POINTS; if (msg.value < minimumEth) revert NotEnoughFunds(msg.value); } else { uint256 totalTokensLeft = (plan.price / 1e18) * 1e6; IERC20(token).safeTransferFrom(msg.sender, _teamWallet, totalTokensLeft); } uint128 ts = uint128(block.timestamp); if (userSubscription[userId].expiration < ts) { userSubscription[userId] = Subscription(plan, plan.length + ts); } else { userSubscription[userId] = Subscription(plan, plan.length + userSubscription[userId].expiration); } emit SubscriptionExtended(invoice, userId, plan.length); } function registerReferral(string calldata code) external { if (bytes(code).length == 0) revert InvalidReferral(code); if (referralToBeneficiary[code] != address(0)) revert ReferralCodeTaken(code); referralToBeneficiary[code] = msg.sender; emit ReferralRegistered(msg.sender, code); } function setPlan(string calldata planId, Plan calldata plan) external onlyOwner { plans[planId] = plan; } function updateTeamWallet(address newWallet) external onlyOwner { if (newWallet == address(0)) revert NullAddress(newWallet); _teamWallet = newWallet; } function updateUserSubscription(string calldata userId, Subscription calldata newSubscription) external onlyOwner { userSubscription[userId] = newSubscription; } function updateReferralFee(uint256 newFee) external onlyOwner { if (newFee >= _BASIS_POINTS) revert FeeTooHigh(newFee); _referralFee = newFee; } function modifySupportedTokens(address token, bool supported) external onlyOwner { supportedTokens[token] = supported; } function withdraw(address token) external onlyOwner { if (token == address(0)) { (bool success, ) = _teamWallet.call{value: address(this).balance}(""); if (!success) revert WithdrawFailed(); } else { uint256 balance = IERC20(token).balanceOf(address(this)); if (balance == 0) revert WithdrawFailed(); else IERC20(token).safeTransfer(_teamWallet, balance); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @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; }
// SPDX-License-Identifier: MIT // 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol) pragma solidity ^0.8.0; /** * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC. * * _Available since v4.8.3._ */ interface IERC1967Upgradeable { /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Emitted when the beacon is changed. */ event BeaconUpgraded(address indexed beacon); }
// SPDX-License-Identifier: MIT // 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeaconUpgradeable.sol"; import "../../interfaces/IERC1967Upgradeable.sol"; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/StorageSlotUpgradeable.sol"; import "../utils/Initializable.sol"; /** * @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._ */ abstract contract ERC1967UpgradeUpgradeable is Initializable, IERC1967Upgradeable { function __ERC1967Upgrade_init() internal onlyInitializing { } function __ERC1967Upgrade_init_unchained() internal onlyInitializing { } // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { AddressUpgradeable.functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal { // Upgrades from old implementations will perform a rollback test. This test requires the new // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing // this special case will break upgrade paths from old UUPS implementation to new ones. if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else { try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) { require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID"); } catch { revert("ERC1967Upgrade: new implementation is not UUPS"); } _upgradeToAndCall(newImplementation, data, forceCall); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { AddressUpgradeable.functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), 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; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.0; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../ERC1967/ERC1967UpgradeUpgradeable.sol"; import "./Initializable.sol"; /** * @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. * * @custom:oz-upgrades-unsafe-allow-reachable delegatecall */ function upgradeTo(address newImplementation) public 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. * * @custom:oz-upgrades-unsafe-allow-reachable delegatecall */ function upgradeToAndCall(address newImplementation, bytes memory data) public 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; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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 * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @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, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(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); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ```solidity * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._ * _Available since v4.9 for `string`, `bytes`._ */ library StorageSlotUpgradeable { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } /** * @dev Returns an `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @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 * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @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, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(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); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.21; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /// @title IPaymentPlan Interface /// @notice Interface for the PaymentPlan contract interface IPaymentPlan { // Errors error NotSubscribed(string); error AlreadySubscribed(string); error InvalidReferral(string); error ReferralCodeTaken(string); error UnsupportedPaymentToken(address); error InvalidTimePeriod(uint8); error NullAddress(address); error NotEnoughFunds(uint256); error PaymentFailed(); error WithdrawFailed(); error FeeTooHigh(uint256); error NonExistentPlan(string); // Events event ReferralRegistered(address indexed beneficiary, string code); event SubscriptionExtended(string invoice, string indexed purchaser, uint128 indexed expiry); event SubscriptionCreated(string invoice, string code, string indexed purchaser, uint128 indexed expiry); // Structs struct Plan { uint128 price; uint128 length; } struct Subscription { Plan plan; uint128 expiration; } /// @notice Fetch the latest ETH price /// @return The latest ETH price function getLatestETHPrice() external view returns (int); /// @notice Subscribe or renew a subscription /// @param userId The invoice reference /// @param invoice The invoice reference /// @param planId The plan ID to subscribe /// @param token The token used for payment /// @param code The referral code (if any) function subscribe(string calldata userId, string calldata invoice, string calldata planId, address token, string calldata code) external payable; /// @notice Renew a subscription /// @param userId The user id to map the sub to /// @param invoice The invoice reference /// @param planId The plan ID to renew /// @param token The token used for payment function renewSubscription(string calldata userId, string calldata invoice, string calldata planId, address token) external payable; /// @notice Register a referral code /// @param code The referral code to register function registerReferral(string calldata code) external; /// @notice Set or update a plan /// @param planId The plan ID to set or update /// @param plan The details of the plan function setPlan(string calldata planId, Plan calldata plan) external; /// @notice Update the team wallet address /// @param newWallet The new team wallet address function updateTeamWallet(address newWallet) external; /// @notice Update a user's subscription /// @param userId The user id /// @param newSubscription The new subscription details function updateUserSubscription(string calldata userId, Subscription calldata newSubscription) external; /// @notice Update the referral fee percentage /// @param newFee The new fee percentage function updateReferralFee(uint256 newFee) external; /// @notice Withdraw funds (either ETH or tokens) /// @param token The token address or 0 for ETH function withdraw(address token) external; }
{ "evmVersion": "paris", "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"AlreadySubscribed","type":"error"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"FeeTooHigh","type":"error"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"InvalidReferral","type":"error"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"InvalidTimePeriod","type":"error"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"NonExistentPlan","type":"error"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"NotEnoughFunds","type":"error"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"NotSubscribed","type":"error"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"NullAddress","type":"error"},{"inputs":[],"name":"PaymentFailed","type":"error"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"ReferralCodeTaken","type":"error"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"UnsupportedPaymentToken","type":"error"},{"inputs":[],"name":"WithdrawFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"string","name":"code","type":"string"}],"name":"ReferralRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"invoice","type":"string"},{"indexed":false,"internalType":"string","name":"code","type":"string"},{"indexed":true,"internalType":"string","name":"purchaser","type":"string"},{"indexed":true,"internalType":"uint128","name":"expiry","type":"uint128"}],"name":"SubscriptionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"invoice","type":"string"},{"indexed":true,"internalType":"string","name":"purchaser","type":"string"},{"indexed":true,"internalType":"uint128","name":"expiry","type":"uint128"}],"name":"SubscriptionExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"getLatestETHPrice","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"team","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"bool","name":"supported","type":"bool"}],"name":"modifySupportedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"planId","type":"string"}],"name":"plans","outputs":[{"internalType":"uint128","name":"price","type":"uint128"},{"internalType":"uint128","name":"length","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"code","type":"string"}],"name":"referralToBeneficiary","outputs":[{"internalType":"address","name":"referrer","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"code","type":"string"}],"name":"registerReferral","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"userId","type":"string"},{"internalType":"string","name":"invoice","type":"string"},{"internalType":"string","name":"planId","type":"string"},{"internalType":"address","name":"token","type":"address"}],"name":"renewSubscription","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"planId","type":"string"},{"components":[{"internalType":"uint128","name":"price","type":"uint128"},{"internalType":"uint128","name":"length","type":"uint128"}],"internalType":"struct IPaymentPlan.Plan","name":"plan","type":"tuple"}],"name":"setPlan","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"userId","type":"string"},{"internalType":"string","name":"invoice","type":"string"},{"internalType":"string","name":"planId","type":"string"},{"internalType":"address","name":"token","type":"address"},{"internalType":"string","name":"code","type":"string"}],"name":"subscribe","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"supportedTokens","outputs":[{"internalType":"bool","name":"supported","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"updateReferralFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newWallet","type":"address"}],"name":"updateTeamWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"userId","type":"string"},{"components":[{"components":[{"internalType":"uint128","name":"price","type":"uint128"},{"internalType":"uint128","name":"length","type":"uint128"}],"internalType":"struct IPaymentPlan.Plan","name":"plan","type":"tuple"},{"internalType":"uint128","name":"expiration","type":"uint128"}],"internalType":"struct IPaymentPlan.Subscription","name":"newSubscription","type":"tuple"}],"name":"updateUserSubscription","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"userId","type":"string"}],"name":"userSubscription","outputs":[{"components":[{"internalType":"uint128","name":"price","type":"uint128"},{"internalType":"uint128","name":"length","type":"uint128"}],"internalType":"struct IPaymentPlan.Plan","name":"plan","type":"tuple"},{"internalType":"uint128","name":"expiration","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040523073ffffffffffffffffffffffffffffffffffffffff1660809073ffffffffffffffffffffffffffffffffffffffff1681525034801561004357600080fd5b5060805161455f61007b60003960008181610d2601528181610db401528181610eae01528181610f3c01526111fd015261455f6000f3fe60806040526004361061012a5760003560e01c8063715018a6116100ab578063aafad1ed1161006f578063aafad1ed146103c2578063c4b83741146103de578063c4d66de814610407578063ef5a6af014610430578063f2fde38b14610459578063f3f524b8146104825761012a565b8063715018a6146102ee578063777e0d86146103055780637cb332bb146103305780638da5cb5b14610359578063aa1d0410146103845761012a565b80633659cfe6116100f25780633659cfe6146102185780634f1ef2861461024157806351cff8d91461025d57806352d1902d1461028657806368c4ac26146102b15761012a565b806304ea59ea1461012f57806314d36ca2146101585780631cb12f74146101815780632321d03b1461019d5780632875b866146101da575b600080fd5b34801561013b57600080fd5b5061015660048036038101906101519190612ddf565b6104ab565b005b34801561016457600080fd5b5061017f600480360381019061017a9190612ea8565b61050e565b005b61019b60048036038101906101969190612f08565b61054b565b005b3480156101a957600080fd5b506101c460048036038101906101bf9190613112565b610c69565b6040516101d1919061316a565b60405180910390f35b3480156101e657600080fd5b5061020160048036038101906101fc9190613112565b610cb2565b60405161020f9291906131b0565b60405180910390f35b34801561022457600080fd5b5061023f600480360381019061023a91906131d9565b610d24565b005b61025b600480360381019061025691906132a7565b610eac565b005b34801561026957600080fd5b50610284600480360381019061027f91906131d9565b610fe8565b005b34801561029257600080fd5b5061029b6111f9565b6040516102a8919061331c565b60405180910390f35b3480156102bd57600080fd5b506102d860048036038101906102d391906131d9565b6112b2565b6040516102e59190613346565b60405180910390f35b3480156102fa57600080fd5b506103036112d2565b005b34801561031157600080fd5b5061031a6112e6565b604051610327919061337a565b60405180910390f35b34801561033c57600080fd5b50610357600480360381019061035291906131d9565b611383565b005b34801561036557600080fd5b5061036e611440565b60405161037b919061316a565b60405180910390f35b34801561039057600080fd5b506103ab60048036038101906103a69190613112565b61146a565b6040516103b99291906133d3565b60405180910390f35b6103dc60048036038101906103d791906133fc565b61155e565b005b3480156103ea57600080fd5b5061040560048036038101906104009190613517565b611c91565b005b34801561041357600080fd5b5061042e600480360381019061042991906131d9565b611cce565b005b34801561043c57600080fd5b5061045760048036038101906104529190613577565b61204d565b005b34801561046557600080fd5b50610480600480360381019061047b91906131d9565b6121fd565b005b34801561048e57600080fd5b506104a960048036038101906104a491906135fa565b612280565b005b6104b36122d8565b8060cf60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6105166122d8565b8060cd8484604051610529929190613657565b908152602001604051809103902081816105439190613836565b905050505050565b60cf60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166105d957806040517f23808a320000000000000000000000000000000000000000000000000000000081526004016105d0919061316a565b60405180910390fd5b600060cc84846040516105ed929190613657565b90815260200160405180910390206040518060400160405290816000820160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020016000820160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815250509050600081600001516fffffffffffffffffffffffffffffffff16036106f95783836040517f8ebb76710000000000000000000000000000000000000000000000000000000081526004016106f0929190613882565b60405180910390fd5b600060cd898960405161070d929190613657565b908152602001604051809103902060010160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16036107915787876040517f040a3bfa000000000000000000000000000000000000000000000000000000008152600401610788929190613882565b60405180910390fd5b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614905080156108715760006107d46112e6565b905060006127106305f5e100836107eb9190613904565b85600001516fffffffffffffffffffffffffffffffff1661080c9190613904565b61251c6108199190613935565b6108239190613904565b90508034101561086a57346040517f8228b9cb0000000000000000000000000000000000000000000000000000000081526004016108619190613986565b60405180910390fd5b50506108fe565b6000620f4240670de0b6b3a7640000846000015161088f91906139a1565b61089991906139d2565b6fffffffffffffffffffffffffffffffff1690506108fc3360c960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838773ffffffffffffffffffffffffffffffffffffffff16612356909392919063ffffffff16565b505b6000429050806fffffffffffffffffffffffffffffffff1660cd8b8b604051610928929190613657565b908152602001604051809103902060010160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff161015610a9457604051806040016040528084815260200182856020015161098f9190613a0f565b6fffffffffffffffffffffffffffffffff1681525060cd8b8b6040516109b6929190613657565b908152602001604051809103902060008201518160000160008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550505060208201518160010160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550905050610bf5565b604051806040016040528084815260200160cd8c8c604051610ab7929190613657565b908152602001604051809103902060010160009054906101000a90046fffffffffffffffffffffffffffffffff168560200151610af49190613a0f565b6fffffffffffffffffffffffffffffffff1681525060cd8b8b604051610b1b929190613657565b908152602001604051809103902060008201518160000160008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550505060208201518160010160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055509050505b82602001516fffffffffffffffffffffffffffffffff168a8a604051610c1c929190613657565b60405180910390207f4126e60a64b76461089477c35f624f4f7b1bb05a58666fcc5a69d9d7bd9cc89f8a8a604051610c55929190613882565b60405180910390a350505050505050505050565b60ce818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60cc818051602081018201805184825260208301602085012081835280955050505050506000915090508060000160009054906101000a90046fffffffffffffffffffffffffffffffff16908060000160109054906101000a90046fffffffffffffffffffffffffffffffff16905082565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1603610db2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da990613ac5565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16610df16123df565b73ffffffffffffffffffffffffffffffffffffffff1614610e47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3e90613b57565b60405180910390fd5b610e5081612436565b610ea981600067ffffffffffffffff811115610e6f57610e6e612fe7565b5b6040519080825280601f01601f191660200182016040528015610ea15781602001600182028036833780820191505090505b506000612441565b50565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1603610f3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3190613ac5565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16610f796123df565b73ffffffffffffffffffffffffffffffffffffffff1614610fcf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc690613b57565b60405180910390fd5b610fd882612436565b610fe482826001612441565b5050565b610ff06122d8565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036110ef57600060c960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff164760405161106c90613ba8565b60006040518083038185875af1925050503d80600081146110a9576040519150601f19603f3d011682016040523d82523d6000602084013e6110ae565b606091505b50509050806110e9576040517f750b219c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506111f6565b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161112a919061316a565b602060405180830381865afa158015611147573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116b9190613bd2565b9050600081036111a7576040517f750b219c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111f460c960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828473ffffffffffffffffffffffffffffffffffffffff166125af9092919063ffffffff16565b505b50565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614611289576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128090613c71565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b905090565b60cf6020528060005260406000206000915054906101000a900460ff1681565b6112da6122d8565b6112e46000612635565b565b60008060cb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166350d25bcd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611356573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137a9190613cbd565b90508091505090565b61138b6122d8565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036113fc57806040517f49fafa180000000000000000000000000000000000000000000000000000000081526004016113f3919061316a565b60405180910390fd5b8060c960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60cd81805160208101820180518482526020830160208501208183528095505050505050600091509050806000016040518060400160405290816000820160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020016000820160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681525050908060010160009054906101000a90046fffffffffffffffffffffffffffffffff16905082565b60cf60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166115ec57826040517f23808a320000000000000000000000000000000000000000000000000000000081526004016115e3919061316a565b60405180910390fd5b600060cc8686604051611600929190613657565b90815260200160405180910390206040518060400160405290816000820160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020016000820160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815250509050600081600001516fffffffffffffffffffffffffffffffff160361170c5785856040517f8ebb7671000000000000000000000000000000000000000000000000000000008152600401611703929190613882565b60405180910390fd5b600060cd8b8b604051611720929190613657565b908152602001604051809103902060010160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16146117a45789896040517f21b107d400000000000000000000000000000000000000000000000000000000815260040161179b929190613882565b60405180910390fd5b60008073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614905080156118805760006117e76112e6565b905060006127106305f5e100836117fe9190613904565b85600001516fffffffffffffffffffffffffffffffff1661181f9190613904565b61251c61182c9190613935565b6118369190613904565b90508034101561187d57346040517f8228b9cb0000000000000000000000000000000000000000000000000000000081526004016118749190613986565b60405180910390fd5b50505b600060ce8585604051611894929190613657565b908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081156119c357600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146119be5760008173ffffffffffffffffffffffffffffffffffffffff1661271060ca54346119299190613935565b6119339190613904565b60405161193f90613ba8565b60006040518083038185875af1925050503d806000811461197c576040519150601f19603f3d011682016040523d82523d6000602084013e611981565b606091505b50509050806119bc576040517ff499da2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b611af4565b6000620f4240670de0b6b3a764000085600001516119e191906139a1565b6119eb91906139d2565b6fffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611aa357611a7a338361271060ca5485611a499190613935565b611a539190613904565b8a73ffffffffffffffffffffffffffffffffffffffff16612356909392919063ffffffff16565b61271060ca5482611a8b9190613935565b611a959190613904565b81611aa09190613cea565b90505b611af23360c960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838a73ffffffffffffffffffffffffffffffffffffffff16612356909392919063ffffffff16565b505b6000836020015142611b069190613a0f565b90506040518060400160405280858152602001826fffffffffffffffffffffffffffffffff1681525060cd8e8e604051611b41929190613657565b908152602001604051809103902060008201518160000160008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550505060208201518160010160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550905050806fffffffffffffffffffffffffffffffff168d8d604051611c3d929190613657565b60405180910390207fecb6d5de48a7e6a58a2337fa66ce22738a4d9a70fad4730dcd3a0cf4e61582eb8d8d8a8a604051611c7a9493929190613d1e565b60405180910390a350505050505050505050505050565b611c996122d8565b8060cc8484604051611cac929190613657565b90815260200160405180910390208181611cc691906137ed565b905050505050565b60008060019054906101000a900460ff16159050808015611cff5750600160008054906101000a900460ff1660ff16105b80611d2c5750611d0e306126fb565b158015611d2b5750600160008054906101000a900460ff1660ff16145b5b611d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6290613dcb565b60405180910390fd5b60016000806101000a81548160ff021916908360ff1602179055508015611da8576001600060016101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611e1957816040517f49fafa18000000000000000000000000000000000000000000000000000000008152600401611e10919061316a565b60405180910390fd5b8160c960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101f460ca81905550735f4ec3df9cbd43714fe2740f5e3616155c5b841960cb60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160cf600073dac17f958d2ee523a2206206994597c13d831ec773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600160cf600073a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600160cf60008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611ff061271e565b80156120495760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249860016040516120409190613e33565b60405180910390a15b5050565b600082829050036120975781816040517fd3f9182200000000000000000000000000000000000000000000000000000000815260040161208e929190613882565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660ce83836040516120c1929190613657565b908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461214a5781816040517fba582251000000000000000000000000000000000000000000000000000000008152600401612141929190613882565b60405180910390fd5b3360ce838360405161215d929190613657565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167f79a86b4c4524bb1efe5d0f41282fada9d4697494d4e44e5fabeec124283a765a83836040516121f1929190613882565b60405180910390a25050565b6122056122d8565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612274576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226b90613ec0565b60405180910390fd5b61227d81612635565b50565b6122886122d8565b61271081106122ce57806040517f7b9314200000000000000000000000000000000000000000000000000000000081526004016122c59190613986565b60405180910390fd5b8060ca8190555050565b6122e0612777565b73ffffffffffffffffffffffffffffffffffffffff166122fe611440565b73ffffffffffffffffffffffffffffffffffffffff1614612354576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161234b90613f2c565b60405180910390fd5b565b6123d9846323b872dd60e01b85858560405160240161237793929190613f4c565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061277f565b50505050565b600061240d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b612847565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61243e6122d8565b50565b61246d7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914360001b612851565b60000160009054906101000a900460ff16156124915761248c8361285b565b6125aa565b8273ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156124f957506040513d601f19601f820116820180604052508101906124f69190613faf565b60015b612538576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161252f9061404e565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b811461259d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612594906140e0565b60405180910390fd5b506125a9838383612914565b5b505050565b6126308363a9059cbb60e01b84846040516024016125ce929190614100565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061277f565b505050565b6000609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081609760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600060019054906101000a900460ff1661276d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127649061419b565b60405180910390fd5b612775612940565b565b600033905090565b60006127e1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166129a19092919063ffffffff16565b905060008151148061280357508080602001905181019061280291906141d0565b5b612842576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128399061426f565b60405180910390fd5b505050565b6000819050919050565b6000819050919050565b612864816126fb565b6128a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161289a90614301565b60405180910390fd5b806128d07f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b612847565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61291d836129b9565b60008251118061292a5750805b1561293b576129398383612a08565b505b505050565b600060019054906101000a900460ff1661298f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129869061419b565b60405180910390fd5b61299f61299a612777565b612635565b565b60606129b08484600085612a35565b90509392505050565b6129c28161285b565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b6060612a2d838360405180606001604052806027815260200161450360279139612b02565b905092915050565b606082471015612a7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a7190614393565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051612aa39190614419565b60006040518083038185875af1925050503d8060008114612ae0576040519150601f19603f3d011682016040523d82523d6000602084013e612ae5565b606091505b5091509150612af687838387612b88565b92505050949350505050565b60606000808573ffffffffffffffffffffffffffffffffffffffff1685604051612b2c9190614419565b600060405180830381855af49150503d8060008114612b67576040519150601f19603f3d011682016040523d82523d6000602084013e612b6c565b606091505b5091509150612b7d86838387612bfd565b925050509392505050565b60608315612bea576000835103612be257612ba285612c72565b612be1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bd89061447c565b60405180910390fd5b5b829050612bf5565b612bf48383612c95565b5b949350505050565b60608315612c5f576000835103612c5757612c17856126fb565b612c56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c4d9061447c565b60405180910390fd5b5b829050612c6a565b612c698383612ce5565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600082511115612ca85781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cdc91906144e0565b60405180910390fd5b600082511115612cf85781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d2c91906144e0565b60405180910390fd5b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612d7482612d49565b9050919050565b612d8481612d69565b8114612d8f57600080fd5b50565b600081359050612da181612d7b565b92915050565b60008115159050919050565b612dbc81612da7565b8114612dc757600080fd5b50565b600081359050612dd981612db3565b92915050565b60008060408385031215612df657612df5612d3f565b5b6000612e0485828601612d92565b9250506020612e1585828601612dca565b9150509250929050565b600080fd5b600080fd5b600080fd5b60008083601f840112612e4457612e43612e1f565b5b8235905067ffffffffffffffff811115612e6157612e60612e24565b5b602083019150836001820283011115612e7d57612e7c612e29565b5b9250929050565b600080fd5b600060608284031215612e9f57612e9e612e84565b5b81905092915050565b600080600060808486031215612ec157612ec0612d3f565b5b600084013567ffffffffffffffff811115612edf57612ede612d44565b5b612eeb86828701612e2e565b93509350506020612efe86828701612e89565b9150509250925092565b60008060008060008060006080888a031215612f2757612f26612d3f565b5b600088013567ffffffffffffffff811115612f4557612f44612d44565b5b612f518a828b01612e2e565b9750975050602088013567ffffffffffffffff811115612f7457612f73612d44565b5b612f808a828b01612e2e565b9550955050604088013567ffffffffffffffff811115612fa357612fa2612d44565b5b612faf8a828b01612e2e565b93509350506060612fc28a828b01612d92565b91505092959891949750929550565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61301f82612fd6565b810181811067ffffffffffffffff8211171561303e5761303d612fe7565b5b80604052505050565b6000613051612d35565b905061305d8282613016565b919050565b600067ffffffffffffffff82111561307d5761307c612fe7565b5b61308682612fd6565b9050602081019050919050565b82818337600083830152505050565b60006130b56130b084613062565b613047565b9050828152602081018484840111156130d1576130d0612fd1565b5b6130dc848285613093565b509392505050565b600082601f8301126130f9576130f8612e1f565b5b81356131098482602086016130a2565b91505092915050565b60006020828403121561312857613127612d3f565b5b600082013567ffffffffffffffff81111561314657613145612d44565b5b613152848285016130e4565b91505092915050565b61316481612d69565b82525050565b600060208201905061317f600083018461315b565b92915050565b60006fffffffffffffffffffffffffffffffff82169050919050565b6131aa81613185565b82525050565b60006040820190506131c560008301856131a1565b6131d260208301846131a1565b9392505050565b6000602082840312156131ef576131ee612d3f565b5b60006131fd84828501612d92565b91505092915050565b600067ffffffffffffffff82111561322157613220612fe7565b5b61322a82612fd6565b9050602081019050919050565b600061324a61324584613206565b613047565b90508281526020810184848401111561326657613265612fd1565b5b613271848285613093565b509392505050565b600082601f83011261328e5761328d612e1f565b5b813561329e848260208601613237565b91505092915050565b600080604083850312156132be576132bd612d3f565b5b60006132cc85828601612d92565b925050602083013567ffffffffffffffff8111156132ed576132ec612d44565b5b6132f985828601613279565b9150509250929050565b6000819050919050565b61331681613303565b82525050565b6000602082019050613331600083018461330d565b92915050565b61334081612da7565b82525050565b600060208201905061335b6000830184613337565b92915050565b6000819050919050565b61337481613361565b82525050565b600060208201905061338f600083018461336b565b92915050565b61339e81613185565b82525050565b6040820160008201516133ba6000850182613395565b5060208201516133cd6020850182613395565b50505050565b60006060820190506133e860008301856133a4565b6133f560408301846131a1565b9392505050565b600080600080600080600080600060a08a8c03121561341e5761341d612d3f565b5b60008a013567ffffffffffffffff81111561343c5761343b612d44565b5b6134488c828d01612e2e565b995099505060208a013567ffffffffffffffff81111561346b5761346a612d44565b5b6134778c828d01612e2e565b975097505060408a013567ffffffffffffffff81111561349a57613499612d44565b5b6134a68c828d01612e2e565b955095505060606134b98c828d01612d92565b93505060808a013567ffffffffffffffff8111156134da576134d9612d44565b5b6134e68c828d01612e2e565b92509250509295985092959850929598565b60006040828403121561350e5761350d612e84565b5b81905092915050565b6000806000606084860312156135305761352f612d3f565b5b600084013567ffffffffffffffff81111561354e5761354d612d44565b5b61355a86828701612e2e565b9350935050602061356d868287016134f8565b9150509250925092565b6000806020838503121561358e5761358d612d3f565b5b600083013567ffffffffffffffff8111156135ac576135ab612d44565b5b6135b885828601612e2e565b92509250509250929050565b6000819050919050565b6135d7816135c4565b81146135e257600080fd5b50565b6000813590506135f4816135ce565b92915050565b6000602082840312156136105761360f612d3f565b5b600061361e848285016135e5565b91505092915050565b600081905092915050565b600061363e8385613627565b935061364b838584613093565b82840190509392505050565b6000613664828486613632565b91508190509392505050565b61367981613185565b811461368457600080fd5b50565b6000813561369481613670565b80915050919050565b60008160001b9050919050565b60006fffffffffffffffffffffffffffffffff6136c68461369d565b9350801983169250808416831791505092915050565b6000819050919050565b60006137016136fc6136f784613185565b6136dc565b613185565b9050919050565b6000819050919050565b61371b826136e6565b61372e61372782613708565b83546136aa565b8255505050565b60008160801b9050919050565b60007fffffffffffffffffffffffffffffffff0000000000000000000000000000000061376e84613735565b9350801983169250808416831791505092915050565b61378d826136e6565b6137a061379982613708565b8354613742565b8255505050565b6000810160008301806137b981613687565b90506137c58184613712565b5050506000810160208301806137da81613687565b90506137e68184613784565b5050505050565b6137f782826137a7565b5050565b60008101600083018061380e81846137ed565b50505060018101604083018061382381613687565b905061382f8184613712565b5050505050565b61384082826137fb565b5050565b600082825260208201905092915050565b60006138618385613844565b935061386e838584613093565b61387783612fd6565b840190509392505050565b6000602082019050818103600083015261389d818486613855565b90509392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061390f826135c4565b915061391a836135c4565b92508261392a576139296138a6565b5b828204905092915050565b6000613940826135c4565b915061394b836135c4565b9250828202613959816135c4565b915082820484148315176139705761396f6138d5565b5b5092915050565b613980816135c4565b82525050565b600060208201905061399b6000830184613977565b92915050565b60006139ac82613185565b91506139b783613185565b9250826139c7576139c66138a6565b5b828204905092915050565b60006139dd82613185565b91506139e883613185565b92508282026139f681613185565b9150808214613a0857613a076138d5565b5b5092915050565b6000613a1a82613185565b9150613a2583613185565b925082820190506fffffffffffffffffffffffffffffffff811115613a4d57613a4c6138d5565b5b92915050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f64656c656761746563616c6c0000000000000000000000000000000000000000602082015250565b6000613aaf602c83613844565b9150613aba82613a53565b604082019050919050565b60006020820190508181036000830152613ade81613aa2565b9050919050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f6163746976652070726f78790000000000000000000000000000000000000000602082015250565b6000613b41602c83613844565b9150613b4c82613ae5565b604082019050919050565b60006020820190508181036000830152613b7081613b34565b9050919050565b600081905092915050565b50565b6000613b92600083613b77565b9150613b9d82613b82565b600082019050919050565b6000613bb382613b85565b9150819050919050565b600081519050613bcc816135ce565b92915050565b600060208284031215613be857613be7612d3f565b5b6000613bf684828501613bbd565b91505092915050565b7f555550535570677261646561626c653a206d757374206e6f742062652063616c60008201527f6c6564207468726f7567682064656c656761746563616c6c0000000000000000602082015250565b6000613c5b603883613844565b9150613c6682613bff565b604082019050919050565b60006020820190508181036000830152613c8a81613c4e565b9050919050565b613c9a81613361565b8114613ca557600080fd5b50565b600081519050613cb781613c91565b92915050565b600060208284031215613cd357613cd2612d3f565b5b6000613ce184828501613ca8565b91505092915050565b6000613cf5826135c4565b9150613d00836135c4565b9250828203905081811115613d1857613d176138d5565b5b92915050565b60006040820190508181036000830152613d39818688613855565b90508181036020830152613d4e818486613855565b905095945050505050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000613db5602e83613844565b9150613dc082613d59565b604082019050919050565b60006020820190508181036000830152613de481613da8565b9050919050565b6000819050919050565b600060ff82169050919050565b6000613e1d613e18613e1384613deb565b6136dc565b613df5565b9050919050565b613e2d81613e02565b82525050565b6000602082019050613e486000830184613e24565b92915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613eaa602683613844565b9150613eb582613e4e565b604082019050919050565b60006020820190508181036000830152613ed981613e9d565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613f16602083613844565b9150613f2182613ee0565b602082019050919050565b60006020820190508181036000830152613f4581613f09565b9050919050565b6000606082019050613f61600083018661315b565b613f6e602083018561315b565b613f7b6040830184613977565b949350505050565b613f8c81613303565b8114613f9757600080fd5b50565b600081519050613fa981613f83565b92915050565b600060208284031215613fc557613fc4612d3f565b5b6000613fd384828501613f9a565b91505092915050565b7f45524331393637557067726164653a206e657720696d706c656d656e7461746960008201527f6f6e206973206e6f742055555053000000000000000000000000000000000000602082015250565b6000614038602e83613844565b915061404382613fdc565b604082019050919050565b600060208201905081810360008301526140678161402b565b9050919050565b7f45524331393637557067726164653a20756e737570706f727465642070726f7860008201527f6961626c65555549440000000000000000000000000000000000000000000000602082015250565b60006140ca602983613844565b91506140d58261406e565b604082019050919050565b600060208201905081810360008301526140f9816140bd565b9050919050565b6000604082019050614115600083018561315b565b6141226020830184613977565b9392505050565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b6000614185602b83613844565b915061419082614129565b604082019050919050565b600060208201905081810360008301526141b481614178565b9050919050565b6000815190506141ca81612db3565b92915050565b6000602082840312156141e6576141e5612d3f565b5b60006141f4848285016141bb565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000614259602a83613844565b9150614264826141fd565b604082019050919050565b600060208201905081810360008301526142888161424c565b9050919050565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b60006142eb602d83613844565b91506142f68261428f565b604082019050919050565b6000602082019050818103600083015261431a816142de565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b600061437d602683613844565b915061438882614321565b604082019050919050565b600060208201905081810360008301526143ac81614370565b9050919050565b600081519050919050565b60005b838110156143dc5780820151818401526020810190506143c1565b60008484015250505050565b60006143f3826143b3565b6143fd8185613b77565b935061440d8185602086016143be565b80840191505092915050565b600061442582846143e8565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000614466601d83613844565b915061447182614430565b602082019050919050565b6000602082019050818103600083015261449581614459565b9050919050565b600081519050919050565b60006144b28261449c565b6144bc8185613844565b93506144cc8185602086016143be565b6144d581612fd6565b840191505092915050565b600060208201905081810360008301526144fa81846144a7565b90509291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212209ececc40515d5f68232588cfb12eb46fb3ae71ffdff2819d1e804ee030e5dba064736f6c63430008150033
Deployed Bytecode
0x60806040526004361061012a5760003560e01c8063715018a6116100ab578063aafad1ed1161006f578063aafad1ed146103c2578063c4b83741146103de578063c4d66de814610407578063ef5a6af014610430578063f2fde38b14610459578063f3f524b8146104825761012a565b8063715018a6146102ee578063777e0d86146103055780637cb332bb146103305780638da5cb5b14610359578063aa1d0410146103845761012a565b80633659cfe6116100f25780633659cfe6146102185780634f1ef2861461024157806351cff8d91461025d57806352d1902d1461028657806368c4ac26146102b15761012a565b806304ea59ea1461012f57806314d36ca2146101585780631cb12f74146101815780632321d03b1461019d5780632875b866146101da575b600080fd5b34801561013b57600080fd5b5061015660048036038101906101519190612ddf565b6104ab565b005b34801561016457600080fd5b5061017f600480360381019061017a9190612ea8565b61050e565b005b61019b60048036038101906101969190612f08565b61054b565b005b3480156101a957600080fd5b506101c460048036038101906101bf9190613112565b610c69565b6040516101d1919061316a565b60405180910390f35b3480156101e657600080fd5b5061020160048036038101906101fc9190613112565b610cb2565b60405161020f9291906131b0565b60405180910390f35b34801561022457600080fd5b5061023f600480360381019061023a91906131d9565b610d24565b005b61025b600480360381019061025691906132a7565b610eac565b005b34801561026957600080fd5b50610284600480360381019061027f91906131d9565b610fe8565b005b34801561029257600080fd5b5061029b6111f9565b6040516102a8919061331c565b60405180910390f35b3480156102bd57600080fd5b506102d860048036038101906102d391906131d9565b6112b2565b6040516102e59190613346565b60405180910390f35b3480156102fa57600080fd5b506103036112d2565b005b34801561031157600080fd5b5061031a6112e6565b604051610327919061337a565b60405180910390f35b34801561033c57600080fd5b50610357600480360381019061035291906131d9565b611383565b005b34801561036557600080fd5b5061036e611440565b60405161037b919061316a565b60405180910390f35b34801561039057600080fd5b506103ab60048036038101906103a69190613112565b61146a565b6040516103b99291906133d3565b60405180910390f35b6103dc60048036038101906103d791906133fc565b61155e565b005b3480156103ea57600080fd5b5061040560048036038101906104009190613517565b611c91565b005b34801561041357600080fd5b5061042e600480360381019061042991906131d9565b611cce565b005b34801561043c57600080fd5b5061045760048036038101906104529190613577565b61204d565b005b34801561046557600080fd5b50610480600480360381019061047b91906131d9565b6121fd565b005b34801561048e57600080fd5b506104a960048036038101906104a491906135fa565b612280565b005b6104b36122d8565b8060cf60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6105166122d8565b8060cd8484604051610529929190613657565b908152602001604051809103902081816105439190613836565b905050505050565b60cf60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166105d957806040517f23808a320000000000000000000000000000000000000000000000000000000081526004016105d0919061316a565b60405180910390fd5b600060cc84846040516105ed929190613657565b90815260200160405180910390206040518060400160405290816000820160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020016000820160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815250509050600081600001516fffffffffffffffffffffffffffffffff16036106f95783836040517f8ebb76710000000000000000000000000000000000000000000000000000000081526004016106f0929190613882565b60405180910390fd5b600060cd898960405161070d929190613657565b908152602001604051809103902060010160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16036107915787876040517f040a3bfa000000000000000000000000000000000000000000000000000000008152600401610788929190613882565b60405180910390fd5b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614905080156108715760006107d46112e6565b905060006127106305f5e100836107eb9190613904565b85600001516fffffffffffffffffffffffffffffffff1661080c9190613904565b61251c6108199190613935565b6108239190613904565b90508034101561086a57346040517f8228b9cb0000000000000000000000000000000000000000000000000000000081526004016108619190613986565b60405180910390fd5b50506108fe565b6000620f4240670de0b6b3a7640000846000015161088f91906139a1565b61089991906139d2565b6fffffffffffffffffffffffffffffffff1690506108fc3360c960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838773ffffffffffffffffffffffffffffffffffffffff16612356909392919063ffffffff16565b505b6000429050806fffffffffffffffffffffffffffffffff1660cd8b8b604051610928929190613657565b908152602001604051809103902060010160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff161015610a9457604051806040016040528084815260200182856020015161098f9190613a0f565b6fffffffffffffffffffffffffffffffff1681525060cd8b8b6040516109b6929190613657565b908152602001604051809103902060008201518160000160008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550505060208201518160010160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550905050610bf5565b604051806040016040528084815260200160cd8c8c604051610ab7929190613657565b908152602001604051809103902060010160009054906101000a90046fffffffffffffffffffffffffffffffff168560200151610af49190613a0f565b6fffffffffffffffffffffffffffffffff1681525060cd8b8b604051610b1b929190613657565b908152602001604051809103902060008201518160000160008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550505060208201518160010160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055509050505b82602001516fffffffffffffffffffffffffffffffff168a8a604051610c1c929190613657565b60405180910390207f4126e60a64b76461089477c35f624f4f7b1bb05a58666fcc5a69d9d7bd9cc89f8a8a604051610c55929190613882565b60405180910390a350505050505050505050565b60ce818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60cc818051602081018201805184825260208301602085012081835280955050505050506000915090508060000160009054906101000a90046fffffffffffffffffffffffffffffffff16908060000160109054906101000a90046fffffffffffffffffffffffffffffffff16905082565b7f0000000000000000000000000196d76ae4bd8638c884ce17fb4e20ba7fd4e5f873ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1603610db2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da990613ac5565b60405180910390fd5b7f0000000000000000000000000196d76ae4bd8638c884ce17fb4e20ba7fd4e5f873ffffffffffffffffffffffffffffffffffffffff16610df16123df565b73ffffffffffffffffffffffffffffffffffffffff1614610e47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3e90613b57565b60405180910390fd5b610e5081612436565b610ea981600067ffffffffffffffff811115610e6f57610e6e612fe7565b5b6040519080825280601f01601f191660200182016040528015610ea15781602001600182028036833780820191505090505b506000612441565b50565b7f0000000000000000000000000196d76ae4bd8638c884ce17fb4e20ba7fd4e5f873ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1603610f3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3190613ac5565b60405180910390fd5b7f0000000000000000000000000196d76ae4bd8638c884ce17fb4e20ba7fd4e5f873ffffffffffffffffffffffffffffffffffffffff16610f796123df565b73ffffffffffffffffffffffffffffffffffffffff1614610fcf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc690613b57565b60405180910390fd5b610fd882612436565b610fe482826001612441565b5050565b610ff06122d8565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036110ef57600060c960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff164760405161106c90613ba8565b60006040518083038185875af1925050503d80600081146110a9576040519150601f19603f3d011682016040523d82523d6000602084013e6110ae565b606091505b50509050806110e9576040517f750b219c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506111f6565b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161112a919061316a565b602060405180830381865afa158015611147573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116b9190613bd2565b9050600081036111a7576040517f750b219c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111f460c960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828473ffffffffffffffffffffffffffffffffffffffff166125af9092919063ffffffff16565b505b50565b60007f0000000000000000000000000196d76ae4bd8638c884ce17fb4e20ba7fd4e5f873ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614611289576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128090613c71565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b905090565b60cf6020528060005260406000206000915054906101000a900460ff1681565b6112da6122d8565b6112e46000612635565b565b60008060cb60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166350d25bcd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611356573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137a9190613cbd565b90508091505090565b61138b6122d8565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036113fc57806040517f49fafa180000000000000000000000000000000000000000000000000000000081526004016113f3919061316a565b60405180910390fd5b8060c960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60cd81805160208101820180518482526020830160208501208183528095505050505050600091509050806000016040518060400160405290816000820160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020016000820160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681525050908060010160009054906101000a90046fffffffffffffffffffffffffffffffff16905082565b60cf60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166115ec57826040517f23808a320000000000000000000000000000000000000000000000000000000081526004016115e3919061316a565b60405180910390fd5b600060cc8686604051611600929190613657565b90815260200160405180910390206040518060400160405290816000820160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020016000820160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815250509050600081600001516fffffffffffffffffffffffffffffffff160361170c5785856040517f8ebb7671000000000000000000000000000000000000000000000000000000008152600401611703929190613882565b60405180910390fd5b600060cd8b8b604051611720929190613657565b908152602001604051809103902060010160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16146117a45789896040517f21b107d400000000000000000000000000000000000000000000000000000000815260040161179b929190613882565b60405180910390fd5b60008073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614905080156118805760006117e76112e6565b905060006127106305f5e100836117fe9190613904565b85600001516fffffffffffffffffffffffffffffffff1661181f9190613904565b61251c61182c9190613935565b6118369190613904565b90508034101561187d57346040517f8228b9cb0000000000000000000000000000000000000000000000000000000081526004016118749190613986565b60405180910390fd5b50505b600060ce8585604051611894929190613657565b908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081156119c357600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146119be5760008173ffffffffffffffffffffffffffffffffffffffff1661271060ca54346119299190613935565b6119339190613904565b60405161193f90613ba8565b60006040518083038185875af1925050503d806000811461197c576040519150601f19603f3d011682016040523d82523d6000602084013e611981565b606091505b50509050806119bc576040517ff499da2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b611af4565b6000620f4240670de0b6b3a764000085600001516119e191906139a1565b6119eb91906139d2565b6fffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611aa357611a7a338361271060ca5485611a499190613935565b611a539190613904565b8a73ffffffffffffffffffffffffffffffffffffffff16612356909392919063ffffffff16565b61271060ca5482611a8b9190613935565b611a959190613904565b81611aa09190613cea565b90505b611af23360c960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838a73ffffffffffffffffffffffffffffffffffffffff16612356909392919063ffffffff16565b505b6000836020015142611b069190613a0f565b90506040518060400160405280858152602001826fffffffffffffffffffffffffffffffff1681525060cd8e8e604051611b41929190613657565b908152602001604051809103902060008201518160000160008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550505060208201518160010160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550905050806fffffffffffffffffffffffffffffffff168d8d604051611c3d929190613657565b60405180910390207fecb6d5de48a7e6a58a2337fa66ce22738a4d9a70fad4730dcd3a0cf4e61582eb8d8d8a8a604051611c7a9493929190613d1e565b60405180910390a350505050505050505050505050565b611c996122d8565b8060cc8484604051611cac929190613657565b90815260200160405180910390208181611cc691906137ed565b905050505050565b60008060019054906101000a900460ff16159050808015611cff5750600160008054906101000a900460ff1660ff16105b80611d2c5750611d0e306126fb565b158015611d2b5750600160008054906101000a900460ff1660ff16145b5b611d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6290613dcb565b60405180910390fd5b60016000806101000a81548160ff021916908360ff1602179055508015611da8576001600060016101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611e1957816040517f49fafa18000000000000000000000000000000000000000000000000000000008152600401611e10919061316a565b60405180910390fd5b8160c960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101f460ca81905550735f4ec3df9cbd43714fe2740f5e3616155c5b841960cb60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160cf600073dac17f958d2ee523a2206206994597c13d831ec773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600160cf600073a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600160cf60008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611ff061271e565b80156120495760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249860016040516120409190613e33565b60405180910390a15b5050565b600082829050036120975781816040517fd3f9182200000000000000000000000000000000000000000000000000000000815260040161208e929190613882565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660ce83836040516120c1929190613657565b908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461214a5781816040517fba582251000000000000000000000000000000000000000000000000000000008152600401612141929190613882565b60405180910390fd5b3360ce838360405161215d929190613657565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167f79a86b4c4524bb1efe5d0f41282fada9d4697494d4e44e5fabeec124283a765a83836040516121f1929190613882565b60405180910390a25050565b6122056122d8565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612274576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226b90613ec0565b60405180910390fd5b61227d81612635565b50565b6122886122d8565b61271081106122ce57806040517f7b9314200000000000000000000000000000000000000000000000000000000081526004016122c59190613986565b60405180910390fd5b8060ca8190555050565b6122e0612777565b73ffffffffffffffffffffffffffffffffffffffff166122fe611440565b73ffffffffffffffffffffffffffffffffffffffff1614612354576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161234b90613f2c565b60405180910390fd5b565b6123d9846323b872dd60e01b85858560405160240161237793929190613f4c565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061277f565b50505050565b600061240d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b612847565b60000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61243e6122d8565b50565b61246d7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914360001b612851565b60000160009054906101000a900460ff16156124915761248c8361285b565b6125aa565b8273ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156124f957506040513d601f19601f820116820180604052508101906124f69190613faf565b60015b612538576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161252f9061404e565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b811461259d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612594906140e0565b60405180910390fd5b506125a9838383612914565b5b505050565b6126308363a9059cbb60e01b84846040516024016125ce929190614100565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061277f565b505050565b6000609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081609760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600060019054906101000a900460ff1661276d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127649061419b565b60405180910390fd5b612775612940565b565b600033905090565b60006127e1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166129a19092919063ffffffff16565b905060008151148061280357508080602001905181019061280291906141d0565b5b612842576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128399061426f565b60405180910390fd5b505050565b6000819050919050565b6000819050919050565b612864816126fb565b6128a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161289a90614301565b60405180910390fd5b806128d07f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b612847565b60000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61291d836129b9565b60008251118061292a5750805b1561293b576129398383612a08565b505b505050565b600060019054906101000a900460ff1661298f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129869061419b565b60405180910390fd5b61299f61299a612777565b612635565b565b60606129b08484600085612a35565b90509392505050565b6129c28161285b565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b6060612a2d838360405180606001604052806027815260200161450360279139612b02565b905092915050565b606082471015612a7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a7190614393565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051612aa39190614419565b60006040518083038185875af1925050503d8060008114612ae0576040519150601f19603f3d011682016040523d82523d6000602084013e612ae5565b606091505b5091509150612af687838387612b88565b92505050949350505050565b60606000808573ffffffffffffffffffffffffffffffffffffffff1685604051612b2c9190614419565b600060405180830381855af49150503d8060008114612b67576040519150601f19603f3d011682016040523d82523d6000602084013e612b6c565b606091505b5091509150612b7d86838387612bfd565b925050509392505050565b60608315612bea576000835103612be257612ba285612c72565b612be1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bd89061447c565b60405180910390fd5b5b829050612bf5565b612bf48383612c95565b5b949350505050565b60608315612c5f576000835103612c5757612c17856126fb565b612c56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c4d9061447c565b60405180910390fd5b5b829050612c6a565b612c698383612ce5565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600082511115612ca85781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cdc91906144e0565b60405180910390fd5b600082511115612cf85781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d2c91906144e0565b60405180910390fd5b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612d7482612d49565b9050919050565b612d8481612d69565b8114612d8f57600080fd5b50565b600081359050612da181612d7b565b92915050565b60008115159050919050565b612dbc81612da7565b8114612dc757600080fd5b50565b600081359050612dd981612db3565b92915050565b60008060408385031215612df657612df5612d3f565b5b6000612e0485828601612d92565b9250506020612e1585828601612dca565b9150509250929050565b600080fd5b600080fd5b600080fd5b60008083601f840112612e4457612e43612e1f565b5b8235905067ffffffffffffffff811115612e6157612e60612e24565b5b602083019150836001820283011115612e7d57612e7c612e29565b5b9250929050565b600080fd5b600060608284031215612e9f57612e9e612e84565b5b81905092915050565b600080600060808486031215612ec157612ec0612d3f565b5b600084013567ffffffffffffffff811115612edf57612ede612d44565b5b612eeb86828701612e2e565b93509350506020612efe86828701612e89565b9150509250925092565b60008060008060008060006080888a031215612f2757612f26612d3f565b5b600088013567ffffffffffffffff811115612f4557612f44612d44565b5b612f518a828b01612e2e565b9750975050602088013567ffffffffffffffff811115612f7457612f73612d44565b5b612f808a828b01612e2e565b9550955050604088013567ffffffffffffffff811115612fa357612fa2612d44565b5b612faf8a828b01612e2e565b93509350506060612fc28a828b01612d92565b91505092959891949750929550565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61301f82612fd6565b810181811067ffffffffffffffff8211171561303e5761303d612fe7565b5b80604052505050565b6000613051612d35565b905061305d8282613016565b919050565b600067ffffffffffffffff82111561307d5761307c612fe7565b5b61308682612fd6565b9050602081019050919050565b82818337600083830152505050565b60006130b56130b084613062565b613047565b9050828152602081018484840111156130d1576130d0612fd1565b5b6130dc848285613093565b509392505050565b600082601f8301126130f9576130f8612e1f565b5b81356131098482602086016130a2565b91505092915050565b60006020828403121561312857613127612d3f565b5b600082013567ffffffffffffffff81111561314657613145612d44565b5b613152848285016130e4565b91505092915050565b61316481612d69565b82525050565b600060208201905061317f600083018461315b565b92915050565b60006fffffffffffffffffffffffffffffffff82169050919050565b6131aa81613185565b82525050565b60006040820190506131c560008301856131a1565b6131d260208301846131a1565b9392505050565b6000602082840312156131ef576131ee612d3f565b5b60006131fd84828501612d92565b91505092915050565b600067ffffffffffffffff82111561322157613220612fe7565b5b61322a82612fd6565b9050602081019050919050565b600061324a61324584613206565b613047565b90508281526020810184848401111561326657613265612fd1565b5b613271848285613093565b509392505050565b600082601f83011261328e5761328d612e1f565b5b813561329e848260208601613237565b91505092915050565b600080604083850312156132be576132bd612d3f565b5b60006132cc85828601612d92565b925050602083013567ffffffffffffffff8111156132ed576132ec612d44565b5b6132f985828601613279565b9150509250929050565b6000819050919050565b61331681613303565b82525050565b6000602082019050613331600083018461330d565b92915050565b61334081612da7565b82525050565b600060208201905061335b6000830184613337565b92915050565b6000819050919050565b61337481613361565b82525050565b600060208201905061338f600083018461336b565b92915050565b61339e81613185565b82525050565b6040820160008201516133ba6000850182613395565b5060208201516133cd6020850182613395565b50505050565b60006060820190506133e860008301856133a4565b6133f560408301846131a1565b9392505050565b600080600080600080600080600060a08a8c03121561341e5761341d612d3f565b5b60008a013567ffffffffffffffff81111561343c5761343b612d44565b5b6134488c828d01612e2e565b995099505060208a013567ffffffffffffffff81111561346b5761346a612d44565b5b6134778c828d01612e2e565b975097505060408a013567ffffffffffffffff81111561349a57613499612d44565b5b6134a68c828d01612e2e565b955095505060606134b98c828d01612d92565b93505060808a013567ffffffffffffffff8111156134da576134d9612d44565b5b6134e68c828d01612e2e565b92509250509295985092959850929598565b60006040828403121561350e5761350d612e84565b5b81905092915050565b6000806000606084860312156135305761352f612d3f565b5b600084013567ffffffffffffffff81111561354e5761354d612d44565b5b61355a86828701612e2e565b9350935050602061356d868287016134f8565b9150509250925092565b6000806020838503121561358e5761358d612d3f565b5b600083013567ffffffffffffffff8111156135ac576135ab612d44565b5b6135b885828601612e2e565b92509250509250929050565b6000819050919050565b6135d7816135c4565b81146135e257600080fd5b50565b6000813590506135f4816135ce565b92915050565b6000602082840312156136105761360f612d3f565b5b600061361e848285016135e5565b91505092915050565b600081905092915050565b600061363e8385613627565b935061364b838584613093565b82840190509392505050565b6000613664828486613632565b91508190509392505050565b61367981613185565b811461368457600080fd5b50565b6000813561369481613670565b80915050919050565b60008160001b9050919050565b60006fffffffffffffffffffffffffffffffff6136c68461369d565b9350801983169250808416831791505092915050565b6000819050919050565b60006137016136fc6136f784613185565b6136dc565b613185565b9050919050565b6000819050919050565b61371b826136e6565b61372e61372782613708565b83546136aa565b8255505050565b60008160801b9050919050565b60007fffffffffffffffffffffffffffffffff0000000000000000000000000000000061376e84613735565b9350801983169250808416831791505092915050565b61378d826136e6565b6137a061379982613708565b8354613742565b8255505050565b6000810160008301806137b981613687565b90506137c58184613712565b5050506000810160208301806137da81613687565b90506137e68184613784565b5050505050565b6137f782826137a7565b5050565b60008101600083018061380e81846137ed565b50505060018101604083018061382381613687565b905061382f8184613712565b5050505050565b61384082826137fb565b5050565b600082825260208201905092915050565b60006138618385613844565b935061386e838584613093565b61387783612fd6565b840190509392505050565b6000602082019050818103600083015261389d818486613855565b90509392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061390f826135c4565b915061391a836135c4565b92508261392a576139296138a6565b5b828204905092915050565b6000613940826135c4565b915061394b836135c4565b9250828202613959816135c4565b915082820484148315176139705761396f6138d5565b5b5092915050565b613980816135c4565b82525050565b600060208201905061399b6000830184613977565b92915050565b60006139ac82613185565b91506139b783613185565b9250826139c7576139c66138a6565b5b828204905092915050565b60006139dd82613185565b91506139e883613185565b92508282026139f681613185565b9150808214613a0857613a076138d5565b5b5092915050565b6000613a1a82613185565b9150613a2583613185565b925082820190506fffffffffffffffffffffffffffffffff811115613a4d57613a4c6138d5565b5b92915050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f64656c656761746563616c6c0000000000000000000000000000000000000000602082015250565b6000613aaf602c83613844565b9150613aba82613a53565b604082019050919050565b60006020820190508181036000830152613ade81613aa2565b9050919050565b7f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060008201527f6163746976652070726f78790000000000000000000000000000000000000000602082015250565b6000613b41602c83613844565b9150613b4c82613ae5565b604082019050919050565b60006020820190508181036000830152613b7081613b34565b9050919050565b600081905092915050565b50565b6000613b92600083613b77565b9150613b9d82613b82565b600082019050919050565b6000613bb382613b85565b9150819050919050565b600081519050613bcc816135ce565b92915050565b600060208284031215613be857613be7612d3f565b5b6000613bf684828501613bbd565b91505092915050565b7f555550535570677261646561626c653a206d757374206e6f742062652063616c60008201527f6c6564207468726f7567682064656c656761746563616c6c0000000000000000602082015250565b6000613c5b603883613844565b9150613c6682613bff565b604082019050919050565b60006020820190508181036000830152613c8a81613c4e565b9050919050565b613c9a81613361565b8114613ca557600080fd5b50565b600081519050613cb781613c91565b92915050565b600060208284031215613cd357613cd2612d3f565b5b6000613ce184828501613ca8565b91505092915050565b6000613cf5826135c4565b9150613d00836135c4565b9250828203905081811115613d1857613d176138d5565b5b92915050565b60006040820190508181036000830152613d39818688613855565b90508181036020830152613d4e818486613855565b905095945050505050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000613db5602e83613844565b9150613dc082613d59565b604082019050919050565b60006020820190508181036000830152613de481613da8565b9050919050565b6000819050919050565b600060ff82169050919050565b6000613e1d613e18613e1384613deb565b6136dc565b613df5565b9050919050565b613e2d81613e02565b82525050565b6000602082019050613e486000830184613e24565b92915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613eaa602683613844565b9150613eb582613e4e565b604082019050919050565b60006020820190508181036000830152613ed981613e9d565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613f16602083613844565b9150613f2182613ee0565b602082019050919050565b60006020820190508181036000830152613f4581613f09565b9050919050565b6000606082019050613f61600083018661315b565b613f6e602083018561315b565b613f7b6040830184613977565b949350505050565b613f8c81613303565b8114613f9757600080fd5b50565b600081519050613fa981613f83565b92915050565b600060208284031215613fc557613fc4612d3f565b5b6000613fd384828501613f9a565b91505092915050565b7f45524331393637557067726164653a206e657720696d706c656d656e7461746960008201527f6f6e206973206e6f742055555053000000000000000000000000000000000000602082015250565b6000614038602e83613844565b915061404382613fdc565b604082019050919050565b600060208201905081810360008301526140678161402b565b9050919050565b7f45524331393637557067726164653a20756e737570706f727465642070726f7860008201527f6961626c65555549440000000000000000000000000000000000000000000000602082015250565b60006140ca602983613844565b91506140d58261406e565b604082019050919050565b600060208201905081810360008301526140f9816140bd565b9050919050565b6000604082019050614115600083018561315b565b6141226020830184613977565b9392505050565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b6000614185602b83613844565b915061419082614129565b604082019050919050565b600060208201905081810360008301526141b481614178565b9050919050565b6000815190506141ca81612db3565b92915050565b6000602082840312156141e6576141e5612d3f565b5b60006141f4848285016141bb565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000614259602a83613844565b9150614264826141fd565b604082019050919050565b600060208201905081810360008301526142888161424c565b9050919050565b7f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201527f6f74206120636f6e747261637400000000000000000000000000000000000000602082015250565b60006142eb602d83613844565b91506142f68261428f565b604082019050919050565b6000602082019050818103600083015261431a816142de565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b600061437d602683613844565b915061438882614321565b604082019050919050565b600060208201905081810360008301526143ac81614370565b9050919050565b600081519050919050565b60005b838110156143dc5780820151818401526020810190506143c1565b60008484015250505050565b60006143f3826143b3565b6143fd8185613b77565b935061440d8185602086016143be565b80840191505092915050565b600061442582846143e8565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000614466601d83613844565b915061447182614430565b602082019050919050565b6000602082019050818103600083015261449581614459565b9050919050565b600081519050919050565b60006144b28261449c565b6144bc8185613844565b93506144cc8185602086016143be565b6144d581612fd6565b840191505092915050565b600060208201905081810360008301526144fa81846144a7565b90509291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212209ececc40515d5f68232588cfb12eb46fb3ae71ffdff2819d1e804ee030e5dba064736f6c63430008150033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.