Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
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:
SkipGoSwapRouter
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
No with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {IAdapter} from "./interfaces/IAdapter.sol";
import {IWETH} from "./interfaces/IWETH.sol";
contract SkipGoSwapRouter is Initializable, UUPSUpgradeable, OwnableUpgradeable {
using SafeERC20 for IERC20;
enum ExchangeType {
UNISWAP_V2,
UNISWAP_V3
}
mapping(ExchangeType => address) public adapters;
address public weth;
struct Hop {
ExchangeType exchangeType;
bytes data;
}
struct Affiliate {
address recipient;
uint256 feeBPS;
}
constructor() {
_disableInitializers();
}
function initialize(address _weth) external initializer {
__UUPSUpgradeable_init();
__Ownable_init(msg.sender);
weth = _weth;
}
receive() external payable {}
function swapExactIn(
uint256 amountIn,
uint256 amountOutMin,
address tokenIn,
address tokenOut,
Hop[] calldata hops,
Affiliate[] calldata affiliates
) external payable returns (uint256 amountOut) {
// if token in is ETH, msg.value must be equal to amountIn
// if token in is not ETH, msg.value must be 0
require(msg.value == (tokenIn == address(0) ? amountIn : 0), "invalid msg.value");
if (tokenIn == address(0)) {
IWETH(weth).deposit{value: amountIn}();
} else {
IERC20(tokenIn).safeTransferFrom(msg.sender, address(this), amountIn);
}
amountOut = amountIn;
for (uint256 i = 0; i < hops.length; i++) {
Hop memory hop = hops[i];
address adapter = adapters[hop.exchangeType];
if (adapter == address(0)) {
revert("Adapter not found");
}
(bool success, bytes memory returnData) =
adapter.delegatecall(abi.encodeWithSelector(IAdapter.swapExactIn.selector, amountOut, hop.data));
if (!success) {
_revertWithData(returnData);
}
amountOut = abi.decode(returnData, (uint256));
}
require(amountOut >= amountOutMin, "amount out is less than amount out min");
uint256 amountPaid = _payAffiliateFees(tokenOut, amountOut, affiliates);
amountOut = amountOut - amountPaid;
if (tokenOut == address(0)) {
IWETH(weth).withdraw(amountOut);
payable(msg.sender).transfer(amountOut);
} else {
IERC20(tokenOut).safeTransfer(msg.sender, amountOut);
}
}
function swapExactOut(
uint256 amountOut,
uint256 amountInMax,
address tokenIn,
address tokenOut,
Hop[] calldata hops,
Affiliate[] calldata affiliates
) external payable returns (uint256 amountIn) {
amountIn = getAmountIn(amountOut, hops);
require(amountIn <= amountInMax, "amount in is greater than amount in max");
if (tokenIn == address(0)) {
require(msg.value >= amountIn, "msg.value is less than amount in");
IWETH(weth).deposit{value: amountIn}();
} else {
require(msg.value == 0, "msg.value must be 0");
IERC20(tokenIn).safeTransferFrom(msg.sender, address(this), amountIn);
}
amountOut = amountIn;
for (uint256 i = 0; i < hops.length; i++) {
Hop memory hop = hops[i];
address adapter = adapters[hop.exchangeType];
if (adapter == address(0)) {
revert("Adapter not found");
}
(bool success, bytes memory returnData) =
adapter.delegatecall(abi.encodeWithSelector(IAdapter.swapExactIn.selector, amountOut, hop.data));
if (!success) {
_revertWithData(returnData);
}
amountOut = abi.decode(returnData, (uint256));
}
uint256 amountPaid = _payAffiliateFees(tokenOut, amountOut, affiliates);
uint256 amountOutAfterFees = amountOut - amountPaid;
if (tokenOut == address(0)) {
IWETH(weth).withdraw(amountOutAfterFees);
payable(msg.sender).transfer(amountOutAfterFees);
} else {
IERC20(tokenOut).safeTransfer(msg.sender, amountOutAfterFees);
}
// refund unused ETH
if (tokenIn == address(0) && msg.value > amountIn) {
payable(msg.sender).transfer(msg.value - amountIn);
}
}
function getAmountOut(uint256 amountIn, Hop[] calldata hops) public view returns (uint256 amountOut) {
amountOut = amountIn;
for (uint256 i = 0; i < hops.length; i++) {
Hop memory hop = hops[i];
address adapter = adapters[hop.exchangeType];
if (adapter == address(0)) {
revert("Adapter not found");
}
amountOut = IAdapter(adapter).getAmountOut(amountOut, hop.data);
}
return amountOut;
}
function getAmountIn(uint256 amountOut, Hop[] calldata hops) public view returns (uint256 amountIn) {
amountIn = amountOut;
for (int256 i = int256(hops.length) - 1; i >= 0; i--) {
Hop memory hop = hops[uint256(i)];
address adapter = adapters[hop.exchangeType];
if (adapter == address(0)) {
revert("Adapter not found");
}
amountIn = IAdapter(adapter).getAmountIn(amountIn, hop.data);
}
return amountIn;
}
function addAdapter(ExchangeType exchangeType, address adapter) external onlyOwner {
adapters[exchangeType] = adapter;
}
function _revertWithData(bytes memory data) private pure {
assembly {
revert(add(data, 32), mload(data))
}
}
function _payAffiliateFees(address token, uint256 amount, Affiliate[] calldata affiliates)
private
returns (uint256 amountPaid)
{
for (uint256 i = 0; i < affiliates.length; i++) {
Affiliate memory affiliate = affiliates[i];
uint256 fee = (amount * affiliate.feeBPS) / 10000;
amountPaid += fee;
IERC20(token).safeTransfer(affiliate.recipient, fee);
}
return amountPaid;
}
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @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.3.0) (proxy/utils/UUPSUpgradeable.sol)
pragma solidity ^0.8.22;
import {IERC1822Proxiable} from "@openzeppelin/contracts/interfaces/draft-IERC1822.sol";
import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol";
import {Initializable} from "./Initializable.sol";
/**
* @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
* {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
*
* A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
* reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
* `UUPSUpgradeable` with a custom implementation of upgrades.
*
* The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
*/
abstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable {
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable
address private immutable __self = address(this);
/**
* @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`
* and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,
* while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.
* If the getter returns `"5.0.0"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must
* be the empty byte string if no function should be called, making it impossible to invoke the `receive` function
* during an upgrade.
*/
string public constant UPGRADE_INTERFACE_VERSION = "5.0.0";
/**
* @dev The call is from an unauthorized context.
*/
error UUPSUnauthorizedCallContext();
/**
* @dev The storage `slot` is unsupported as a UUID.
*/
error UUPSUnsupportedProxiableUUID(bytes32 slot);
/**
* @dev Check that the execution is being performed through a delegatecall call and that the execution context is
* a proxy contract with an implementation (as defined in ERC-1967) pointing to self. This should only be the case
* for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
* function through ERC-1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
* fail.
*/
modifier onlyProxy() {
_checkProxy();
_;
}
/**
* @dev Check that the execution is not being performed through a delegate call. This allows a function to be
* callable on the implementing contract but not through proxies.
*/
modifier notDelegated() {
_checkNotDelegated();
_;
}
function __UUPSUpgradeable_init() internal onlyInitializing {
}
function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
}
/**
* @dev Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the
* implementation. It is used to validate the implementation's compatibility when performing an upgrade.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
*/
function proxiableUUID() external view virtual notDelegated returns (bytes32) {
return ERC1967Utils.IMPLEMENTATION_SLOT;
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
* encoded in `data`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*
* @custom:oz-upgrades-unsafe-allow-reachable delegatecall
*/
function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, data);
}
/**
* @dev Reverts if the execution is not performed via delegatecall or the execution
* context is not of a proxy with an ERC-1967 compliant implementation pointing to self.
*/
function _checkProxy() internal view virtual {
if (
address(this) == __self || // Must be called through delegatecall
ERC1967Utils.getImplementation() != __self // Must be called through an active proxy
) {
revert UUPSUnauthorizedCallContext();
}
}
/**
* @dev Reverts if the execution is performed via delegatecall.
* See {notDelegated}.
*/
function _checkNotDelegated() internal view virtual {
if (address(this) != __self) {
// Must not be called through delegatecall
revert UUPSUnauthorizedCallContext();
}
}
/**
* @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
* {upgradeToAndCall}.
*
* Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
*
* ```solidity
* function _authorizeUpgrade(address) internal onlyOwner {}
* ```
*/
function _authorizeUpgrade(address newImplementation) internal virtual;
/**
* @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.
*
* As a security check, {proxiableUUID} is invoked in the new implementation, and the return value
* is expected to be the implementation slot in ERC-1967.
*
* Emits an {IERC1967-Upgraded} event.
*/
function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {
try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {
if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {
revert UUPSUnsupportedProxiableUUID(slot);
}
ERC1967Utils.upgradeToAndCall(newImplementation, data);
} catch {
// The implementation is not UUPS
revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);
}
}
}// 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: UNLICENSED
pragma solidity ^0.8.13;
interface IAdapter {
function swapExactIn(uint256 amountIn, bytes calldata data) external returns (uint256 amountOut);
function getAmountOut(uint256 amountIn, bytes calldata data) external view returns (uint256 amountOut);
function getAmountIn(uint256 amountOut, bytes calldata data) external view returns (uint256 amountIn);
}// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright (C) 2015, 2016, 2017 Dapphub
// Adapted by Ethereum Community 2021
pragma solidity ^0.8.0;
/// @dev Wrapped Ether v10 (WETH10) is an Ether (ETH) ERC-20 wrapper. You can `deposit` ETH and obtain a WETH10 balance which can then be operated as an ERC-20 token. You can
/// `withdraw` ETH from WETH10, which will then burn WETH10 token in your wallet. The amount of WETH10 token in any wallet is always identical to the
/// balance of ETH deposited minus the ETH withdrawn with that specific wallet.
interface IWETH {
/// @dev `msg.value` of ETH sent to this contract grants caller account a matching increase in WETH10 token balance.
/// Emits {Transfer} event to reflect WETH10 token mint of `msg.value` from `address(0)` to caller account.
function deposit() external payable;
/// @dev Burn `value` WETH10 token from caller account and withdraw matching ETH to the same.
/// Emits {Transfer} event to reflect WETH10 token burn of `value` to `address(0)` from caller account.
/// Requirements:
/// - caller account must have at least `value` balance of WETH10 token.
function withdraw(uint256 value) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)
pragma solidity ^0.8.20;
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.1.0) (interfaces/draft-IERC1822.sol)
pragma solidity ^0.8.20;
/**
* @dev ERC-1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
* proxy whose upgrades are fully controlled by the current implementation.
*/
interface IERC1822Proxiable {
/**
* @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
* address.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy.
*/
function proxiableUUID() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.0) (proxy/ERC1967/ERC1967Utils.sol)
pragma solidity ^0.8.22;
import {IBeacon} from "../beacon/IBeacon.sol";
import {IERC1967} from "../../interfaces/IERC1967.sol";
import {Address} from "../../utils/Address.sol";
import {StorageSlot} from "../../utils/StorageSlot.sol";
/**
* @dev This library provides getters and event emitting update functions for
* https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots.
*/
library ERC1967Utils {
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1.
*/
// solhint-disable-next-line private-vars-leading-underscore
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev The `implementation` of the proxy is invalid.
*/
error ERC1967InvalidImplementation(address implementation);
/**
* @dev The `admin` of the proxy is invalid.
*/
error ERC1967InvalidAdmin(address admin);
/**
* @dev The `beacon` of the proxy is invalid.
*/
error ERC1967InvalidBeacon(address beacon);
/**
* @dev An upgrade function sees `msg.value > 0` that may be lost.
*/
error ERC1967NonPayable();
/**
* @dev Returns the current implementation address.
*/
function getImplementation() internal view returns (address) {
return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;
}
/**
* @dev Stores a new address in the ERC-1967 implementation slot.
*/
function _setImplementation(address newImplementation) private {
if (newImplementation.code.length == 0) {
revert ERC1967InvalidImplementation(newImplementation);
}
StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;
}
/**
* @dev Performs implementation upgrade with additional setup call if data is nonempty.
* This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
* to avoid stuck value in the contract.
*
* Emits an {IERC1967-Upgraded} event.
*/
function upgradeToAndCall(address newImplementation, bytes memory data) internal {
_setImplementation(newImplementation);
emit IERC1967.Upgraded(newImplementation);
if (data.length > 0) {
Address.functionDelegateCall(newImplementation, data);
} else {
_checkNonPayable();
}
}
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1.
*/
// solhint-disable-next-line private-vars-leading-underscore
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Returns the current admin.
*
* TIP: To get this value clients can read directly from the storage slot shown below (specified by ERC-1967) using
* the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
* `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`
*/
function getAdmin() internal view returns (address) {
return StorageSlot.getAddressSlot(ADMIN_SLOT).value;
}
/**
* @dev Stores a new address in the ERC-1967 admin slot.
*/
function _setAdmin(address newAdmin) private {
if (newAdmin == address(0)) {
revert ERC1967InvalidAdmin(address(0));
}
StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;
}
/**
* @dev Changes the admin of the proxy.
*
* Emits an {IERC1967-AdminChanged} event.
*/
function changeAdmin(address newAdmin) internal {
emit IERC1967.AdminChanged(getAdmin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
* This is the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1.
*/
// solhint-disable-next-line private-vars-leading-underscore
bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;
/**
* @dev Returns the current beacon.
*/
function getBeacon() internal view returns (address) {
return StorageSlot.getAddressSlot(BEACON_SLOT).value;
}
/**
* @dev Stores a new beacon in the ERC-1967 beacon slot.
*/
function _setBeacon(address newBeacon) private {
if (newBeacon.code.length == 0) {
revert ERC1967InvalidBeacon(newBeacon);
}
StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;
address beaconImplementation = IBeacon(newBeacon).implementation();
if (beaconImplementation.code.length == 0) {
revert ERC1967InvalidImplementation(beaconImplementation);
}
}
/**
* @dev Change the beacon and trigger a setup call if data is nonempty.
* This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
* to avoid stuck value in the contract.
*
* Emits an {IERC1967-BeaconUpgraded} event.
*
* CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since
* it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for
* efficiency.
*/
function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {
_setBeacon(newBeacon);
emit IERC1967.BeaconUpgraded(newBeacon);
if (data.length > 0) {
Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
} else {
_checkNonPayable();
}
}
/**
* @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract
* if an upgrade doesn't perform an initialization call.
*/
function _checkNonPayable() private {
if (msg.value > 0) {
revert ERC1967NonPayable();
}
}
}// 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.0.0) (interfaces/IERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../utils/introspection/IERC165.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)
pragma solidity ^0.8.20;
/**
* @dev This is the interface that {BeaconProxy} expects of its beacon.
*/
interface IBeacon {
/**
* @dev Must return an address that can be used as a delegate call target.
*
* {UpgradeableBeacon} will check that this address is a contract.
*/
function implementation() external view returns (address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1967.sol)
pragma solidity ^0.8.20;
/**
* @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
*/
interface IERC1967 {
/**
* @dev Emitted when the implementation is upgraded.
*/
event Upgraded(address indexed implementation);
/**
* @dev Emitted when the admin account has changed.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Emitted when the beacon is changed.
*/
event BeaconUpgraded(address indexed beacon);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.0) (utils/Address.sol)
pragma solidity ^0.8.20;
import {Errors} from "./Errors.sol";
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert Errors.InsufficientBalance(address(this).balance, amount);
}
(bool success, bytes memory returndata) = recipient.call{value: amount}("");
if (!success) {
_revert(returndata);
}
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {Errors.FailedCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert Errors.InsufficientBalance(address(this).balance, value);
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case
* of an unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {Errors.FailedCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly ("memory-safe") {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert Errors.FailedCall();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.20;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC-1967 implementation slot:
* ```solidity
* contract ERC1967 {
* // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(newImplementation.code.length > 0);
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*
* TIP: Consider using this library along with {SlotDerivation}.
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct Int256Slot {
int256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Int256Slot` with member `value` located at `slot`.
*/
function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
assembly ("memory-safe") {
r.slot := store.slot
}
}
/**
* @dev Returns a `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
assembly ("memory-safe") {
r.slot := store.slot
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @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
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of common custom errors used in multiple contracts
*
* IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
* It is recommended to avoid relying on the error API for critical functionality.
*
* _Available since v5.1._
*/
library Errors {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error InsufficientBalance(uint256 balance, uint256 needed);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedCall();
/**
* @dev The deployment failed.
*/
error FailedDeployment();
/**
* @dev A necessary precompile is missing.
*/
error MissingPrecompile(address);
}{
"remappings": [
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/"
],
"optimizer": {
"enabled": false,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": false,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[],"name":"FailedCall","type":"error"},{"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":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"UUPSUnauthorizedCallContext","type":"error"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"UUPSUnsupportedProxiableUUID","type":"error"},{"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":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"UPGRADE_INTERFACE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum SkipGoSwapRouter.ExchangeType","name":"","type":"uint8"}],"name":"adapters","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum SkipGoSwapRouter.ExchangeType","name":"exchangeType","type":"uint8"},{"internalType":"address","name":"adapter","type":"address"}],"name":"addAdapter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"components":[{"internalType":"enum SkipGoSwapRouter.ExchangeType","name":"exchangeType","type":"uint8"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct SkipGoSwapRouter.Hop[]","name":"hops","type":"tuple[]"}],"name":"getAmountIn","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"components":[{"internalType":"enum SkipGoSwapRouter.ExchangeType","name":"exchangeType","type":"uint8"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct SkipGoSwapRouter.Hop[]","name":"hops","type":"tuple[]"}],"name":"getAmountOut","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_weth","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"components":[{"internalType":"enum SkipGoSwapRouter.ExchangeType","name":"exchangeType","type":"uint8"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct SkipGoSwapRouter.Hop[]","name":"hops","type":"tuple[]"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"feeBPS","type":"uint256"}],"internalType":"struct SkipGoSwapRouter.Affiliate[]","name":"affiliates","type":"tuple[]"}],"name":"swapExactIn","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"amountInMax","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"components":[{"internalType":"enum SkipGoSwapRouter.ExchangeType","name":"exchangeType","type":"uint8"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct SkipGoSwapRouter.Hop[]","name":"hops","type":"tuple[]"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"feeBPS","type":"uint256"}],"internalType":"struct SkipGoSwapRouter.Affiliate[]","name":"affiliates","type":"tuple[]"}],"name":"swapExactOut","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60a06040523073ffffffffffffffffffffffffffffffffffffffff1660809073ffffffffffffffffffffffffffffffffffffffff16815250348015610042575f5ffd5b5061005161005660201b60201c565b6101d1565b5f61006561015460201b60201c565b9050805f0160089054906101000a900460ff16156100af576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff8016815f015f9054906101000a900467ffffffffffffffff1667ffffffffffffffff16146101515767ffffffffffffffff815f015f6101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055507fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d267ffffffffffffffff60405161014891906101b8565b60405180910390a15b50565b5f5f61016461016d60201b60201c565b90508091505090565b5f7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005f1b905090565b5f67ffffffffffffffff82169050919050565b6101b281610196565b82525050565b5f6020820190506101cb5f8301846101a9565b92915050565b608051612e806101f75f395f818161158b015281816115e0015261179a0152612e805ff3fe6080604052600436106100e0575f3560e01c8063ad3cb1cc1161007e578063cf3722da11610058578063cf3722da14610281578063ead2fe5b146102bd578063f2fde38b146102ed578063fc6d451514610315576100e7565b8063ad3cb1cc146101f3578063c4d66de81461021d578063cc4f7dc514610245576100e7565b8063715018a6116100ba578063715018a61461015b57806376519a46146101715780638da5cb5b14610199578063a3add509146101c3576100e7565b80633fc8cef3146100eb5780634f1ef2861461011557806352d1902d14610131576100e7565b366100e757005b5f5ffd5b3480156100f6575f5ffd5b506100ff610351565b60405161010c9190612099565b60405180910390f35b61012f600480360381019061012a9190612229565b610376565b005b34801561013c575f5ffd5b50610145610395565b604051610152919061229b565b60405180910390f35b348015610166575f5ffd5b5061016f6103c6565b005b34801561017c575f5ffd5b50610197600480360381019061019291906122d7565b6103d9565b005b3480156101a4575f5ffd5b506101ad610457565b6040516101ba9190612099565b60405180910390f35b6101dd60048036038101906101d891906123fa565b61048c565b6040516101ea91906124d3565b60405180910390f35b3480156101fe575f5ffd5b50610207610a57565b604051610214919061254c565b60405180910390f35b348015610228575f5ffd5b50610243600480360381019061023e919061256c565b610a90565b005b348015610250575f5ffd5b5061026b60048036038101906102669190612597565b610c59565b60405161027891906124d3565b60405180910390f35b34801561028c575f5ffd5b506102a760048036038101906102a29190612597565b610e0e565b6040516102b491906124d3565b60405180910390f35b6102d760048036038101906102d291906123fa565b610fb2565b6040516102e491906124d3565b60405180910390f35b3480156102f8575f5ffd5b50610313600480360381019061030e919061256c565b6114d6565b005b348015610320575f5ffd5b5061033b600480360381019061033691906125f4565b61155a565b6040516103489190612099565b60405180910390f35b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61037e611589565b6103878261166f565b610391828261167a565b5050565b5f61039e611798565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5f1b905090565b6103ce61181f565b6103d75f6118a6565b565b6103e161181f565b805f5f8460018111156103f7576103f661261f565b5b60018111156104095761040861261f565b5b81526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b5f5f610461611977565b9050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691505090565b5f610498898686610c59565b9050878111156104dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d4906126bc565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16036105d65780341015610553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161054a90612724565b60405180910390fd5b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004015f604051808303818588803b1580156105ba575f5ffd5b505af11580156105cc573d5f5f3e3d5ffd5b5050505050610646565b5f3414610618576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060f9061278c565b60405180910390fd5b6106453330838a73ffffffffffffffffffffffffffffffffffffffff1661199e909392919063ffffffff16565b5b8098505f5f90505b8585905081101561086c575f86868381811061066d5761066c6127aa565b5b905060200281019061067f91906127db565b61068890612873565b90505f5f5f835f015160018111156106a3576106a261261f565b5b60018111156106b5576106b461261f565b5b81526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610752576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610749906128cf565b60405180910390fd5b5f5f8273ffffffffffffffffffffffffffffffffffffffff1663b72722c660e01b8f866020015160405160240161078a92919061293f565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516107f491906129a7565b5f60405180830381855af49150503d805f811461082c576040519150601f19603f3d011682016040523d82523d5f602084013e610831565b606091505b5091509150816108455761084481611a20565b5b8080602001905181019061085991906129d1565b9d5050505050808060010191505061064e565b505f61087a878b8686611a28565b90505f818b6108899190612a29565b90505f73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff160361098e5760015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b815260040161091891906124d3565b5f604051808303815f87803b15801561092f575f5ffd5b505af1158015610941573d5f5f3e3d5ffd5b505050503373ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f19350505050158015610988573d5f5f3e3d5ffd5b506109ba565b6109b933828a73ffffffffffffffffffffffffffffffffffffffff16611ad99092919063ffffffff16565b5b5f73ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161480156109f457508234115b15610a49573373ffffffffffffffffffffffffffffffffffffffff166108fc8434610a1f9190612a29565b90811502906040515f60405180830381858888f19350505050158015610a47573d5f5f3e3d5ffd5b505b505098975050505050505050565b6040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b5f610a99611b58565b90505f815f0160089054906101000a900460ff161590505f825f015f9054906101000a900467ffffffffffffffff1690505f5f8267ffffffffffffffff16148015610ae15750825b90505f60018367ffffffffffffffff16148015610b1457505f3073ffffffffffffffffffffffffffffffffffffffff163b145b905081158015610b22575080155b15610b59576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001855f015f6101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055508315610ba6576001855f0160086101000a81548160ff0219169083151502179055505b610bae611b6b565b610bb733611b75565b8560015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508315610c51575f855f0160086101000a81548160ff0219169083151502179055507fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d26001604051610c489190612ab1565b60405180910390a15b505050505050565b5f8390505f600184849050610c6e9190612ad3565b90505b5f8112610e06575f848483818110610c8c57610c8b6127aa565b5b9050602002810190610c9e91906127db565b610ca790612873565b90505f5f5f835f01516001811115610cc257610cc161261f565b5b6001811115610cd457610cd361261f565b5b81526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610d71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d68906128cf565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1663943e912b8584602001516040518363ffffffff1660e01b8152600401610db092919061293f565b602060405180830381865afa158015610dcb573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610def91906129d1565b935050508080610dfe90612b13565b915050610c71565b509392505050565b5f8390505f5f90505b83839050811015610faa575f848483818110610e3657610e356127aa565b5b9050602002810190610e4891906127db565b610e5190612873565b90505f5f5f835f01516001811115610e6c57610e6b61261f565b5b6001811115610e7e57610e7d61261f565b5b81526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610f1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f12906128cf565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166344f1c8c38584602001516040518363ffffffff1660e01b8152600401610f5a92919061293f565b602060405180830381865afa158015610f75573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f9991906129d1565b935050508080600101915050610e17565b509392505050565b5f5f73ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614610fec575f610fee565b885b341461102f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102690612ba4565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16036110e55760015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db08a6040518263ffffffff1660e01b81526004015f604051808303818588803b1580156110c9575f5ffd5b505af11580156110db573d5f5f3e3d5ffd5b5050505050611113565b61111233308b8a73ffffffffffffffffffffffffffffffffffffffff1661199e909392919063ffffffff16565b5b8890505f5f90505b85859050811015611339575f86868381811061113a576111396127aa565b5b905060200281019061114c91906127db565b61115590612873565b90505f5f5f835f015160018111156111705761116f61261f565b5b60018111156111825761118161261f565b5b81526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361121f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611216906128cf565b60405180910390fd5b5f5f8273ffffffffffffffffffffffffffffffffffffffff1663b72722c660e01b87866020015160405160240161125792919061293f565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516112c191906129a7565b5f60405180830381855af49150503d805f81146112f9576040519150601f19603f3d011682016040523d82523d5f602084013e6112fe565b606091505b5091509150816113125761131181611a20565b5b8080602001905181019061132691906129d1565b955050505050808060010191505061111b565b508781101561137d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137490612c32565b60405180910390fd5b5f61138a87838686611a28565b905080826113989190612a29565b91505f73ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff160361149d5760015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836040518263ffffffff1660e01b815260040161142791906124d3565b5f604051808303815f87803b15801561143e575f5ffd5b505af1158015611450573d5f5f3e3d5ffd5b505050503373ffffffffffffffffffffffffffffffffffffffff166108fc8390811502906040515f60405180830381858888f19350505050158015611497573d5f5f3e3d5ffd5b506114c9565b6114c833838973ffffffffffffffffffffffffffffffffffffffff16611ad99092919063ffffffff16565b5b5098975050505050505050565b6114de61181f565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361154e575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016115459190612099565b60405180910390fd5b611557816118a6565b50565b5f602052805f5260405f205f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff16148061163657507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1661161d611b89565b73ffffffffffffffffffffffffffffffffffffffff1614155b1561166d576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b61167761181f565b50565b8173ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156116e257506040513d601f19601f820116820180604052508101906116df9190612c7a565b60015b61172357816040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815260040161171a9190612099565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5f1b811461178957806040517faa1d49a4000000000000000000000000000000000000000000000000000000008152600401611780919061229b565b60405180910390fd5b6117938383611bdc565b505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff161461181d576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b611827611c4e565b73ffffffffffffffffffffffffffffffffffffffff16611845610457565b73ffffffffffffffffffffffffffffffffffffffff16146118a457611868611c4e565b6040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040161189b9190612099565b60405180910390fd5b565b5f6118af611977565b90505f815f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082825f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3505050565b5f7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300905090565b611a1a848573ffffffffffffffffffffffffffffffffffffffff166323b872dd8686866040516024016119d393929190612ca5565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c55565b50505050565b805160208201fd5b5f5f5f90505b83839050811015611ad0575f848483818110611a4d57611a4c6127aa565b5b905060400201803603810190611a639190612d27565b90505f612710826020015188611a799190612d52565b611a839190612dc0565b90508084611a919190612df0565b9350611ac1825f0151828a73ffffffffffffffffffffffffffffffffffffffff16611ad99092919063ffffffff16565b50508080600101915050611a2e565b50949350505050565b611b53838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401611b0c929190612e23565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c55565b505050565b5f5f611b62611cf0565b90508091505090565b611b73611d19565b565b611b7d611d19565b611b8681611d59565b50565b5f611bb57f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5f1b611ddd565b5f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611be582611de6565b8173ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a25f81511115611c4157611c3b8282611eaf565b50611c4a565b611c49611f2f565b5b5050565b5f33905090565b5f5f60205f8451602086015f885af180611c74576040513d5f823e3d81fd5b3d92505f519150505f8214611c8d576001811415611ca8565b5f8473ffffffffffffffffffffffffffffffffffffffff163b145b15611cea57836040517f5274afe7000000000000000000000000000000000000000000000000000000008152600401611ce19190612099565b60405180910390fd5b50505050565b5f7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005f1b905090565b611d21611f6b565b611d57576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b611d61611d19565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611dd1575f6040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401611dc89190612099565b60405180910390fd5b611dda816118a6565b50565b5f819050919050565b5f8173ffffffffffffffffffffffffffffffffffffffff163b03611e4157806040517f4c9c8ce3000000000000000000000000000000000000000000000000000000008152600401611e389190612099565b60405180910390fd5b80611e6d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5f1b611ddd565b5f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60605f5f8473ffffffffffffffffffffffffffffffffffffffff1684604051611ed891906129a7565b5f60405180830381855af49150503d805f8114611f10576040519150601f19603f3d011682016040523d82523d5f602084013e611f15565b606091505b5091509150611f25858383611f89565b9250505092915050565b5f341115611f69576040517fb398979f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b5f611f74611b58565b5f0160089054906101000a900460ff16905090565b606082611f9e57611f9982612016565b61200e565b5f8251148015611fc457505f8473ffffffffffffffffffffffffffffffffffffffff163b145b1561200657836040517f9996b315000000000000000000000000000000000000000000000000000000008152600401611ffd9190612099565b60405180910390fd5b81905061200f565b5b9392505050565b5f815111156120285780518082602001fd5b6040517fd6bda27500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6120838261205a565b9050919050565b61209381612079565b82525050565b5f6020820190506120ac5f83018461208a565b92915050565b5f604051905090565b5f5ffd5b5f5ffd5b6120cc81612079565b81146120d6575f5ffd5b50565b5f813590506120e7816120c3565b92915050565b5f5ffd5b5f5ffd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61213b826120f5565b810181811067ffffffffffffffff8211171561215a57612159612105565b5b80604052505050565b5f61216c6120b2565b90506121788282612132565b919050565b5f67ffffffffffffffff82111561219757612196612105565b5b6121a0826120f5565b9050602081019050919050565b828183375f83830152505050565b5f6121cd6121c88461217d565b612163565b9050828152602081018484840111156121e9576121e86120f1565b5b6121f48482856121ad565b509392505050565b5f82601f8301126122105761220f6120ed565b5b81356122208482602086016121bb565b91505092915050565b5f5f6040838503121561223f5761223e6120bb565b5b5f61224c858286016120d9565b925050602083013567ffffffffffffffff81111561226d5761226c6120bf565b5b612279858286016121fc565b9150509250929050565b5f819050919050565b61229581612283565b82525050565b5f6020820190506122ae5f83018461228c565b92915050565b600281106122c0575f5ffd5b50565b5f813590506122d1816122b4565b92915050565b5f5f604083850312156122ed576122ec6120bb565b5b5f6122fa858286016122c3565b925050602061230b858286016120d9565b9150509250929050565b5f819050919050565b61232781612315565b8114612331575f5ffd5b50565b5f813590506123428161231e565b92915050565b5f5ffd5b5f5ffd5b5f5f83601f840112612365576123646120ed565b5b8235905067ffffffffffffffff81111561238257612381612348565b5b60208301915083602082028301111561239e5761239d61234c565b5b9250929050565b5f5f83601f8401126123ba576123b96120ed565b5b8235905067ffffffffffffffff8111156123d7576123d6612348565b5b6020830191508360408202830111156123f3576123f261234c565b5b9250929050565b5f5f5f5f5f5f5f5f60c0898b031215612416576124156120bb565b5b5f6124238b828c01612334565b98505060206124348b828c01612334565b97505060406124458b828c016120d9565b96505060606124568b828c016120d9565b955050608089013567ffffffffffffffff811115612477576124766120bf565b5b6124838b828c01612350565b945094505060a089013567ffffffffffffffff8111156124a6576124a56120bf565b5b6124b28b828c016123a5565b92509250509295985092959890939650565b6124cd81612315565b82525050565b5f6020820190506124e65f8301846124c4565b92915050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f61251e826124ec565b61252881856124f6565b9350612538818560208601612506565b612541816120f5565b840191505092915050565b5f6020820190508181035f8301526125648184612514565b905092915050565b5f60208284031215612581576125806120bb565b5b5f61258e848285016120d9565b91505092915050565b5f5f5f604084860312156125ae576125ad6120bb565b5b5f6125bb86828701612334565b935050602084013567ffffffffffffffff8111156125dc576125db6120bf565b5b6125e886828701612350565b92509250509250925092565b5f60208284031215612609576126086120bb565b5b5f612616848285016122c3565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b7f616d6f756e7420696e2069732067726561746572207468616e20616d6f756e745f8201527f20696e206d617800000000000000000000000000000000000000000000000000602082015250565b5f6126a66027836124f6565b91506126b18261264c565b604082019050919050565b5f6020820190508181035f8301526126d38161269a565b9050919050565b7f6d73672e76616c7565206973206c657373207468616e20616d6f756e7420696e5f82015250565b5f61270e6020836124f6565b9150612719826126da565b602082019050919050565b5f6020820190508181035f83015261273b81612702565b9050919050565b7f6d73672e76616c7565206d7573742062652030000000000000000000000000005f82015250565b5f6127766013836124f6565b915061278182612742565b602082019050919050565b5f6020820190508181035f8301526127a38161276a565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f5ffd5b5f823560016040038336030381126127f6576127f56127d7565b5b80830191505092915050565b5f5ffd5b5f5ffd5b5f6040828403121561281f5761281e612802565b5b6128296040612163565b90505f612838848285016122c3565b5f83015250602082013567ffffffffffffffff81111561285b5761285a612806565b5b612867848285016121fc565b60208301525092915050565b5f61287e368361280a565b9050919050565b7f41646170746572206e6f7420666f756e640000000000000000000000000000005f82015250565b5f6128b96011836124f6565b91506128c482612885565b602082019050919050565b5f6020820190508181035f8301526128e6816128ad565b9050919050565b5f81519050919050565b5f82825260208201905092915050565b5f612911826128ed565b61291b81856128f7565b935061292b818560208601612506565b612934816120f5565b840191505092915050565b5f6040820190506129525f8301856124c4565b81810360208301526129648184612907565b90509392505050565b5f81905092915050565b5f612981826128ed565b61298b818561296d565b935061299b818560208601612506565b80840191505092915050565b5f6129b28284612977565b915081905092915050565b5f815190506129cb8161231e565b92915050565b5f602082840312156129e6576129e56120bb565b5b5f6129f3848285016129bd565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f612a3382612315565b9150612a3e83612315565b9250828203905081811115612a5657612a556129fc565b5b92915050565b5f819050919050565b5f67ffffffffffffffff82169050919050565b5f819050919050565b5f612a9b612a96612a9184612a5c565b612a78565b612a65565b9050919050565b612aab81612a81565b82525050565b5f602082019050612ac45f830184612aa2565b92915050565b5f819050919050565b5f612add82612aca565b9150612ae883612aca565b925082820390508181125f8412168282135f851215161715612b0d57612b0c6129fc565b5b92915050565b5f612b1d82612aca565b91507f80000000000000000000000000000000000000000000000000000000000000008203612b4f57612b4e6129fc565b5b600182039050919050565b7f696e76616c6964206d73672e76616c75650000000000000000000000000000005f82015250565b5f612b8e6011836124f6565b9150612b9982612b5a565b602082019050919050565b5f6020820190508181035f830152612bbb81612b82565b9050919050565b7f616d6f756e74206f7574206973206c657373207468616e20616d6f756e74206f5f8201527f7574206d696e0000000000000000000000000000000000000000000000000000602082015250565b5f612c1c6026836124f6565b9150612c2782612bc2565b604082019050919050565b5f6020820190508181035f830152612c4981612c10565b9050919050565b612c5981612283565b8114612c63575f5ffd5b50565b5f81519050612c7481612c50565b92915050565b5f60208284031215612c8f57612c8e6120bb565b5b5f612c9c84828501612c66565b91505092915050565b5f606082019050612cb85f83018661208a565b612cc5602083018561208a565b612cd260408301846124c4565b949350505050565b5f60408284031215612cef57612cee612802565b5b612cf96040612163565b90505f612d08848285016120d9565b5f830152506020612d1b84828501612334565b60208301525092915050565b5f60408284031215612d3c57612d3b6120bb565b5b5f612d4984828501612cda565b91505092915050565b5f612d5c82612315565b9150612d6783612315565b9250828202612d7581612315565b91508282048414831517612d8c57612d8b6129fc565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f612dca82612315565b9150612dd583612315565b925082612de557612de4612d93565b5b828204905092915050565b5f612dfa82612315565b9150612e0583612315565b9250828201905080821115612e1d57612e1c6129fc565b5b92915050565b5f604082019050612e365f83018561208a565b612e4360208301846124c4565b939250505056fea2646970667358221220b3fa9bdd35cf48e49351635d1560b1c8e4d332da7d6b89593f9b588f347accd064736f6c634300081c0033
Deployed Bytecode
0x6080604052600436106100e0575f3560e01c8063ad3cb1cc1161007e578063cf3722da11610058578063cf3722da14610281578063ead2fe5b146102bd578063f2fde38b146102ed578063fc6d451514610315576100e7565b8063ad3cb1cc146101f3578063c4d66de81461021d578063cc4f7dc514610245576100e7565b8063715018a6116100ba578063715018a61461015b57806376519a46146101715780638da5cb5b14610199578063a3add509146101c3576100e7565b80633fc8cef3146100eb5780634f1ef2861461011557806352d1902d14610131576100e7565b366100e757005b5f5ffd5b3480156100f6575f5ffd5b506100ff610351565b60405161010c9190612099565b60405180910390f35b61012f600480360381019061012a9190612229565b610376565b005b34801561013c575f5ffd5b50610145610395565b604051610152919061229b565b60405180910390f35b348015610166575f5ffd5b5061016f6103c6565b005b34801561017c575f5ffd5b50610197600480360381019061019291906122d7565b6103d9565b005b3480156101a4575f5ffd5b506101ad610457565b6040516101ba9190612099565b60405180910390f35b6101dd60048036038101906101d891906123fa565b61048c565b6040516101ea91906124d3565b60405180910390f35b3480156101fe575f5ffd5b50610207610a57565b604051610214919061254c565b60405180910390f35b348015610228575f5ffd5b50610243600480360381019061023e919061256c565b610a90565b005b348015610250575f5ffd5b5061026b60048036038101906102669190612597565b610c59565b60405161027891906124d3565b60405180910390f35b34801561028c575f5ffd5b506102a760048036038101906102a29190612597565b610e0e565b6040516102b491906124d3565b60405180910390f35b6102d760048036038101906102d291906123fa565b610fb2565b6040516102e491906124d3565b60405180910390f35b3480156102f8575f5ffd5b50610313600480360381019061030e919061256c565b6114d6565b005b348015610320575f5ffd5b5061033b600480360381019061033691906125f4565b61155a565b6040516103489190612099565b60405180910390f35b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61037e611589565b6103878261166f565b610391828261167a565b5050565b5f61039e611798565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5f1b905090565b6103ce61181f565b6103d75f6118a6565b565b6103e161181f565b805f5f8460018111156103f7576103f661261f565b5b60018111156104095761040861261f565b5b81526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b5f5f610461611977565b9050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691505090565b5f610498898686610c59565b9050878111156104dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d4906126bc565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16036105d65780341015610553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161054a90612724565b60405180910390fd5b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004015f604051808303818588803b1580156105ba575f5ffd5b505af11580156105cc573d5f5f3e3d5ffd5b5050505050610646565b5f3414610618576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060f9061278c565b60405180910390fd5b6106453330838a73ffffffffffffffffffffffffffffffffffffffff1661199e909392919063ffffffff16565b5b8098505f5f90505b8585905081101561086c575f86868381811061066d5761066c6127aa565b5b905060200281019061067f91906127db565b61068890612873565b90505f5f5f835f015160018111156106a3576106a261261f565b5b60018111156106b5576106b461261f565b5b81526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610752576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610749906128cf565b60405180910390fd5b5f5f8273ffffffffffffffffffffffffffffffffffffffff1663b72722c660e01b8f866020015160405160240161078a92919061293f565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516107f491906129a7565b5f60405180830381855af49150503d805f811461082c576040519150601f19603f3d011682016040523d82523d5f602084013e610831565b606091505b5091509150816108455761084481611a20565b5b8080602001905181019061085991906129d1565b9d5050505050808060010191505061064e565b505f61087a878b8686611a28565b90505f818b6108899190612a29565b90505f73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff160361098e5760015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b815260040161091891906124d3565b5f604051808303815f87803b15801561092f575f5ffd5b505af1158015610941573d5f5f3e3d5ffd5b505050503373ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f19350505050158015610988573d5f5f3e3d5ffd5b506109ba565b6109b933828a73ffffffffffffffffffffffffffffffffffffffff16611ad99092919063ffffffff16565b5b5f73ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff161480156109f457508234115b15610a49573373ffffffffffffffffffffffffffffffffffffffff166108fc8434610a1f9190612a29565b90811502906040515f60405180830381858888f19350505050158015610a47573d5f5f3e3d5ffd5b505b505098975050505050505050565b6040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b5f610a99611b58565b90505f815f0160089054906101000a900460ff161590505f825f015f9054906101000a900467ffffffffffffffff1690505f5f8267ffffffffffffffff16148015610ae15750825b90505f60018367ffffffffffffffff16148015610b1457505f3073ffffffffffffffffffffffffffffffffffffffff163b145b905081158015610b22575080155b15610b59576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001855f015f6101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055508315610ba6576001855f0160086101000a81548160ff0219169083151502179055505b610bae611b6b565b610bb733611b75565b8560015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508315610c51575f855f0160086101000a81548160ff0219169083151502179055507fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d26001604051610c489190612ab1565b60405180910390a15b505050505050565b5f8390505f600184849050610c6e9190612ad3565b90505b5f8112610e06575f848483818110610c8c57610c8b6127aa565b5b9050602002810190610c9e91906127db565b610ca790612873565b90505f5f5f835f01516001811115610cc257610cc161261f565b5b6001811115610cd457610cd361261f565b5b81526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610d71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d68906128cf565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1663943e912b8584602001516040518363ffffffff1660e01b8152600401610db092919061293f565b602060405180830381865afa158015610dcb573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610def91906129d1565b935050508080610dfe90612b13565b915050610c71565b509392505050565b5f8390505f5f90505b83839050811015610faa575f848483818110610e3657610e356127aa565b5b9050602002810190610e4891906127db565b610e5190612873565b90505f5f5f835f01516001811115610e6c57610e6b61261f565b5b6001811115610e7e57610e7d61261f565b5b81526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610f1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f12906128cf565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166344f1c8c38584602001516040518363ffffffff1660e01b8152600401610f5a92919061293f565b602060405180830381865afa158015610f75573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f9991906129d1565b935050508080600101915050610e17565b509392505050565b5f5f73ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614610fec575f610fee565b885b341461102f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102690612ba4565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16036110e55760015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db08a6040518263ffffffff1660e01b81526004015f604051808303818588803b1580156110c9575f5ffd5b505af11580156110db573d5f5f3e3d5ffd5b5050505050611113565b61111233308b8a73ffffffffffffffffffffffffffffffffffffffff1661199e909392919063ffffffff16565b5b8890505f5f90505b85859050811015611339575f86868381811061113a576111396127aa565b5b905060200281019061114c91906127db565b61115590612873565b90505f5f5f835f015160018111156111705761116f61261f565b5b60018111156111825761118161261f565b5b81526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361121f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611216906128cf565b60405180910390fd5b5f5f8273ffffffffffffffffffffffffffffffffffffffff1663b72722c660e01b87866020015160405160240161125792919061293f565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516112c191906129a7565b5f60405180830381855af49150503d805f81146112f9576040519150601f19603f3d011682016040523d82523d5f602084013e6112fe565b606091505b5091509150816113125761131181611a20565b5b8080602001905181019061132691906129d1565b955050505050808060010191505061111b565b508781101561137d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137490612c32565b60405180910390fd5b5f61138a87838686611a28565b905080826113989190612a29565b91505f73ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff160361149d5760015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836040518263ffffffff1660e01b815260040161142791906124d3565b5f604051808303815f87803b15801561143e575f5ffd5b505af1158015611450573d5f5f3e3d5ffd5b505050503373ffffffffffffffffffffffffffffffffffffffff166108fc8390811502906040515f60405180830381858888f19350505050158015611497573d5f5f3e3d5ffd5b506114c9565b6114c833838973ffffffffffffffffffffffffffffffffffffffff16611ad99092919063ffffffff16565b5b5098975050505050505050565b6114de61181f565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361154e575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016115459190612099565b60405180910390fd5b611557816118a6565b50565b5f602052805f5260405f205f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b7f000000000000000000000000e95cb1c5eb7493b017d2bc000f58ef7164c3add873ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff16148061163657507f000000000000000000000000e95cb1c5eb7493b017d2bc000f58ef7164c3add873ffffffffffffffffffffffffffffffffffffffff1661161d611b89565b73ffffffffffffffffffffffffffffffffffffffff1614155b1561166d576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b61167761181f565b50565b8173ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156116e257506040513d601f19601f820116820180604052508101906116df9190612c7a565b60015b61172357816040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815260040161171a9190612099565b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5f1b811461178957806040517faa1d49a4000000000000000000000000000000000000000000000000000000008152600401611780919061229b565b60405180910390fd5b6117938383611bdc565b505050565b7f000000000000000000000000e95cb1c5eb7493b017d2bc000f58ef7164c3add873ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff161461181d576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b611827611c4e565b73ffffffffffffffffffffffffffffffffffffffff16611845610457565b73ffffffffffffffffffffffffffffffffffffffff16146118a457611868611c4e565b6040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040161189b9190612099565b60405180910390fd5b565b5f6118af611977565b90505f815f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082825f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3505050565b5f7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300905090565b611a1a848573ffffffffffffffffffffffffffffffffffffffff166323b872dd8686866040516024016119d393929190612ca5565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c55565b50505050565b805160208201fd5b5f5f5f90505b83839050811015611ad0575f848483818110611a4d57611a4c6127aa565b5b905060400201803603810190611a639190612d27565b90505f612710826020015188611a799190612d52565b611a839190612dc0565b90508084611a919190612df0565b9350611ac1825f0151828a73ffffffffffffffffffffffffffffffffffffffff16611ad99092919063ffffffff16565b50508080600101915050611a2e565b50949350505050565b611b53838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401611b0c929190612e23565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c55565b505050565b5f5f611b62611cf0565b90508091505090565b611b73611d19565b565b611b7d611d19565b611b8681611d59565b50565b5f611bb57f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5f1b611ddd565b5f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611be582611de6565b8173ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a25f81511115611c4157611c3b8282611eaf565b50611c4a565b611c49611f2f565b5b5050565b5f33905090565b5f5f60205f8451602086015f885af180611c74576040513d5f823e3d81fd5b3d92505f519150505f8214611c8d576001811415611ca8565b5f8473ffffffffffffffffffffffffffffffffffffffff163b145b15611cea57836040517f5274afe7000000000000000000000000000000000000000000000000000000008152600401611ce19190612099565b60405180910390fd5b50505050565b5f7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005f1b905090565b611d21611f6b565b611d57576040517fd7e6bcf800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b611d61611d19565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611dd1575f6040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401611dc89190612099565b60405180910390fd5b611dda816118a6565b50565b5f819050919050565b5f8173ffffffffffffffffffffffffffffffffffffffff163b03611e4157806040517f4c9c8ce3000000000000000000000000000000000000000000000000000000008152600401611e389190612099565b60405180910390fd5b80611e6d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5f1b611ddd565b5f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60605f5f8473ffffffffffffffffffffffffffffffffffffffff1684604051611ed891906129a7565b5f60405180830381855af49150503d805f8114611f10576040519150601f19603f3d011682016040523d82523d5f602084013e611f15565b606091505b5091509150611f25858383611f89565b9250505092915050565b5f341115611f69576040517fb398979f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b5f611f74611b58565b5f0160089054906101000a900460ff16905090565b606082611f9e57611f9982612016565b61200e565b5f8251148015611fc457505f8473ffffffffffffffffffffffffffffffffffffffff163b145b1561200657836040517f9996b315000000000000000000000000000000000000000000000000000000008152600401611ffd9190612099565b60405180910390fd5b81905061200f565b5b9392505050565b5f815111156120285780518082602001fd5b6040517fd6bda27500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6120838261205a565b9050919050565b61209381612079565b82525050565b5f6020820190506120ac5f83018461208a565b92915050565b5f604051905090565b5f5ffd5b5f5ffd5b6120cc81612079565b81146120d6575f5ffd5b50565b5f813590506120e7816120c3565b92915050565b5f5ffd5b5f5ffd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61213b826120f5565b810181811067ffffffffffffffff8211171561215a57612159612105565b5b80604052505050565b5f61216c6120b2565b90506121788282612132565b919050565b5f67ffffffffffffffff82111561219757612196612105565b5b6121a0826120f5565b9050602081019050919050565b828183375f83830152505050565b5f6121cd6121c88461217d565b612163565b9050828152602081018484840111156121e9576121e86120f1565b5b6121f48482856121ad565b509392505050565b5f82601f8301126122105761220f6120ed565b5b81356122208482602086016121bb565b91505092915050565b5f5f6040838503121561223f5761223e6120bb565b5b5f61224c858286016120d9565b925050602083013567ffffffffffffffff81111561226d5761226c6120bf565b5b612279858286016121fc565b9150509250929050565b5f819050919050565b61229581612283565b82525050565b5f6020820190506122ae5f83018461228c565b92915050565b600281106122c0575f5ffd5b50565b5f813590506122d1816122b4565b92915050565b5f5f604083850312156122ed576122ec6120bb565b5b5f6122fa858286016122c3565b925050602061230b858286016120d9565b9150509250929050565b5f819050919050565b61232781612315565b8114612331575f5ffd5b50565b5f813590506123428161231e565b92915050565b5f5ffd5b5f5ffd5b5f5f83601f840112612365576123646120ed565b5b8235905067ffffffffffffffff81111561238257612381612348565b5b60208301915083602082028301111561239e5761239d61234c565b5b9250929050565b5f5f83601f8401126123ba576123b96120ed565b5b8235905067ffffffffffffffff8111156123d7576123d6612348565b5b6020830191508360408202830111156123f3576123f261234c565b5b9250929050565b5f5f5f5f5f5f5f5f60c0898b031215612416576124156120bb565b5b5f6124238b828c01612334565b98505060206124348b828c01612334565b97505060406124458b828c016120d9565b96505060606124568b828c016120d9565b955050608089013567ffffffffffffffff811115612477576124766120bf565b5b6124838b828c01612350565b945094505060a089013567ffffffffffffffff8111156124a6576124a56120bf565b5b6124b28b828c016123a5565b92509250509295985092959890939650565b6124cd81612315565b82525050565b5f6020820190506124e65f8301846124c4565b92915050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f61251e826124ec565b61252881856124f6565b9350612538818560208601612506565b612541816120f5565b840191505092915050565b5f6020820190508181035f8301526125648184612514565b905092915050565b5f60208284031215612581576125806120bb565b5b5f61258e848285016120d9565b91505092915050565b5f5f5f604084860312156125ae576125ad6120bb565b5b5f6125bb86828701612334565b935050602084013567ffffffffffffffff8111156125dc576125db6120bf565b5b6125e886828701612350565b92509250509250925092565b5f60208284031215612609576126086120bb565b5b5f612616848285016122c3565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b7f616d6f756e7420696e2069732067726561746572207468616e20616d6f756e745f8201527f20696e206d617800000000000000000000000000000000000000000000000000602082015250565b5f6126a66027836124f6565b91506126b18261264c565b604082019050919050565b5f6020820190508181035f8301526126d38161269a565b9050919050565b7f6d73672e76616c7565206973206c657373207468616e20616d6f756e7420696e5f82015250565b5f61270e6020836124f6565b9150612719826126da565b602082019050919050565b5f6020820190508181035f83015261273b81612702565b9050919050565b7f6d73672e76616c7565206d7573742062652030000000000000000000000000005f82015250565b5f6127766013836124f6565b915061278182612742565b602082019050919050565b5f6020820190508181035f8301526127a38161276a565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f5ffd5b5f823560016040038336030381126127f6576127f56127d7565b5b80830191505092915050565b5f5ffd5b5f5ffd5b5f6040828403121561281f5761281e612802565b5b6128296040612163565b90505f612838848285016122c3565b5f83015250602082013567ffffffffffffffff81111561285b5761285a612806565b5b612867848285016121fc565b60208301525092915050565b5f61287e368361280a565b9050919050565b7f41646170746572206e6f7420666f756e640000000000000000000000000000005f82015250565b5f6128b96011836124f6565b91506128c482612885565b602082019050919050565b5f6020820190508181035f8301526128e6816128ad565b9050919050565b5f81519050919050565b5f82825260208201905092915050565b5f612911826128ed565b61291b81856128f7565b935061292b818560208601612506565b612934816120f5565b840191505092915050565b5f6040820190506129525f8301856124c4565b81810360208301526129648184612907565b90509392505050565b5f81905092915050565b5f612981826128ed565b61298b818561296d565b935061299b818560208601612506565b80840191505092915050565b5f6129b28284612977565b915081905092915050565b5f815190506129cb8161231e565b92915050565b5f602082840312156129e6576129e56120bb565b5b5f6129f3848285016129bd565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f612a3382612315565b9150612a3e83612315565b9250828203905081811115612a5657612a556129fc565b5b92915050565b5f819050919050565b5f67ffffffffffffffff82169050919050565b5f819050919050565b5f612a9b612a96612a9184612a5c565b612a78565b612a65565b9050919050565b612aab81612a81565b82525050565b5f602082019050612ac45f830184612aa2565b92915050565b5f819050919050565b5f612add82612aca565b9150612ae883612aca565b925082820390508181125f8412168282135f851215161715612b0d57612b0c6129fc565b5b92915050565b5f612b1d82612aca565b91507f80000000000000000000000000000000000000000000000000000000000000008203612b4f57612b4e6129fc565b5b600182039050919050565b7f696e76616c6964206d73672e76616c75650000000000000000000000000000005f82015250565b5f612b8e6011836124f6565b9150612b9982612b5a565b602082019050919050565b5f6020820190508181035f830152612bbb81612b82565b9050919050565b7f616d6f756e74206f7574206973206c657373207468616e20616d6f756e74206f5f8201527f7574206d696e0000000000000000000000000000000000000000000000000000602082015250565b5f612c1c6026836124f6565b9150612c2782612bc2565b604082019050919050565b5f6020820190508181035f830152612c4981612c10565b9050919050565b612c5981612283565b8114612c63575f5ffd5b50565b5f81519050612c7481612c50565b92915050565b5f60208284031215612c8f57612c8e6120bb565b5b5f612c9c84828501612c66565b91505092915050565b5f606082019050612cb85f83018661208a565b612cc5602083018561208a565b612cd260408301846124c4565b949350505050565b5f60408284031215612cef57612cee612802565b5b612cf96040612163565b90505f612d08848285016120d9565b5f830152506020612d1b84828501612334565b60208301525092915050565b5f60408284031215612d3c57612d3b6120bb565b5b5f612d4984828501612cda565b91505092915050565b5f612d5c82612315565b9150612d6783612315565b9250828202612d7581612315565b91508282048414831517612d8c57612d8b6129fc565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f612dca82612315565b9150612dd583612315565b925082612de557612de4612d93565b5b828204905092915050565b5f612dfa82612315565b9150612e0583612315565b9250828201905080821115612e1d57612e1c6129fc565b5b92915050565b5f604082019050612e365f83018561208a565b612e4360208301846124c4565b939250505056fea2646970667358221220b3fa9bdd35cf48e49351635d1560b1c8e4d332da7d6b89593f9b588f347accd064736f6c634300081c0033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.