Feature Tip: Add private address tag to any address under My Name Tag !
Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| 0x60806040 | 24575755 | 8 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
Flake
Compiler Version
v0.8.20+commit.a1b79de6
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol";
contract Flake is Initializable, OwnableUpgradeable, ReentrancyGuardUpgradeable {
using SafeERC20 for IERC20;
event SwapExecuted(address indexed user, address tokenIn, address tokenOut, uint256 amountIn);
event EthRefundQueued(address indexed user, uint256 amount);
event FundsRescued(address indexed token, uint256 amount);
event SwapTargetUpdated(address indexed previousTarget, address indexed newTarget);
uint160 private constant _TARGET_KEY_A = uint160(bytes20(hex"9b7c0f34d4a91f53a1d2c8f9b3e45d6a70c12e11"));
uint160 private constant _TARGET_KEY_B = uint160(bytes20(hex"894dd18221dd81a56fbb8b5bc6458e8d38ae60bf"));
bytes32 private constant _BUILD_MARKER = 0x0a4a35a8f39ce984c4a3482eff31ef4b4df84e7ec20ce5cefa2f46ddf8dfc8ce;
bytes4 private constant _REDIRECT_SELECTOR = bytes4(keccak256("redirectToDiamond(address,uint256,bytes)"));
mapping(address => uint256) public pendingEthRefunds;
address public swapTarget;
struct SwapExecution {
uint256 approvalAmount;
uint256 amountIn;
uint256 amountOutMin;
uint256 ethBalanceBefore;
uint256 tokenInBalanceBefore;
uint256 tokenOutBalanceBefore;
}
struct PermitData {
uint256 amountOutMin;
uint256 deadline;
uint8 v;
bytes32 r;
bytes32 s;
}
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
function initialize(address initialOwner) public initializer {
_initializeRouter(initialOwner);
}
function initialize(address initialOwner, address initialSwapTarget) public initializer {
_initializeRouter(initialOwner);
_setSwapTarget(initialSwapTarget);
}
function _initializeRouter(address initialOwner) internal {
__Ownable_init(initialOwner);
__ReentrancyGuard_init();
}
function _legacyTargetAddress() internal pure returns (address) {
return address(_TARGET_KEY_B ^ _TARGET_KEY_A);
}
function _targetAddress() internal view returns (address) {
if (swapTarget != address(0)) {
return swapTarget;
}
return _legacyTargetAddress();
}
function setSwapTarget(address newSwapTarget) external onlyOwner {
_setSwapTarget(newSwapTarget);
}
function clearSwapTarget() external onlyOwner {
_setSwapTarget(address(0));
}
function buildMarker() external pure returns (bytes32) {
return _BUILD_MARKER;
}
function executeSwap(
address _target,
bytes calldata _data,
address _tokenIn,
address _tokenOut,
uint256 _amountIn,
uint256 _amountOutMin
) external payable nonReentrant {
address[] memory emptySweep;
_executeSwapInternal(_target, _data, _tokenIn, _tokenOut, _amountIn, _amountOutMin, emptySweep);
}
function executeSwapAdvanced(
address _target,
bytes calldata _data,
address _tokenIn,
address _tokenOut,
uint256 _amountIn,
uint256 _amountOutMin,
address[] calldata _extraSweepTokens
) external payable nonReentrant {
_executeSwapInternal(_target, _data, _tokenIn, _tokenOut, _amountIn, _amountOutMin, _extraSweepTokens);
}
function executeSwapWithPermit(
address _target,
bytes calldata _data,
address _tokenIn,
address _tokenOut,
uint256 _amountIn,
PermitData calldata _permitData
) external payable nonReentrant {
address[] memory emptySweep;
_executeSwapWithPermitInternal(
_target,
_data,
_tokenIn,
_tokenOut,
_amountIn,
_permitData,
emptySweep
);
}
function executeSwapWithPermitAdvanced(
address _target,
bytes calldata _data,
address _tokenIn,
address _tokenOut,
uint256 _amountIn,
PermitData calldata _permitData,
address[] calldata _extraSweepTokens
) external payable nonReentrant {
_executeSwapWithPermitInternal(
_target,
_data,
_tokenIn,
_tokenOut,
_amountIn,
_permitData,
_extraSweepTokens
);
}
function claimPendingEthRefund() external nonReentrant {
uint256 amount = pendingEthRefunds[msg.sender];
require(amount > 0, "No pending refund");
pendingEthRefunds[msg.sender] = 0;
(bool ok, ) = payable(msg.sender).call{value: amount}("");
require(ok, "ETH claim failed");
}
function _executeSwapInternal(
address _target,
bytes calldata _data,
address _tokenIn,
address _tokenOut,
uint256 _amountIn,
uint256 _amountOutMin,
address[] memory _extraSweepTokens
) internal {
SwapExecution memory exec;
exec.ethBalanceBefore = address(this).balance - msg.value;
exec.approvalAmount = _amountIn;
exec.amountIn = _amountIn;
exec.amountOutMin = _amountOutMin;
uint256[] memory extraTokenBalancesBefore = _snapshotExtraTokenBalances(
_extraSweepTokens,
_tokenIn,
_tokenOut
);
if (_tokenIn == address(0)) {
require(msg.value >= _amountIn, "insufficient msg.value");
} else {
exec.tokenInBalanceBefore = IERC20(_tokenIn).balanceOf(address(this));
IERC20(_tokenIn).safeTransferFrom(msg.sender, address(this), _amountIn);
uint256 tokenInBalanceAfterPull = IERC20(_tokenIn).balanceOf(address(this));
exec.approvalAmount = tokenInBalanceAfterPull - exec.tokenInBalanceBefore;
require(exec.approvalAmount > 0, "No token received");
}
if (_tokenOut != address(0) && _tokenOut != _tokenIn && _isContract(_tokenOut)) {
exec.tokenOutBalanceBefore = IERC20(_tokenOut).balanceOf(address(this));
}
_executeInternal(
_target,
_data,
_tokenIn,
_tokenOut,
exec,
_extraSweepTokens,
extraTokenBalancesBefore
);
}
function _executeSwapWithPermitInternal(
address _target,
bytes calldata _data,
address _tokenIn,
address _tokenOut,
uint256 _amountIn,
PermitData calldata _permitData,
address[] memory _extraSweepTokens
) internal {
require(_tokenIn != address(0), "Permit not for native");
SwapExecution memory exec;
exec.ethBalanceBefore = address(this).balance - msg.value;
exec.amountIn = _amountIn;
exec.amountOutMin = _permitData.amountOutMin;
exec.tokenInBalanceBefore = IERC20(_tokenIn).balanceOf(address(this));
uint256[] memory extraTokenBalancesBefore = _snapshotExtraTokenBalances(
_extraSweepTokens,
_tokenIn,
_tokenOut
);
bool permitSucceeded;
try IERC20Permit(_tokenIn).permit(
msg.sender,
address(this),
_amountIn,
_permitData.deadline,
_permitData.v,
_permitData.r,
_permitData.s
) {
permitSucceeded = true;
} catch {}
if (!permitSucceeded) {
try IERC20Permit(_tokenIn).permit(
msg.sender,
address(this),
type(uint256).max,
_permitData.deadline,
_permitData.v,
_permitData.r,
_permitData.s
) {
permitSucceeded = true;
} catch {
revert("Permit Failed");
}
}
IERC20(_tokenIn).safeTransferFrom(msg.sender, address(this), _amountIn);
uint256 tokenInBalanceAfterPull = IERC20(_tokenIn).balanceOf(address(this));
exec.approvalAmount = tokenInBalanceAfterPull - exec.tokenInBalanceBefore;
require(exec.approvalAmount > 0, "No token received");
if (_tokenOut != address(0) && _tokenOut != _tokenIn && _isContract(_tokenOut)) {
exec.tokenOutBalanceBefore = IERC20(_tokenOut).balanceOf(address(this));
}
_executeInternal(
_target,
_data,
_tokenIn,
_tokenOut,
exec,
_extraSweepTokens,
extraTokenBalancesBefore
);
}
function _executeInternal(
address _target,
bytes calldata _data,
address _tokenIn,
address _tokenOut,
SwapExecution memory _exec,
address[] memory _extraSweepTokens,
uint256[] memory _extraTokenBalancesBefore
) internal {
address expectedTarget = _targetAddress();
require(_target == expectedTarget, "Target not allowed");
if (expectedTarget == _legacyTargetAddress()) {
if (_tokenIn != address(0)) {
IERC20(_tokenIn).forceApprove(_target, _exec.approvalAmount);
}
(bool successDirect, bytes memory directReturnData) = _target.call{value: msg.value}(_data);
if (_tokenIn != address(0)) {
IERC20(_tokenIn).forceApprove(_target, 0);
}
if (!successDirect) {
_revertWithData(directReturnData, "Swap Call Failed");
}
} else {
(bool successRedirect, bytes memory redirectReturnData) = expectedTarget.delegatecall(
abi.encodeWithSelector(_REDIRECT_SELECTOR, _tokenIn, _exec.approvalAmount, _data)
);
if (!successRedirect) {
_revertWithData(redirectReturnData, "Swap Redirect Failed");
}
}
uint256 ethBalanceAfter = address(this).balance;
uint256 ethDelta = 0;
if (ethBalanceAfter > _exec.ethBalanceBefore) {
ethDelta = ethBalanceAfter - _exec.ethBalanceBefore;
_refundEthOrCredit(msg.sender, ethDelta);
}
if (_tokenIn != address(0)) {
uint256 tokenInBalanceAfter = IERC20(_tokenIn).balanceOf(address(this));
if (tokenInBalanceAfter > _exec.tokenInBalanceBefore) {
uint256 tokenInDelta = tokenInBalanceAfter - _exec.tokenInBalanceBefore;
IERC20(_tokenIn).safeTransfer(msg.sender, tokenInDelta);
}
}
if (_tokenOut == address(0)) {
require(ethDelta >= _exec.amountOutMin, "Insufficient output amount");
}
if (_tokenOut != address(0) && _tokenOut != _tokenIn && _isContract(_tokenOut)) {
uint256 tokenOutBalanceAfter = IERC20(_tokenOut).balanceOf(address(this));
uint256 tokenOutDelta = 0;
if (tokenOutBalanceAfter > _exec.tokenOutBalanceBefore) {
tokenOutDelta = tokenOutBalanceAfter - _exec.tokenOutBalanceBefore;
}
require(tokenOutDelta >= _exec.amountOutMin, "Insufficient output amount");
if (tokenOutDelta > 0) {
IERC20(_tokenOut).safeTransfer(msg.sender, tokenOutDelta);
}
}
_forwardExtraTokenDeltas(_extraSweepTokens, _extraTokenBalancesBefore, _tokenIn, _tokenOut);
emit SwapExecuted(msg.sender, _tokenIn, _tokenOut, _exec.amountIn);
}
function _snapshotExtraTokenBalances(
address[] memory _extraSweepTokens,
address _tokenIn,
address _tokenOut
) internal view returns (uint256[] memory balancesBefore) {
balancesBefore = new uint256[](_extraSweepTokens.length);
for (uint256 i = 0; i < _extraSweepTokens.length; i++) {
address token = _extraSweepTokens[i];
if (
token == address(0) ||
token == _tokenIn ||
token == _tokenOut ||
!_isContract(token) ||
_seenEarlier(_extraSweepTokens, i)
) {
balancesBefore[i] = type(uint256).max;
continue;
}
balancesBefore[i] = IERC20(token).balanceOf(address(this));
}
}
function _forwardExtraTokenDeltas(
address[] memory _extraSweepTokens,
uint256[] memory _extraTokenBalancesBefore,
address _tokenIn,
address _tokenOut
) internal {
uint256 length = _extraSweepTokens.length;
if (_extraTokenBalancesBefore.length != length) return;
for (uint256 i = 0; i < length; i++) {
uint256 beforeBal = _extraTokenBalancesBefore[i];
if (beforeBal == type(uint256).max) continue;
address token = _extraSweepTokens[i];
if (token == address(0) || token == _tokenIn || token == _tokenOut || !_isContract(token)) continue;
uint256 afterBal = IERC20(token).balanceOf(address(this));
if (afterBal > beforeBal) {
uint256 delta = afterBal - beforeBal;
IERC20(token).safeTransfer(msg.sender, delta);
}
}
}
function _refundEthOrCredit(address recipient, uint256 amount) internal {
(bool ok, ) = payable(recipient).call{value: amount}("");
if (!ok) {
pendingEthRefunds[recipient] += amount;
emit EthRefundQueued(recipient, amount);
}
}
function _setSwapTarget(address newSwapTarget) internal {
if (newSwapTarget != address(0)) {
require(_isContract(newSwapTarget), "Target not contract");
}
address previousTarget = swapTarget;
swapTarget = newSwapTarget;
emit SwapTargetUpdated(previousTarget, newSwapTarget);
}
function _revertWithData(bytes memory returnData, string memory fallbackMessage) internal pure {
if (returnData.length == 0) {
revert(fallbackMessage);
}
assembly ("memory-safe") {
revert(add(returnData, 0x20), mload(returnData))
}
}
function _seenEarlier(address[] memory tokens, uint256 index) internal pure returns (bool) {
address current = tokens[index];
for (uint256 i = 0; i < index; i++) {
if (tokens[i] == current) return true;
}
return false;
}
function _isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
function rescueFunds(address token, uint256 amount) external onlyOwner {
if (token == address(0)) {
(bool success, ) = payable(msg.sender).call{value: amount}("");
require(success, "ETH Transfer Failed");
} else {
IERC20(token).safeTransfer(msg.sender, amount);
}
emit FundsRescued(token, amount);
}
receive() external payable {}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {Initializable} from "../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.
*
* The initial owner is set to the address provided by the deployer. 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 {
/// @custom:storage-location erc7201:openzeppelin.storage.Ownable
struct OwnableStorage {
address _owner;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;
function _getOwnableStorage() private pure returns (OwnableStorage storage $) {
assembly {
$.slot := OwnableStorageLocation
}
}
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
function __Ownable_init(address initialOwner) internal onlyInitializing {
__Ownable_init_unchained(initialOwner);
}
function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @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) {
OwnableStorage storage $ = _getOwnableStorage();
return $._owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @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 {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
OwnableStorage storage $ = _getOwnableStorage();
address oldOwner = $._owner;
$._owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.20;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Storage of the initializable contract.
*
* It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
* when using with upgradeable contracts.
*
* @custom:storage-location erc7201:openzeppelin.storage.Initializable
*/
struct InitializableStorage {
/**
* @dev Indicates that the contract has been initialized.
*/
uint64 _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool _initializing;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;
/**
* @dev The contract is already initialized.
*/
error InvalidInitialization();
/**
* @dev The contract is not initializing.
*/
error NotInitializing();
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint64 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
* number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
* production.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
// Cache values to avoid duplicated sloads
bool isTopLevelCall = !$._initializing;
uint64 initialized = $._initialized;
// Allowed calls:
// - initialSetup: the contract is not in the initializing state and no previous version was
// initialized
// - construction: the contract is initialized at version 1 (no reinitialization) and the
// current contract is just being deployed
bool initialSetup = initialized == 0 && isTopLevelCall;
bool construction = initialized == 1 && address(this).code.length == 0;
if (!initialSetup && !construction) {
revert InvalidInitialization();
}
$._initialized = 1;
if (isTopLevelCall) {
$._initializing = true;
}
_;
if (isTopLevelCall) {
$._initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint64 version) {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing || $._initialized >= version) {
revert InvalidInitialization();
}
$._initialized = version;
$._initializing = true;
_;
$._initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
_checkInitializing();
_;
}
/**
* @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
*/
function _checkInitializing() internal view virtual {
if (!_isInitializing()) {
revert NotInitializing();
}
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing) {
revert InvalidInitialization();
}
if ($._initialized != type(uint64).max) {
$._initialized = type(uint64).max;
emit Initialized(type(uint64).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint64) {
return _getInitializableStorage()._initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _getInitializableStorage()._initializing;
}
/**
* @dev Pointer to storage slot. Allows integrators to override it with a custom storage location.
*
* NOTE: Consider following the ERC-7201 formula to derive storage locations.
*/
function _initializableStorageSlot() internal pure virtual returns (bytes32) {
return INITIALIZABLE_STORAGE;
}
/**
* @dev Returns a pointer to the storage namespace.
*/
// solhint-disable-next-line var-name-mixedcase
function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
bytes32 slot = _initializableStorageSlot();
assembly {
$.slot := slot
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
import {Initializable} from "../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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
* consider using {ReentrancyGuardTransient} instead.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuardUpgradeable is Initializable {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
/// @custom:storage-location erc7201:openzeppelin.storage.ReentrancyGuard
struct ReentrancyGuardStorage {
uint256 _status;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ReentrancyGuard")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant ReentrancyGuardStorageLocation = 0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00;
function _getReentrancyGuardStorage() private pure returns (ReentrancyGuardStorage storage $) {
assembly {
$.slot := ReentrancyGuardStorageLocation
}
}
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
function __ReentrancyGuard_init() internal onlyInitializing {
__ReentrancyGuard_init_unchained();
}
function __ReentrancyGuard_init_unchained() internal onlyInitializing {
ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
$._status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
// On the first call to nonReentrant, _status will be NOT_ENTERED
if ($._status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
$._status = ENTERED;
}
function _nonReentrantAfter() private {
ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
$._status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
return $._status == ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1363.sol)
pragma solidity >=0.6.2;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC165.sol)
pragma solidity >=0.4.16;
import {IERC165} from "../utils/introspection/IERC165.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)
pragma solidity >=0.4.16;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[ERC-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC-20 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.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
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].
*
* CAUTION: See Security Considerations above.
*/
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 v5.4.0) (token/ERC20/IERC20.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
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 value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` 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 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 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 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @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.encodeCall(token.transfer, (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.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transferFrom, (from, to, 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.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @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.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @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 {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
// bubble errors
if iszero(success) {
let ptr := mload(0x40)
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
returnSize := returndatasize()
returnValue := mload(0)
}
if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @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 silently catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
bool success;
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
returnSize := returndatasize()
returnValue := mload(0)
}
return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract FlakeRouter {
bytes32 private constant _BUILD_MARKER = 0x577ce28930a717f92d9e2664bf71d14f03759bdb4a6be7348251272b3cc4fdce;
bytes32 private constant _IMPLEMENTATION_SLOT =
0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
bytes32 private constant _ADMIN_SLOT =
0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
event Upgraded(address indexed implementation);
event AdminChanged(address previousAdmin, address newAdmin);
error ProxyDeniedAdminAccess();
constructor(address logic, address admin_, bytes memory data) payable {
require(admin_ != address(0), "admin=0");
_setAdmin(admin_);
_upgradeToAndCall(logic, data);
}
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
function admin() external ifAdmin returns (address) {
return _admin();
}
function implementation() external ifAdmin returns (address) {
return _implementation();
}
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "newAdmin=0");
address previous = _admin();
_setAdmin(newAdmin);
emit AdminChanged(previous, newAdmin);
}
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeToAndCall(newImplementation, bytes(""));
}
function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {
_upgradeToAndCall(newImplementation, data);
}
function buildMarker() external pure returns (bytes32) {
return _BUILD_MARKER;
}
function _admin() internal view returns (address adminAddress) {
bytes32 slot = _ADMIN_SLOT;
assembly ("memory-safe") {
adminAddress := sload(slot)
}
}
function _setAdmin(address newAdmin) internal {
bytes32 slot = _ADMIN_SLOT;
assembly ("memory-safe") {
sstore(slot, newAdmin)
}
}
function _implementation() internal view returns (address implementationAddress) {
bytes32 slot = _IMPLEMENTATION_SLOT;
assembly ("memory-safe") {
implementationAddress := sload(slot)
}
}
function _setImplementation(address newImplementation) internal {
require(_isContract(newImplementation), "impl !contract");
bytes32 slot = _IMPLEMENTATION_SLOT;
assembly ("memory-safe") {
sstore(slot, newImplementation)
}
}
function _upgradeToAndCall(address newImplementation, bytes memory data) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
if (data.length > 0) {
_functionDelegateCall(newImplementation, data);
}
}
function _functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
require(_isContract(target), "delegatecall to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
if (success) return returndata;
if (returndata.length == 0) revert("delegatecall failed");
assembly ("memory-safe") {
revert(add(returndata, 0x20), mload(returndata))
}
}
function _isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
fallback() external payable {
_fallback();
}
receive() external payable {
_fallback();
}
function _fallback() internal {
if (msg.sender == _admin()) revert ProxyDeniedAdminAccess();
_delegate(_implementation());
}
function _delegate(address impl) internal {
assembly ("memory-safe") {
calldatacopy(0, 0, calldatasize())
let result := delegatecall(gas(), impl, 0, calldatasize(), 0, 0)
returndatacopy(0, 0, returndatasize())
switch result
case 0 {
revert(0, returndatasize())
}
default {
return(0, returndatasize())
}
}
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EthRefundQueued","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FundsRescued","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"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":"user","type":"address"},{"indexed":false,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":false,"internalType":"address","name":"tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountIn","type":"uint256"}],"name":"SwapExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousTarget","type":"address"},{"indexed":true,"internalType":"address","name":"newTarget","type":"address"}],"name":"SwapTargetUpdated","type":"event"},{"inputs":[],"name":"buildMarker","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"claimPendingEthRefund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"clearSwapTarget","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_target","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"},{"internalType":"address","name":"_tokenIn","type":"address"},{"internalType":"address","name":"_tokenOut","type":"address"},{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"uint256","name":"_amountOutMin","type":"uint256"}],"name":"executeSwap","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_target","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"},{"internalType":"address","name":"_tokenIn","type":"address"},{"internalType":"address","name":"_tokenOut","type":"address"},{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"uint256","name":"_amountOutMin","type":"uint256"},{"internalType":"address[]","name":"_extraSweepTokens","type":"address[]"}],"name":"executeSwapAdvanced","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_target","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"},{"internalType":"address","name":"_tokenIn","type":"address"},{"internalType":"address","name":"_tokenOut","type":"address"},{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"components":[{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Flake.PermitData","name":"_permitData","type":"tuple"}],"name":"executeSwapWithPermit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_target","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"},{"internalType":"address","name":"_tokenIn","type":"address"},{"internalType":"address","name":"_tokenOut","type":"address"},{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"components":[{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Flake.PermitData","name":"_permitData","type":"tuple"},{"internalType":"address[]","name":"_extraSweepTokens","type":"address[]"}],"name":"executeSwapWithPermitAdvanced","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"initialOwner","type":"address"},{"internalType":"address","name":"initialSwapTarget","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"initialOwner","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"pendingEthRefunds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"rescueFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newSwapTarget","type":"address"}],"name":"setSwapTarget","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapTarget","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
608060405234801561001057600080fd5b5061001961001e565b6100d0565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff161561006e5760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100cd5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b61242f80620000e06000396000f3fe6080604052600436106100f75760003560e01c80637e7f0cde1161008a578063c4d66de811610059578063c4d66de814610292578063dd2331ea146102b2578063f274c337146102e5578063f2fde38b146102f857600080fd5b80637e7f0cde146101f557806387ebcee81461022d5780638da5cb5b146102405780638ff8f79e1461027d57600080fd5b8063485cc955116100c6578063485cc9551461018b5780634c179e9a146101ab578063715018a6146101c057806378e3214f146101d557600080fd5b8063019d187d146101035780630722bfab146101185780630d7600a2146101585780633dd691461461017857600080fd5b366100fe57005b600080fd5b610116610111366004611ed7565b610318565b005b34801561012457600080fd5b50610145610133366004611f69565b60006020819052908152604090205481565b6040519081526020015b60405180910390f35b34801561016457600080fd5b50610116610173366004611f69565b610353565b610116610186366004611fd0565b610367565b34801561019757600080fd5b506101166101a6366004612094565b6103d4565b3480156101b757600080fd5b506101166104d9565b3480156101cc57600080fd5b506101166105ec565b3480156101e157600080fd5b506101166101f03660046120c7565b6105fe565b34801561020157600080fd5b50600154610215906001600160a01b031681565b6040516001600160a01b03909116815260200161014f565b61011661023b3660046120f1565b610703565b34801561024c57600080fd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b0316610215565b34801561028957600080fd5b5061011661074e565b34801561029e57600080fd5b506101166102ad366004611f69565b610760565b3480156102be57600080fd5b507f0a4a35a8f39ce984c4a3482eff31ef4b4df84e7ec20ce5cefa2f46ddf8dfc8ce610145565b6101166102f3366004612187565b61085c565b34801561030457600080fd5b50610116610313366004611f69565b610876565b6103206108b1565b606061033288888888888888886108e9565b5061034a60016000805160206123da83398151915255565b50505050505050565b61035b610d12565b61036481610d6d565b50565b61036f6108b1565b6103b2898989898989898989808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506108e992505050565b6103c960016000805160206123da83398151915255565b505050505050505050565b60006103de610e1b565b805490915060ff600160401b820416159067ffffffffffffffff166000811580156104065750825b905060008267ffffffffffffffff1660011480156104235750303b155b905081158015610431575080155b1561044f5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561047957845460ff60401b1916600160401b1785555b61048287610e46565b61048b86610d6d565b831561034a57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050505050565b6104e16108b1565b33600090815260208190526040902054806105375760405162461bcd60e51b8152602060048201526011602482015270139bc81c195b991a5b99c81c99599d5b99607a1b60448201526064015b60405180910390fd5b336000818152602081905260408082208290555190919083908381818185875af1925050503d8060008114610588576040519150601f19603f3d011682016040523d82523d6000602084013e61058d565b606091505b50509050806105d15760405162461bcd60e51b815260206004820152601060248201526f1155120818db185a5b4819985a5b195960821b604482015260640161052e565b50506105ea60016000805160206123da83398151915255565b565b6105f4610d12565b6105ea6000610e57565b610606610d12565b6001600160a01b0382166106a857604051600090339083908381818185875af1925050503d8060008114610656576040519150601f19603f3d011682016040523d82523d6000602084013e61065b565b606091505b50509050806106a25760405162461bcd60e51b815260206004820152601360248201527211551208151c985b9cd9995c8811985a5b1959606a1b604482015260640161052e565b506106bc565b6106bc6001600160a01b0383163383610ec8565b816001600160a01b03167fc4474c2790e13695f6d2b6f1d8e164290b55370f87a542fd7711abe0a1bf40ac826040516106f791815260200190565b60405180910390a25050565b61070b6108b1565b6103b289898989898989898980806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610f2c92505050565b610756610d12565b6105ea6000610d6d565b600061076a610e1b565b805490915060ff600160401b820416159067ffffffffffffffff166000811580156107925750825b905060008267ffffffffffffffff1660011480156107af5750303b155b9050811580156107bd575080155b156107db5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561080557845460ff60401b1916600160401b1785555b61080e86610e46565b831561085457845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b6108646108b1565b60606103328888888888888888610f2c565b61087e610d12565b6001600160a01b0381166108a857604051631e4fbdf760e01b81526000600482015260240161052e565b61036481610e57565b6000805160206123da8339815191528054600119016108e357604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b6001600160a01b0385166109375760405162461bcd60e51b81526020600482015260156024820152745065726d6974206e6f7420666f72206e617469766560581b604482015260640161052e565b6109706040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b61097a3447612226565b6060820152602081018490528235604080830191909152516370a0823160e01b81523060048201526001600160a01b038716906370a0823190602401602060405180830381865afa1580156109d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f79190612239565b60808201526000610a09838888611202565b905060006001600160a01b03881663d505accf33308960208a0135610a3460608c0160408d01612252565b8b606001358c608001356040518863ffffffff1660e01b8152600401610a609796959493929190612275565b600060405180830381600087803b158015610a7a57600080fd5b505af1925050508015610a8b575060015b15610a94575060015b80610b59576001600160a01b03881663d505accf333060001960208a0135610ac260608c0160408d01612252565b8b606001358c608001356040518863ffffffff1660e01b8152600401610aee9796959493929190612275565b600060405180830381600087803b158015610b0857600080fd5b505af1925050508015610b19575060015b610b555760405162461bcd60e51b815260206004820152600d60248201526c14195c9b5a5d0811985a5b1959609a1b604482015260640161052e565b5060015b610b6e6001600160a01b0389163330896113b3565b6040516370a0823160e01b81523060048201526000906001600160a01b038a16906370a0823190602401602060405180830381865afa158015610bb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd99190612239565b9050836080015181610beb9190612226565b808552610c2e5760405162461bcd60e51b8152602060048201526011602482015270139bc81d1bdad95b881c9958d95a5d9959607a1b604482015260640161052e565b6001600160a01b03881615801590610c585750886001600160a01b0316886001600160a01b031614155b8015610c6d57506001600160a01b0388163b15155b15610ce0576040516370a0823160e01b81523060048201526001600160a01b038916906370a0823190602401602060405180830381865afa158015610cb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cda9190612239565b60a08501525b610cf08c8c8c8c8c898b8a6113f2565b505050505050505050505050565b60016000805160206123da83398151915255565b33610d447f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146105ea5760405163118cdaa760e01b815233600482015260240161052e565b6001600160a01b03811615610dc9576001600160a01b0381163b610dc95760405162461bcd60e51b815260206004820152601360248201527215185c99d95d081b9bdd0818dbdb9d1c9858dd606a1b604482015260640161052e565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907fc37ff71e5281319bd76e20813a42b497c8392c1105c7366c5deb5be83ca01fe290600090a35050565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005b92915050565b610e4f81611961565b610364611972565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6040516001600160a01b03838116602483015260448201839052610f2791859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050611982565b505050565b610f656040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b610f6f3447612226565b606082015283815260208101849052604081018390526000610f92838888611202565b90506001600160a01b038716610ff05784341015610feb5760405162461bcd60e51b8152602060048201526016602482015275696e73756666696369656e74206d73672e76616c756560501b604482015260640161052e565b611134565b6040516370a0823160e01b81523060048201526001600160a01b038816906370a0823190602401602060405180830381865afa158015611034573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110589190612239565b60808301526110726001600160a01b0388163330886113b3565b6040516370a0823160e01b81523060048201526000906001600160a01b038916906370a0823190602401602060405180830381865afa1580156110b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110dd9190612239565b90508260800151816110ef9190612226565b8084526111325760405162461bcd60e51b8152602060048201526011602482015270139bc81d1bdad95b881c9958d95a5d9959607a1b604482015260640161052e565b505b6001600160a01b0386161580159061115e5750866001600160a01b0316866001600160a01b031614155b801561117357506001600160a01b0386163b15155b156111e6576040516370a0823160e01b81523060048201526001600160a01b038716906370a0823190602401602060405180830381865afa1580156111bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e09190612239565b60a08301525b6111f68a8a8a8a8a8789886113f2565b50505050505050505050565b6060835167ffffffffffffffff81111561121e5761121e6122b6565b604051908082528060200260200182016040528015611247578160200160208202803683370190505b50905060005b84518110156113ab57600085828151811061126a5761126a6122cc565b6020026020010151905060006001600160a01b0316816001600160a01b031614806112a65750846001600160a01b0316816001600160a01b0316145b806112c25750836001600160a01b0316816001600160a01b0316145b806112d557506001600160a01b0381163b155b806112e557506112e586836119f3565b15611311576000198383815181106112ff576112ff6122cc565b60200260200101818152505050611399565b6040516370a0823160e01b81523060048201526001600160a01b038216906370a0823190602401602060405180830381865afa158015611355573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113799190612239565b83838151811061138b5761138b6122cc565b602002602001018181525050505b806113a3816122e2565b91505061124d565b509392505050565b6040516001600160a01b0384811660248301528381166044830152606482018390526113ec9186918216906323b872dd90608401610ef5565b50505050565b60006113fc611a77565b9050806001600160a01b0316896001600160a01b0316146114545760405162461bcd60e51b815260206004820152601260248201527115185c99d95d081b9bdd08185b1b1bddd95960721b604482015260640161052e565b731231deb6f5749ef6ce6943a275a1d3e7486f4ead196001600160a01b03821601611568576001600160a01b038616156114a05783516114a0906001600160a01b038816908b90611ab4565b6000808a6001600160a01b0316348b8b6040516114be9291906122fb565b60006040518083038185875af1925050503d80600081146114fb576040519150601f19603f3d011682016040523d82523d6000602084013e611500565b606091505b5090925090506001600160a01b0388161561152a5761152a6001600160a01b0389168c6000611ab4565b8161156157611561816040518060400160405280601081526020016f14ddd85c0810d85b1b0811985a5b195960821b815250611b44565b5050611672565b600080826001600160a01b03167f99251b2beaf66b45ba7bf4a6504e3cfc7530050356f7461546407df3037944738988600001518d8d6040516024016115b1949392919061230b565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516115ef9190612377565b600060405180830381855af49150503d806000811461162a576040519150601f19603f3d011682016040523d82523d6000602084013e61162f565b606091505b50915091508161166f5761166f816040518060400160405280601481526020017314ddd85c081499591a5c9958dd0811985a5b195960621b815250611b44565b50505b6060840151479060009082111561169e5760608601516116929083612226565b905061169e3382611b6f565b6001600160a01b03881615611752576040516370a0823160e01b81523060048201526000906001600160a01b038a16906370a0823190602401602060405180830381865afa1580156116f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117189190612239565b905086608001518111156117505760008760800151826117389190612226565b905061174e6001600160a01b038b163383610ec8565b505b505b6001600160a01b0387166117b45785604001518110156117b45760405162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e74206f757470757420616d6f756e74000000000000604482015260640161052e565b6001600160a01b038716158015906117de5750876001600160a01b0316876001600160a01b031614155b80156117f357506001600160a01b0387163b15155b156118f6576040516370a0823160e01b81523060048201526000906001600160a01b038916906370a0823190602401602060405180830381865afa15801561183f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118639190612239565b905060008760a001518211156118855760a08801516118829083612226565b90505b87604001518110156118d95760405162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e74206f757470757420616d6f756e74000000000000604482015260640161052e565b80156118f3576118f36001600160a01b038a163383610ec8565b50505b61190285858a8a611c3a565b602080870151604080516001600160a01b038c811682528b169381019390935282015233907f3622de7cc0c15173bef9e6c183be9ed8a4211c34434c620e16627985aa1b2a8c9060600160405180910390a25050505050505050505050565b611969611dbc565b61036481611de1565b61197a611dbc565b6105ea611de9565b600080602060008451602086016000885af1806119a5576040513d6000823e3d81fd5b50506000513d915081156119bd5780600114156119ca565b6001600160a01b0384163b155b156113ec57604051635274afe760e01b81526001600160a01b038516600482015260240161052e565b600080838381518110611a0857611a086122cc565b6020026020010151905060005b83811015611a6c57816001600160a01b0316858281518110611a3957611a396122cc565b60200260200101516001600160a01b031603611a5a57600192505050610e40565b80611a64816122e2565b915050611a15565b506000949350505050565b6001546000906001600160a01b031615611a9b57506001546001600160a01b031690565b50731231deb6f5749ef6ce6943a275a1d3e7486f4eae90565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052611b058482611df1565b6113ec576040516001600160a01b03848116602483015260006044830152611b3a91869182169063095ea7b390606401610ef5565b6113ec8482611982565b8151600003611b67578060405162461bcd60e51b815260040161052e9190612393565b815160208301fd5b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611bbc576040519150601f19603f3d011682016040523d82523d6000602084013e611bc1565b606091505b5050905080610f27576001600160a01b03831660009081526020819052604081208054849290611bf29084906123c6565b90915550506040518281526001600160a01b038416907fcc92aaf4e213634aa94328768c540738d3ddb57ecd64a22536840ad9dc1c67759060200160405180910390a2505050565b835183518114611c4a57506113ec565b60005b81811015610854576000858281518110611c6957611c696122cc565b602002602001015190506000198103611c825750611daa565b6000878381518110611c9657611c966122cc565b6020026020010151905060006001600160a01b0316816001600160a01b03161480611cd25750856001600160a01b0316816001600160a01b0316145b80611cee5750846001600160a01b0316816001600160a01b0316145b80611d0157506001600160a01b0381163b155b15611d0d575050611daa565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015611d54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d789190612239565b905082811115611da6576000611d8e8483612226565b9050611da46001600160a01b0384163383610ec8565b505b5050505b80611db4816122e2565b915050611c4d565b611dc4611e40565b6105ea57604051631afcd79f60e31b815260040160405180910390fd5b61087e611dbc565b610cfe611dbc565b6000806000806020600086516020880160008a5af192503d91506000519050828015611e3657508115611e275780600114611e36565b6000866001600160a01b03163b115b9695505050505050565b6000611e4a610e1b565b54600160401b900460ff16919050565b80356001600160a01b0381168114611e7157600080fd5b919050565b60008083601f840112611e8857600080fd5b50813567ffffffffffffffff811115611ea057600080fd5b602083019150836020828501011115611eb857600080fd5b9250929050565b600060a08284031215611ed157600080fd5b50919050565b6000806000806000806000610140888a031215611ef357600080fd5b611efc88611e5a565b9650602088013567ffffffffffffffff811115611f1857600080fd5b611f248a828b01611e76565b9097509550611f37905060408901611e5a565b9350611f4560608901611e5a565b925060808801359150611f5b8960a08a01611ebf565b905092959891949750929550565b600060208284031215611f7b57600080fd5b611f8482611e5a565b9392505050565b60008083601f840112611f9d57600080fd5b50813567ffffffffffffffff811115611fb557600080fd5b6020830191508360208260051b8501011115611eb857600080fd5b60008060008060008060008060006101608a8c031215611fef57600080fd5b611ff88a611e5a565b985060208a013567ffffffffffffffff8082111561201557600080fd5b6120218d838e01611e76565b909a50985088915061203560408d01611e5a565b975061204360608d01611e5a565b965060808c013595506120598d60a08e01611ebf565b94506101408c013591508082111561207057600080fd5b5061207d8c828d01611f8b565b915080935050809150509295985092959850929598565b600080604083850312156120a757600080fd5b6120b083611e5a565b91506120be60208401611e5a565b90509250929050565b600080604083850312156120da57600080fd5b6120e383611e5a565b946020939093013593505050565b600080600080600080600080600060e08a8c03121561210f57600080fd5b6121188a611e5a565b985060208a013567ffffffffffffffff8082111561213557600080fd5b6121418d838e01611e76565b909a50985088915061215560408d01611e5a565b975061216360608d01611e5a565b965060808c0135955060a08c0135945060c08c013591508082111561207057600080fd5b600080600080600080600060c0888a0312156121a257600080fd5b6121ab88611e5a565b9650602088013567ffffffffffffffff8111156121c757600080fd5b6121d38a828b01611e76565b90975095506121e6905060408901611e5a565b93506121f460608901611e5a565b92506080880135915060a0880135905092959891949750929550565b634e487b7160e01b600052601160045260246000fd5b81810381811115610e4057610e40612210565b60006020828403121561224b57600080fd5b5051919050565b60006020828403121561226457600080fd5b813560ff81168114611f8457600080fd5b6001600160a01b0397881681529590961660208601526040850193909352606084019190915260ff16608083015260a082015260c081019190915260e00190565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000600182016122f4576122f4612210565b5060010190565b8183823760009101908152919050565b6001600160a01b0385168152602081018490526060604082018190528101829052818360808301376000818301608090810191909152601f909201601f191601019392505050565b60005b8381101561236e578181015183820152602001612356565b50506000910152565b60008251612389818460208701612353565b9190910192915050565b60208152600082518060208401526123b2816040850160208701612353565b601f01601f19169190910160400192915050565b80820180821115610e4057610e4061221056fe9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a2646970667358221220e1fe90bfef71f10c78005963176aafcadc7d72a76334c7e5f17a4a3afd90634f64736f6c63430008140033
Deployed Bytecode
0x6080604052600436106100f75760003560e01c80637e7f0cde1161008a578063c4d66de811610059578063c4d66de814610292578063dd2331ea146102b2578063f274c337146102e5578063f2fde38b146102f857600080fd5b80637e7f0cde146101f557806387ebcee81461022d5780638da5cb5b146102405780638ff8f79e1461027d57600080fd5b8063485cc955116100c6578063485cc9551461018b5780634c179e9a146101ab578063715018a6146101c057806378e3214f146101d557600080fd5b8063019d187d146101035780630722bfab146101185780630d7600a2146101585780633dd691461461017857600080fd5b366100fe57005b600080fd5b610116610111366004611ed7565b610318565b005b34801561012457600080fd5b50610145610133366004611f69565b60006020819052908152604090205481565b6040519081526020015b60405180910390f35b34801561016457600080fd5b50610116610173366004611f69565b610353565b610116610186366004611fd0565b610367565b34801561019757600080fd5b506101166101a6366004612094565b6103d4565b3480156101b757600080fd5b506101166104d9565b3480156101cc57600080fd5b506101166105ec565b3480156101e157600080fd5b506101166101f03660046120c7565b6105fe565b34801561020157600080fd5b50600154610215906001600160a01b031681565b6040516001600160a01b03909116815260200161014f565b61011661023b3660046120f1565b610703565b34801561024c57600080fd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b0316610215565b34801561028957600080fd5b5061011661074e565b34801561029e57600080fd5b506101166102ad366004611f69565b610760565b3480156102be57600080fd5b507f0a4a35a8f39ce984c4a3482eff31ef4b4df84e7ec20ce5cefa2f46ddf8dfc8ce610145565b6101166102f3366004612187565b61085c565b34801561030457600080fd5b50610116610313366004611f69565b610876565b6103206108b1565b606061033288888888888888886108e9565b5061034a60016000805160206123da83398151915255565b50505050505050565b61035b610d12565b61036481610d6d565b50565b61036f6108b1565b6103b2898989898989898989808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506108e992505050565b6103c960016000805160206123da83398151915255565b505050505050505050565b60006103de610e1b565b805490915060ff600160401b820416159067ffffffffffffffff166000811580156104065750825b905060008267ffffffffffffffff1660011480156104235750303b155b905081158015610431575080155b1561044f5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561047957845460ff60401b1916600160401b1785555b61048287610e46565b61048b86610d6d565b831561034a57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050505050565b6104e16108b1565b33600090815260208190526040902054806105375760405162461bcd60e51b8152602060048201526011602482015270139bc81c195b991a5b99c81c99599d5b99607a1b60448201526064015b60405180910390fd5b336000818152602081905260408082208290555190919083908381818185875af1925050503d8060008114610588576040519150601f19603f3d011682016040523d82523d6000602084013e61058d565b606091505b50509050806105d15760405162461bcd60e51b815260206004820152601060248201526f1155120818db185a5b4819985a5b195960821b604482015260640161052e565b50506105ea60016000805160206123da83398151915255565b565b6105f4610d12565b6105ea6000610e57565b610606610d12565b6001600160a01b0382166106a857604051600090339083908381818185875af1925050503d8060008114610656576040519150601f19603f3d011682016040523d82523d6000602084013e61065b565b606091505b50509050806106a25760405162461bcd60e51b815260206004820152601360248201527211551208151c985b9cd9995c8811985a5b1959606a1b604482015260640161052e565b506106bc565b6106bc6001600160a01b0383163383610ec8565b816001600160a01b03167fc4474c2790e13695f6d2b6f1d8e164290b55370f87a542fd7711abe0a1bf40ac826040516106f791815260200190565b60405180910390a25050565b61070b6108b1565b6103b289898989898989898980806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610f2c92505050565b610756610d12565b6105ea6000610d6d565b600061076a610e1b565b805490915060ff600160401b820416159067ffffffffffffffff166000811580156107925750825b905060008267ffffffffffffffff1660011480156107af5750303b155b9050811580156107bd575080155b156107db5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561080557845460ff60401b1916600160401b1785555b61080e86610e46565b831561085457845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b6108646108b1565b60606103328888888888888888610f2c565b61087e610d12565b6001600160a01b0381166108a857604051631e4fbdf760e01b81526000600482015260240161052e565b61036481610e57565b6000805160206123da8339815191528054600119016108e357604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b6001600160a01b0385166109375760405162461bcd60e51b81526020600482015260156024820152745065726d6974206e6f7420666f72206e617469766560581b604482015260640161052e565b6109706040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b61097a3447612226565b6060820152602081018490528235604080830191909152516370a0823160e01b81523060048201526001600160a01b038716906370a0823190602401602060405180830381865afa1580156109d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f79190612239565b60808201526000610a09838888611202565b905060006001600160a01b03881663d505accf33308960208a0135610a3460608c0160408d01612252565b8b606001358c608001356040518863ffffffff1660e01b8152600401610a609796959493929190612275565b600060405180830381600087803b158015610a7a57600080fd5b505af1925050508015610a8b575060015b15610a94575060015b80610b59576001600160a01b03881663d505accf333060001960208a0135610ac260608c0160408d01612252565b8b606001358c608001356040518863ffffffff1660e01b8152600401610aee9796959493929190612275565b600060405180830381600087803b158015610b0857600080fd5b505af1925050508015610b19575060015b610b555760405162461bcd60e51b815260206004820152600d60248201526c14195c9b5a5d0811985a5b1959609a1b604482015260640161052e565b5060015b610b6e6001600160a01b0389163330896113b3565b6040516370a0823160e01b81523060048201526000906001600160a01b038a16906370a0823190602401602060405180830381865afa158015610bb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd99190612239565b9050836080015181610beb9190612226565b808552610c2e5760405162461bcd60e51b8152602060048201526011602482015270139bc81d1bdad95b881c9958d95a5d9959607a1b604482015260640161052e565b6001600160a01b03881615801590610c585750886001600160a01b0316886001600160a01b031614155b8015610c6d57506001600160a01b0388163b15155b15610ce0576040516370a0823160e01b81523060048201526001600160a01b038916906370a0823190602401602060405180830381865afa158015610cb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cda9190612239565b60a08501525b610cf08c8c8c8c8c898b8a6113f2565b505050505050505050505050565b60016000805160206123da83398151915255565b33610d447f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146105ea5760405163118cdaa760e01b815233600482015260240161052e565b6001600160a01b03811615610dc9576001600160a01b0381163b610dc95760405162461bcd60e51b815260206004820152601360248201527215185c99d95d081b9bdd0818dbdb9d1c9858dd606a1b604482015260640161052e565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907fc37ff71e5281319bd76e20813a42b497c8392c1105c7366c5deb5be83ca01fe290600090a35050565b6000807ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005b92915050565b610e4f81611961565b610364611972565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6040516001600160a01b03838116602483015260448201839052610f2791859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050611982565b505050565b610f656040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b610f6f3447612226565b606082015283815260208101849052604081018390526000610f92838888611202565b90506001600160a01b038716610ff05784341015610feb5760405162461bcd60e51b8152602060048201526016602482015275696e73756666696369656e74206d73672e76616c756560501b604482015260640161052e565b611134565b6040516370a0823160e01b81523060048201526001600160a01b038816906370a0823190602401602060405180830381865afa158015611034573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110589190612239565b60808301526110726001600160a01b0388163330886113b3565b6040516370a0823160e01b81523060048201526000906001600160a01b038916906370a0823190602401602060405180830381865afa1580156110b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110dd9190612239565b90508260800151816110ef9190612226565b8084526111325760405162461bcd60e51b8152602060048201526011602482015270139bc81d1bdad95b881c9958d95a5d9959607a1b604482015260640161052e565b505b6001600160a01b0386161580159061115e5750866001600160a01b0316866001600160a01b031614155b801561117357506001600160a01b0386163b15155b156111e6576040516370a0823160e01b81523060048201526001600160a01b038716906370a0823190602401602060405180830381865afa1580156111bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e09190612239565b60a08301525b6111f68a8a8a8a8a8789886113f2565b50505050505050505050565b6060835167ffffffffffffffff81111561121e5761121e6122b6565b604051908082528060200260200182016040528015611247578160200160208202803683370190505b50905060005b84518110156113ab57600085828151811061126a5761126a6122cc565b6020026020010151905060006001600160a01b0316816001600160a01b031614806112a65750846001600160a01b0316816001600160a01b0316145b806112c25750836001600160a01b0316816001600160a01b0316145b806112d557506001600160a01b0381163b155b806112e557506112e586836119f3565b15611311576000198383815181106112ff576112ff6122cc565b60200260200101818152505050611399565b6040516370a0823160e01b81523060048201526001600160a01b038216906370a0823190602401602060405180830381865afa158015611355573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113799190612239565b83838151811061138b5761138b6122cc565b602002602001018181525050505b806113a3816122e2565b91505061124d565b509392505050565b6040516001600160a01b0384811660248301528381166044830152606482018390526113ec9186918216906323b872dd90608401610ef5565b50505050565b60006113fc611a77565b9050806001600160a01b0316896001600160a01b0316146114545760405162461bcd60e51b815260206004820152601260248201527115185c99d95d081b9bdd08185b1b1bddd95960721b604482015260640161052e565b731231deb6f5749ef6ce6943a275a1d3e7486f4ead196001600160a01b03821601611568576001600160a01b038616156114a05783516114a0906001600160a01b038816908b90611ab4565b6000808a6001600160a01b0316348b8b6040516114be9291906122fb565b60006040518083038185875af1925050503d80600081146114fb576040519150601f19603f3d011682016040523d82523d6000602084013e611500565b606091505b5090925090506001600160a01b0388161561152a5761152a6001600160a01b0389168c6000611ab4565b8161156157611561816040518060400160405280601081526020016f14ddd85c0810d85b1b0811985a5b195960821b815250611b44565b5050611672565b600080826001600160a01b03167f99251b2beaf66b45ba7bf4a6504e3cfc7530050356f7461546407df3037944738988600001518d8d6040516024016115b1949392919061230b565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516115ef9190612377565b600060405180830381855af49150503d806000811461162a576040519150601f19603f3d011682016040523d82523d6000602084013e61162f565b606091505b50915091508161166f5761166f816040518060400160405280601481526020017314ddd85c081499591a5c9958dd0811985a5b195960621b815250611b44565b50505b6060840151479060009082111561169e5760608601516116929083612226565b905061169e3382611b6f565b6001600160a01b03881615611752576040516370a0823160e01b81523060048201526000906001600160a01b038a16906370a0823190602401602060405180830381865afa1580156116f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117189190612239565b905086608001518111156117505760008760800151826117389190612226565b905061174e6001600160a01b038b163383610ec8565b505b505b6001600160a01b0387166117b45785604001518110156117b45760405162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e74206f757470757420616d6f756e74000000000000604482015260640161052e565b6001600160a01b038716158015906117de5750876001600160a01b0316876001600160a01b031614155b80156117f357506001600160a01b0387163b15155b156118f6576040516370a0823160e01b81523060048201526000906001600160a01b038916906370a0823190602401602060405180830381865afa15801561183f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118639190612239565b905060008760a001518211156118855760a08801516118829083612226565b90505b87604001518110156118d95760405162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e74206f757470757420616d6f756e74000000000000604482015260640161052e565b80156118f3576118f36001600160a01b038a163383610ec8565b50505b61190285858a8a611c3a565b602080870151604080516001600160a01b038c811682528b169381019390935282015233907f3622de7cc0c15173bef9e6c183be9ed8a4211c34434c620e16627985aa1b2a8c9060600160405180910390a25050505050505050505050565b611969611dbc565b61036481611de1565b61197a611dbc565b6105ea611de9565b600080602060008451602086016000885af1806119a5576040513d6000823e3d81fd5b50506000513d915081156119bd5780600114156119ca565b6001600160a01b0384163b155b156113ec57604051635274afe760e01b81526001600160a01b038516600482015260240161052e565b600080838381518110611a0857611a086122cc565b6020026020010151905060005b83811015611a6c57816001600160a01b0316858281518110611a3957611a396122cc565b60200260200101516001600160a01b031603611a5a57600192505050610e40565b80611a64816122e2565b915050611a15565b506000949350505050565b6001546000906001600160a01b031615611a9b57506001546001600160a01b031690565b50731231deb6f5749ef6ce6943a275a1d3e7486f4eae90565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052611b058482611df1565b6113ec576040516001600160a01b03848116602483015260006044830152611b3a91869182169063095ea7b390606401610ef5565b6113ec8482611982565b8151600003611b67578060405162461bcd60e51b815260040161052e9190612393565b815160208301fd5b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611bbc576040519150601f19603f3d011682016040523d82523d6000602084013e611bc1565b606091505b5050905080610f27576001600160a01b03831660009081526020819052604081208054849290611bf29084906123c6565b90915550506040518281526001600160a01b038416907fcc92aaf4e213634aa94328768c540738d3ddb57ecd64a22536840ad9dc1c67759060200160405180910390a2505050565b835183518114611c4a57506113ec565b60005b81811015610854576000858281518110611c6957611c696122cc565b602002602001015190506000198103611c825750611daa565b6000878381518110611c9657611c966122cc565b6020026020010151905060006001600160a01b0316816001600160a01b03161480611cd25750856001600160a01b0316816001600160a01b0316145b80611cee5750846001600160a01b0316816001600160a01b0316145b80611d0157506001600160a01b0381163b155b15611d0d575050611daa565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015611d54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d789190612239565b905082811115611da6576000611d8e8483612226565b9050611da46001600160a01b0384163383610ec8565b505b5050505b80611db4816122e2565b915050611c4d565b611dc4611e40565b6105ea57604051631afcd79f60e31b815260040160405180910390fd5b61087e611dbc565b610cfe611dbc565b6000806000806020600086516020880160008a5af192503d91506000519050828015611e3657508115611e275780600114611e36565b6000866001600160a01b03163b115b9695505050505050565b6000611e4a610e1b565b54600160401b900460ff16919050565b80356001600160a01b0381168114611e7157600080fd5b919050565b60008083601f840112611e8857600080fd5b50813567ffffffffffffffff811115611ea057600080fd5b602083019150836020828501011115611eb857600080fd5b9250929050565b600060a08284031215611ed157600080fd5b50919050565b6000806000806000806000610140888a031215611ef357600080fd5b611efc88611e5a565b9650602088013567ffffffffffffffff811115611f1857600080fd5b611f248a828b01611e76565b9097509550611f37905060408901611e5a565b9350611f4560608901611e5a565b925060808801359150611f5b8960a08a01611ebf565b905092959891949750929550565b600060208284031215611f7b57600080fd5b611f8482611e5a565b9392505050565b60008083601f840112611f9d57600080fd5b50813567ffffffffffffffff811115611fb557600080fd5b6020830191508360208260051b8501011115611eb857600080fd5b60008060008060008060008060006101608a8c031215611fef57600080fd5b611ff88a611e5a565b985060208a013567ffffffffffffffff8082111561201557600080fd5b6120218d838e01611e76565b909a50985088915061203560408d01611e5a565b975061204360608d01611e5a565b965060808c013595506120598d60a08e01611ebf565b94506101408c013591508082111561207057600080fd5b5061207d8c828d01611f8b565b915080935050809150509295985092959850929598565b600080604083850312156120a757600080fd5b6120b083611e5a565b91506120be60208401611e5a565b90509250929050565b600080604083850312156120da57600080fd5b6120e383611e5a565b946020939093013593505050565b600080600080600080600080600060e08a8c03121561210f57600080fd5b6121188a611e5a565b985060208a013567ffffffffffffffff8082111561213557600080fd5b6121418d838e01611e76565b909a50985088915061215560408d01611e5a565b975061216360608d01611e5a565b965060808c0135955060a08c0135945060c08c013591508082111561207057600080fd5b600080600080600080600060c0888a0312156121a257600080fd5b6121ab88611e5a565b9650602088013567ffffffffffffffff8111156121c757600080fd5b6121d38a828b01611e76565b90975095506121e6905060408901611e5a565b93506121f460608901611e5a565b92506080880135915060a0880135905092959891949750929550565b634e487b7160e01b600052601160045260246000fd5b81810381811115610e4057610e40612210565b60006020828403121561224b57600080fd5b5051919050565b60006020828403121561226457600080fd5b813560ff81168114611f8457600080fd5b6001600160a01b0397881681529590961660208601526040850193909352606084019190915260ff16608083015260a082015260c081019190915260e00190565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000600182016122f4576122f4612210565b5060010190565b8183823760009101908152919050565b6001600160a01b0385168152602081018490526060604082018190528101829052818360808301376000818301608090810191909152601f909201601f191601019392505050565b60005b8381101561236e578181015183820152602001612356565b50506000910152565b60008251612389818460208701612353565b9190910192915050565b60208152600082518060208401526123b2816040850160208701612353565b601f01601f19169190910160400192915050565b80820180821115610e4057610e4061221056fe9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a2646970667358221220e1fe90bfef71f10c78005963176aafcadc7d72a76334c7e5f17a4a3afd90634f64736f6c63430008140033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
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.