ETH Price: $3,108.32 (+0.04%)

Contract

0x5719AcDB9ABBBC6Ba414C9DBFf5B2967342f465d
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60808060173414432023-05-26 6:17:59544 days ago1685081879IN
 Create: PendleSwap
0 ETH0.0738124726.30853923

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
176978152023-07-15 9:09:35494 days ago1689412175
0x5719AcDB...7342f465d
0.001 ETH
176978152023-07-15 9:09:35494 days ago1689412175
0x5719AcDB...7342f465d
0.001 ETH
176950832023-07-14 23:54:23494 days ago1689378863
0x5719AcDB...7342f465d
25 ETH
176950832023-07-14 23:54:23494 days ago1689378863
0x5719AcDB...7342f465d
25 ETH
176934152023-07-14 18:15:23494 days ago1689358523
0x5719AcDB...7342f465d
1 ETH
176934152023-07-14 18:15:23494 days ago1689358523
0x5719AcDB...7342f465d
1 ETH
176899362023-07-14 6:30:59495 days ago1689316259
0x5719AcDB...7342f465d
31 ETH
176899362023-07-14 6:30:59495 days ago1689316259
0x5719AcDB...7342f465d
31 ETH
176617552023-07-10 7:21:59499 days ago1688973719
0x5719AcDB...7342f465d
0.03 ETH
176617552023-07-10 7:21:59499 days ago1688973719
0x5719AcDB...7342f465d
0.03 ETH
176401432023-07-07 6:27:47502 days ago1688711267
0x5719AcDB...7342f465d
0.017 ETH
176401432023-07-07 6:27:47502 days ago1688711267
0x5719AcDB...7342f465d
0.017 ETH
176122882023-07-03 8:35:11506 days ago1688373311
0x5719AcDB...7342f465d
15 ETH
176122882023-07-03 8:35:11506 days ago1688373311
0x5719AcDB...7342f465d
15 ETH
176047942023-07-02 7:18:11507 days ago1688282291
0x5719AcDB...7342f465d
61 ETH
176047942023-07-02 7:18:11507 days ago1688282291
0x5719AcDB...7342f465d
61 ETH
176019112023-07-01 21:36:23507 days ago1688247383
0x5719AcDB...7342f465d
0.02 ETH
176019112023-07-01 21:36:23507 days ago1688247383
0x5719AcDB...7342f465d
0.02 ETH
175702552023-06-27 10:56:59512 days ago1687863419
0x5719AcDB...7342f465d
100 ETH
175702552023-06-27 10:56:59512 days ago1687863419
0x5719AcDB...7342f465d
100 ETH
175664802023-06-26 22:12:47512 days ago1687817567
0x5719AcDB...7342f465d
10 ETH
175664802023-06-26 22:12:47512 days ago1687817567
0x5719AcDB...7342f465d
10 ETH
175496762023-06-24 13:28:35515 days ago1687613315
0x5719AcDB...7342f465d
20 ETH
175496762023-06-24 13:28:35515 days ago1687613315
0x5719AcDB...7342f465d
20 ETH
175231102023-06-20 19:53:59518 days ago1687290839
0x5719AcDB...7342f465d
0.01 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PendleSwap

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
default evmVersion
File 1 of 15 : PendleSwap.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;

import "../../core/libraries/TokenHelper.sol";
import "./IPSwapAggregator.sol";
import "./kyberswap/KyberInputScalingHelper.sol";

contract PendleSwap is IPSwapAggregator, TokenHelper, KyberInputScalingHelper {
    using Address for address;

    function swap(
        address tokenIn,
        uint256 amountIn,
        SwapData calldata data
    ) external payable {
        _safeApproveInf(tokenIn, data.extRouter);
        data.extRouter.functionCallWithValue(
            data.needScale
                ? _getScaledInputData(data.swapType, data.extCalldata, amountIn)
                : data.extCalldata,
            tokenIn == NATIVE ? amountIn : 0
        );
    }

    function _getScaledInputData(
        SwapType swapType,
        bytes calldata rawCallData,
        uint256 amountIn
    ) internal pure returns (bytes memory scaledCallData) {
        if (swapType == SwapType.KYBERSWAP) {
            scaledCallData = _getKyberScaledInputData(rawCallData, amountIn);
        } else if (swapType == SwapType.ONE_INCH) {
            revert("not supported");
        } else {
            assert(false);
        }
    }

    receive() external payable {}
}

File 2 of 15 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 3 of 15 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 4 of 15 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 5 of 15 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 6 of 15 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 7 of 15 : TokenHelper.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "../../interfaces/IWETH.sol";

abstract contract TokenHelper {
    using SafeERC20 for IERC20;
    address internal constant NATIVE = address(0);
    uint256 internal constant LOWER_BOUND_APPROVAL = type(uint96).max / 2; // some tokens use 96 bits for approval

    function _transferIn(address token, address from, uint256 amount) internal {
        if (token == NATIVE) require(msg.value == amount, "eth mismatch");
        else if (amount != 0) IERC20(token).safeTransferFrom(from, address(this), amount);
    }

    function _transferFrom(IERC20 token, address from, address to, uint256 amount) internal {
        if (amount != 0) token.safeTransferFrom(from, to, amount);
    }

    function _transferOut(address token, address to, uint256 amount) internal {
        if (amount == 0) return;
        if (token == NATIVE) {
            (bool success, ) = to.call{ value: amount }("");
            require(success, "eth send failed");
        } else {
            IERC20(token).safeTransfer(to, amount);
        }
    }

    function _transferOut(address[] memory tokens, address to, uint256[] memory amounts) internal {
        uint256 numTokens = tokens.length;
        require(numTokens == amounts.length, "length mismatch");
        for (uint256 i = 0; i < numTokens; ) {
            _transferOut(tokens[i], to, amounts[i]);
            unchecked {
                i++;
            }
        }
    }

    function _selfBalance(address token) internal view returns (uint256) {
        return (token == NATIVE) ? address(this).balance : IERC20(token).balanceOf(address(this));
    }

    function _selfBalance(IERC20 token) internal view returns (uint256) {
        return token.balanceOf(address(this));
    }

    /// @notice Approves the stipulated contract to spend the given allowance in the given token
    /// @dev PLS PAY ATTENTION to tokens that requires the approval to be set to 0 before changing it
    function _safeApprove(address token, address to, uint256 value) internal {
        (bool success, bytes memory data) = token.call(
            abi.encodeWithSelector(IERC20.approve.selector, to, value)
        );
        require(success && (data.length == 0 || abi.decode(data, (bool))), "Safe Approve");
    }

    function _safeApproveInf(address token, address to) internal {
        if (token == NATIVE) return;
        if (IERC20(token).allowance(address(this), to) < LOWER_BOUND_APPROVAL) {
            _safeApprove(token, to, 0);
            _safeApprove(token, to, type(uint256).max);
        }
    }

    function _wrap_unwrap_ETH(address tokenIn, address tokenOut, uint256 netTokenIn) internal {
        if (tokenIn == NATIVE) IWETH(tokenOut).deposit{ value: netTokenIn }();
        else IWETH(tokenIn).withdraw(netTokenIn);
    }
}

File 8 of 15 : IWETH.sol
// SPDX-License-Identifier: GPL-3.0-or-later
/*
 * MIT License
 * ===========
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 */
pragma solidity 0.8.17;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IWETH is IERC20 {
    event Deposit(address indexed dst, uint256 wad);
    event Withdrawal(address indexed src, uint256 wad);

    function deposit() external payable;

    function withdraw(uint256 wad) external;
}

File 9 of 15 : IPSwapAggregator.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;

struct SwapData {
    SwapType swapType;
    address extRouter;
    bytes extCalldata;
    bool needScale;
}

enum SwapType {
    NONE,
    KYBERSWAP,
    ONE_INCH,
    // ETH_WETH not used in Aggregator
    ETH_WETH
}

interface IPSwapAggregator {
    function swap(address tokenIn, uint256 amountIn, SwapData calldata swapData) external payable;
}

File 10 of 15 : IAggregationExecutor.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.12;

interface IAggregationExecutor {
    function callBytes(bytes calldata data) external payable; // 0xd9c45357

    // callbytes per swap sequence
    function swapSingleSequence(bytes calldata data) external;

    function finalTransactionProcessing(
        address tokenIn,
        address tokenOut,
        address to,
        bytes calldata destTokenFeeData
    ) external;
}

File 11 of 15 : IExecutorHelper.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

interface IExecutorHelper {
    struct Swap {
        bytes data;
        bytes4 functionSelector;
    }

    struct SwapExecutorDescription {
        Swap[][] swapSequences;
        address tokenIn;
        address tokenOut;
        uint256 minTotalAmountOut;
        address to;
        uint256 deadline;
        bytes destTokenFeeData;
    }

    struct UniSwap {
        address pool;
        address tokenIn;
        address tokenOut;
        address recipient;
        uint256 collectAmount; // amount that should be transferred to the pool
        uint256 limitReturnAmount;
        uint32 swapFee;
        uint32 feePrecision;
        uint32 tokenWeightInput;
    }

    struct StableSwap {
        address pool;
        address tokenFrom;
        address tokenTo;
        uint8 tokenIndexFrom;
        uint8 tokenIndexTo;
        uint256 dx;
        uint256 minDy;
        uint256 poolLength;
        address poolLp;
        bool isSaddle; // true: saddle, false: stable
    }

    struct CurveSwap {
        address pool;
        address tokenFrom;
        address tokenTo;
        int128 tokenIndexFrom;
        int128 tokenIndexTo;
        uint256 dx;
        uint256 minDy;
        bool usePoolUnderlying;
        bool useTriCrypto;
    }

    struct UniSwapV3ProMM {
        address recipient;
        address pool;
        address tokenIn;
        address tokenOut;
        uint256 swapAmount;
        uint256 limitReturnAmount;
        uint160 sqrtPriceLimitX96;
        bool isUniV3; // true = UniV3, false = ProMM
    }

    struct BalancerV2 {
        address vault;
        bytes32 poolId;
        address assetIn;
        address assetOut;
        uint256 amount;
        uint256 limit;
    }

    struct DODO {
        address recipient;
        address pool;
        address tokenFrom;
        address tokenTo;
        uint256 amount;
        uint256 minReceiveQuote;
        address sellHelper;
        bool isSellBase;
        bool isVersion2;
    }

    struct GMX {
        address vault;
        address tokenIn;
        address tokenOut;
        uint256 amount;
        uint256 minOut;
        address receiver;
    }

    struct Synthetix {
        address synthetixProxy;
        address tokenIn;
        address tokenOut;
        bytes32 sourceCurrencyKey;
        uint256 sourceAmount;
        bytes32 destinationCurrencyKey;
        uint256 minAmount;
        bool useAtomicExchange;
    }

    struct Platypus {
        address pool;
        address tokenIn;
        address tokenOut;
        address recipient;
        uint256 collectAmount; // amount that should be transferred to the pool
        uint256 limitReturnAmount;
    }

    struct PSM {
        address router;
        address tokenIn;
        address tokenOut;
        uint256 amountIn;
        address recipient;
    }

    struct WSTETH {
        address pool;
        uint256 amount;
        bool isWrapping;
    }

    function executeUniSwap(
        uint256 index,
        bytes memory data,
        uint256 previousAmountOut
    ) external payable returns (uint256);

    function executeStableSwap(
        uint256 index,
        bytes memory data,
        uint256 previousAmountOut
    ) external payable returns (uint256);

    function executeCurveSwap(
        uint256 index,
        bytes memory data,
        uint256 previousAmountOut
    ) external payable returns (uint256);

    function executeKyberDMMSwap(
        uint256 index,
        bytes memory data,
        uint256 previousAmountOut
    ) external payable returns (uint256);

    function executeUniV3ProMMSwap(
        uint256 index,
        bytes memory data,
        uint256 previousAmountOut
    ) external payable returns (uint256);

    function executeRfqSwap(
        uint256 index,
        bytes memory data,
        uint256 previousAmountOut
    ) external payable returns (uint256);

    function executeBalV2Swap(
        uint256 index,
        bytes memory data,
        uint256 previousAmountOut
    ) external payable returns (uint256);

    function executeDODOSwap(
        uint256 index,
        bytes memory data,
        uint256 previousAmountOut
    ) external payable returns (uint256);

    function executeVelodromeSwap(
        uint256 index,
        bytes memory data,
        uint256 previousAmountOut
    ) external payable returns (uint256);

    function executeGMXSwap(
        uint256 index,
        bytes memory data,
        uint256 previousAmountOut
    ) external payable returns (uint256);

    function executePlatypusSwap(
        uint256 index,
        bytes memory data,
        uint256 previousAmountOut
    ) external payable returns (uint256);

    function executeWrappedstETHSwap(
        uint256 index,
        bytes memory data,
        uint256 previousAmountOut
    ) external payable returns (uint256);

    function executeSynthetixSwap(
        uint256 index,
        bytes memory data,
        uint256 previousAmountOut
    ) external payable returns (uint256);

    function executeHashflowSwap(
        uint256 index,
        bytes memory data,
        uint256 previousAmountOut
    ) external payable returns (uint256);

    function executePSMSwap(
        uint256 index,
        bytes memory data,
        uint256 previousAmountOut
    ) external payable returns (uint256);

    function executeFraxSwap(
        uint256 index,
        bytes memory data,
        uint256 previousAmountOut
    ) external payable returns (uint256);

    function executeCamelotSwap(
        uint256 index,
        bytes memory data,
        uint256 previousAmountOut
    ) external payable returns (uint256);

    function executeKyberLimitOrder(
        uint256 index,
        bytes memory data,
        uint256 previousAmountOut
    ) external payable returns (uint256);
}

File 12 of 15 : IHashflow.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.17;

interface IHashflow {
    enum RFQType {
        TAKER,
        MAKER
    }

    struct Quote {
        RFQType rfqType;
        address pool;
        address eoa;
        address trader;
        address effectiveTrader;
        address baseToken;
        address quoteToken;
        uint256 effectiveBaseTokenAmount;
        uint256 maxBaseTokenAmount;
        uint256 maxQuoteTokenAmount;
        uint256 fees;
        uint256 quoteExpiry;
        uint256 nonce;
        bytes32 txid;
        bytes signedQuote;
    }

    function tradeSingleHop(Quote memory quote) external payable;
}

File 13 of 15 : IMetaAggregationRouterV2.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { IAggregationExecutor } from "./IAggregationExecutor.sol";

interface IMetaAggregationRouterV2 {
    struct SwapDescriptionV2 {
        IERC20 srcToken;
        IERC20 dstToken;
        address[] srcReceivers; // transfer src token to these addresses, default
        uint256[] srcAmounts;
        address[] feeReceivers;
        uint256[] feeAmounts;
        address dstReceiver;
        uint256 amount;
        uint256 minReturnAmount;
        uint256 flags;
        bytes permit;
    }

    /// @dev  use for swapGeneric and swap to avoid stack too deep
    struct SwapExecutionParams {
        address callTarget; // call this address
        address approveTarget; // approve this address if _APPROVE_FUND set
        bytes targetData;
        SwapDescriptionV2 desc;
        bytes clientData;
    }

    function swap(SwapExecutionParams calldata execution)
        external
        payable
        returns (uint256, uint256);

    function swapSimpleMode(
        IAggregationExecutor caller,
        SwapDescriptionV2 memory desc,
        bytes calldata executorData,
        bytes calldata clientData
    ) external returns (uint256, uint256);
}

File 14 of 15 : KyberInputScalingHelper.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.17;
import "./IMetaAggregationRouterV2.sol";
import "./IHashflow.sol";
import "./IExecutorHelper.sol";
import "./ScalingDataLib.sol";

abstract contract KyberInputScalingHelper {
    uint256 private constant _PARTIAL_FILL = 0x01;
    uint256 private constant _REQUIRES_EXTRA_ETH = 0x02;
    uint256 private constant _SHOULD_CLAIM = 0x04;
    uint256 private constant _BURN_FROM_MSG_SENDER = 0x08;
    uint256 private constant _BURN_FROM_TX_ORIGIN = 0x10;
    uint256 private constant _SIMPLE_SWAP = 0x20;

    // fee data in case taking in dest token
    struct PositiveSlippageFeeData {
        uint256 partnerPSInfor; // [partnerReceiver (160 bit) + partnerPercent(96bits)]
        uint256 expectedReturnAmount;
    }

    struct Swap {
        bytes data;
        bytes4 functionSelector;
    }

    struct SimpleSwapData {
        address[] firstPools;
        uint256[] firstSwapAmounts;
        bytes[] swapDatas;
        uint256 deadline;
        bytes positiveSlippageData;
    }

    struct SwapExecutorDescription {
        Swap[][] swapSequences;
        address tokenIn;
        address tokenOut;
        uint256 minTotalAmountOut;
        address to;
        uint256 deadline;
        bytes positiveSlippageData;
    }

    function _getKyberScaledInputData(bytes calldata inputData, uint256 newAmount)
        internal
        pure
        returns (bytes memory)
    {
        bytes4 selector = bytes4(inputData[:4]);
        bytes calldata dataToDecode = inputData[4:];

        if (selector == IMetaAggregationRouterV2.swap.selector) {
            IMetaAggregationRouterV2.SwapExecutionParams memory params = abi.decode(
                dataToDecode,
                (IMetaAggregationRouterV2.SwapExecutionParams)
            );

            (params.desc, params.targetData) = _getScaledInputDataV2(
                params.desc,
                params.targetData,
                newAmount,
                _flagsChecked(params.desc.flags, _SIMPLE_SWAP)
            );
            return abi.encodeWithSelector(selector, params);
        } else if (selector == IMetaAggregationRouterV2.swapSimpleMode.selector) {
            (
                address callTarget,
                IMetaAggregationRouterV2.SwapDescriptionV2 memory desc,
                bytes memory targetData,
                bytes memory clientData
            ) = abi.decode(
                    dataToDecode,
                    (address, IMetaAggregationRouterV2.SwapDescriptionV2, bytes, bytes)
                );

            (desc, targetData) = _getScaledInputDataV2(desc, targetData, newAmount, true);
            return abi.encodeWithSelector(selector, callTarget, desc, targetData, clientData);
        } else revert("InputScalingHelper: Invalid selector");
    }

    function _getScaledInputDataV2(
        IMetaAggregationRouterV2.SwapDescriptionV2 memory desc,
        bytes memory executorData,
        uint256 newAmount,
        bool isSimpleMode
    ) internal pure returns (IMetaAggregationRouterV2.SwapDescriptionV2 memory, bytes memory) {
        uint256 oldAmount = desc.amount;
        if (oldAmount == newAmount) {
            return (desc, executorData);
        }

        // simple mode swap
        if (isSimpleMode) {
            return (
                _scaledSwapDescriptionV2(desc, oldAmount, newAmount),
                _scaledSimpleSwapData(executorData, oldAmount, newAmount)
            );
        }

        //normal mode swap
        return (
            _scaledSwapDescriptionV2(desc, oldAmount, newAmount),
            _scaledExecutorCallBytesData(executorData, oldAmount, newAmount)
        );
    }

    /// @dev Scale the swap description
    function _scaledSwapDescriptionV2(
        IMetaAggregationRouterV2.SwapDescriptionV2 memory desc,
        uint256 oldAmount,
        uint256 newAmount
    ) internal pure returns (IMetaAggregationRouterV2.SwapDescriptionV2 memory) {
        desc.minReturnAmount = (desc.minReturnAmount * newAmount) / oldAmount;
        if (desc.minReturnAmount == 0) desc.minReturnAmount = 1;
        desc.amount = newAmount;

        uint256 nReceivers = desc.srcReceivers.length;
        for (uint256 i = 0; i < nReceivers; ) {
            desc.srcAmounts[i] = (desc.srcAmounts[i] * newAmount) / oldAmount;
            unchecked {
                ++i;
            }
        }
        return desc;
    }

    /// @dev Scale the executorData in case swapSimpleMode
    function _scaledSimpleSwapData(
        bytes memory data,
        uint256 oldAmount,
        uint256 newAmount
    ) internal pure returns (bytes memory) {
        SimpleSwapData memory swapData = abi.decode(data, (SimpleSwapData));

        uint256 nPools = swapData.firstPools.length;
        for (uint256 i = 0; i < nPools; ) {
            swapData.firstSwapAmounts[i] = (swapData.firstSwapAmounts[i] * newAmount) / oldAmount;
            unchecked {
                ++i;
            }
        }
        swapData.positiveSlippageData = _scaledPositiveSlippageFeeData(
            swapData.positiveSlippageData,
            oldAmount,
            newAmount
        );
        return abi.encode(swapData);
    }

    /// @dev Scale the executorData in case normal swap
    function _scaledExecutorCallBytesData(
        bytes memory data,
        uint256 oldAmount,
        uint256 newAmount
    ) internal pure returns (bytes memory) {
        SwapExecutorDescription memory executorDesc = abi.decode(data, (SwapExecutorDescription));
        executorDesc.minTotalAmountOut = (executorDesc.minTotalAmountOut * newAmount) / oldAmount;
        executorDesc.positiveSlippageData = _scaledPositiveSlippageFeeData(
            executorDesc.positiveSlippageData,
            oldAmount,
            newAmount
        );

        uint256 nSequences = executorDesc.swapSequences.length;
        for (uint256 i = 0; i < nSequences; ) {
            Swap memory swap = executorDesc.swapSequences[i][0];
            bytes4 functionSelector = swap.functionSelector;

            if (functionSelector == IExecutorHelper.executeUniSwap.selector) {
                swap.data = ScalingDataLib.newUniSwap(swap.data, oldAmount, newAmount);
            } else if (functionSelector == IExecutorHelper.executeStableSwap.selector) {
                swap.data = ScalingDataLib.newStableSwap(swap.data, oldAmount, newAmount);
            } else if (functionSelector == IExecutorHelper.executeCurveSwap.selector) {
                swap.data = ScalingDataLib.newCurveSwap(swap.data, oldAmount, newAmount);
            } else if (functionSelector == IExecutorHelper.executeKyberDMMSwap.selector) {
                swap.data = ScalingDataLib.newKyberDMM(swap.data, oldAmount, newAmount);
            } else if (functionSelector == IExecutorHelper.executeUniV3ProMMSwap.selector) {
                swap.data = ScalingDataLib.newUniV3ProMM(swap.data, oldAmount, newAmount);
            } else if (functionSelector == IExecutorHelper.executeRfqSwap.selector) {
                revert("InputScalingHelper: Can not scale RFQ swap");
            } else if (functionSelector == IExecutorHelper.executeBalV2Swap.selector) {
                swap.data = ScalingDataLib.newBalancerV2(swap.data, oldAmount, newAmount);
            } else if (functionSelector == IExecutorHelper.executeWrappedstETHSwap.selector) {
                swap.data = ScalingDataLib.newWrappedstETHSwap(swap.data, oldAmount, newAmount);
            } else if (functionSelector == IExecutorHelper.executeDODOSwap.selector) {
                swap.data = ScalingDataLib.newDODO(swap.data, oldAmount, newAmount);
            } else if (functionSelector == IExecutorHelper.executeVelodromeSwap.selector) {
                swap.data = ScalingDataLib.newVelodrome(swap.data, oldAmount, newAmount);
            } else if (functionSelector == IExecutorHelper.executeGMXSwap.selector) {
                swap.data = ScalingDataLib.newGMX(swap.data, oldAmount, newAmount);
            } else if (functionSelector == IExecutorHelper.executeSynthetixSwap.selector) {
                swap.data = ScalingDataLib.newSynthetix(swap.data, oldAmount, newAmount);
            } else if (functionSelector == IExecutorHelper.executeHashflowSwap.selector) {
                revert("InputScalingHelper: Can not scale RFQ swap");
            } else if (functionSelector == IExecutorHelper.executeCamelotSwap.selector) {
                swap.data = ScalingDataLib.newCamelot(swap.data, oldAmount, newAmount);
            } else if (functionSelector == IExecutorHelper.executeKyberLimitOrder.selector) {
                revert("InputScalingHelper: Can not scale RFQ swap");
            } else if (functionSelector == IExecutorHelper.executePSMSwap.selector) {
                swap.data = ScalingDataLib.newPSM(swap.data, oldAmount, newAmount);
            } else if (functionSelector == IExecutorHelper.executeFraxSwap.selector) {
                swap.data = ScalingDataLib.newFrax(swap.data, oldAmount, newAmount);
            } else if (functionSelector == IExecutorHelper.executePlatypusSwap.selector) {
                swap.data = ScalingDataLib.newPlatypus(swap.data, oldAmount, newAmount);
            } else revert("AggregationExecutor: Dex type not supported");
            unchecked {
                ++i;
            }
        }
        return abi.encode(executorDesc);
    }

    function _scaledPositiveSlippageFeeData(
        bytes memory data,
        uint256 oldAmount,
        uint256 newAmount
    ) internal pure returns (bytes memory newData) {
        if (data.length > 32) {
            PositiveSlippageFeeData memory psData = abi.decode(data, (PositiveSlippageFeeData));
            psData.expectedReturnAmount = (psData.expectedReturnAmount * newAmount) / oldAmount;
            data = abi.encode(psData);
        } else if (data.length == 32) {
            uint256 expectedReturnAmount = abi.decode(data, (uint256));
            expectedReturnAmount = (expectedReturnAmount * newAmount) / oldAmount;
            data = abi.encode(expectedReturnAmount);
        }
        return data;
    }

    function _flagsChecked(uint256 number, uint256 flag) internal pure returns (bool) {
        return number & flag != 0;
    }
}

File 15 of 15 : ScalingDataLib.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "./IExecutorHelper.sol";

library ScalingDataLib {
    function newUniSwap(
        bytes memory data,
        uint256 oldAmount,
        uint256 newAmount
    ) internal pure returns (bytes memory) {
        IExecutorHelper.UniSwap memory uniSwap = abi.decode(data, (IExecutorHelper.UniSwap));
        uniSwap.collectAmount = (uniSwap.collectAmount * newAmount) / oldAmount;
        return abi.encode(uniSwap);
    }

    function newStableSwap(
        bytes memory data,
        uint256 oldAmount,
        uint256 newAmount
    ) internal pure returns (bytes memory) {
        IExecutorHelper.StableSwap memory stableSwap = abi.decode(
            data,
            (IExecutorHelper.StableSwap)
        );
        stableSwap.dx = (stableSwap.dx * newAmount) / oldAmount;
        return abi.encode(stableSwap);
    }

    function newCurveSwap(
        bytes memory data,
        uint256 oldAmount,
        uint256 newAmount
    ) internal pure returns (bytes memory) {
        IExecutorHelper.CurveSwap memory curveSwap = abi.decode(data, (IExecutorHelper.CurveSwap));
        curveSwap.dx = (curveSwap.dx * newAmount) / oldAmount;
        return abi.encode(curveSwap);
    }

    function newKyberDMM(
        bytes memory data,
        uint256 oldAmount,
        uint256 newAmount
    ) internal pure returns (bytes memory) {
        IExecutorHelper.UniSwap memory kyberDMMSwap = abi.decode(data, (IExecutorHelper.UniSwap));
        kyberDMMSwap.collectAmount = (kyberDMMSwap.collectAmount * newAmount) / oldAmount;
        return abi.encode(kyberDMMSwap);
    }

    function newUniV3ProMM(
        bytes memory data,
        uint256 oldAmount,
        uint256 newAmount
    ) internal pure returns (bytes memory) {
        IExecutorHelper.UniSwapV3ProMM memory uniSwapV3ProMM = abi.decode(
            data,
            (IExecutorHelper.UniSwapV3ProMM)
        );
        uniSwapV3ProMM.swapAmount = (uniSwapV3ProMM.swapAmount * newAmount) / oldAmount;

        return abi.encode(uniSwapV3ProMM);
    }

    function newBalancerV2(
        bytes memory data,
        uint256 oldAmount,
        uint256 newAmount
    ) internal pure returns (bytes memory) {
        IExecutorHelper.BalancerV2 memory balancerV2 = abi.decode(
            data,
            (IExecutorHelper.BalancerV2)
        );
        balancerV2.amount = (balancerV2.amount * newAmount) / oldAmount;
        return abi.encode(balancerV2);
    }

    function newDODO(
        bytes memory data,
        uint256 oldAmount,
        uint256 newAmount
    ) internal pure returns (bytes memory) {
        IExecutorHelper.DODO memory dodo = abi.decode(data, (IExecutorHelper.DODO));
        dodo.amount = (dodo.amount * newAmount) / oldAmount;
        return abi.encode(dodo);
    }

    function newVelodrome(
        bytes memory data,
        uint256 oldAmount,
        uint256 newAmount
    ) internal pure returns (bytes memory) {
        IExecutorHelper.UniSwap memory velodrome = abi.decode(data, (IExecutorHelper.UniSwap));
        velodrome.collectAmount = (velodrome.collectAmount * newAmount) / oldAmount;
        return abi.encode(velodrome);
    }

    function newGMX(
        bytes memory data,
        uint256 oldAmount,
        uint256 newAmount
    ) internal pure returns (bytes memory) {
        IExecutorHelper.GMX memory gmx = abi.decode(data, (IExecutorHelper.GMX));
        gmx.amount = (gmx.amount * newAmount) / oldAmount;
        return abi.encode(gmx);
    }

    function newSynthetix(
        bytes memory data,
        uint256 oldAmount,
        uint256 newAmount
    ) internal pure returns (bytes memory) {
        IExecutorHelper.Synthetix memory synthetix = abi.decode(data, (IExecutorHelper.Synthetix));
        synthetix.sourceAmount = (synthetix.sourceAmount * newAmount) / oldAmount;
        return abi.encode(synthetix);
    }

    function newCamelot(
        bytes memory data,
        uint256 oldAmount,
        uint256 newAmount
    ) internal pure returns (bytes memory) {
        IExecutorHelper.UniSwap memory camelot = abi.decode(data, (IExecutorHelper.UniSwap));
        camelot.collectAmount = (camelot.collectAmount * newAmount) / oldAmount;
        return abi.encode(camelot);
    }

    function newPlatypus(
        bytes memory data,
        uint256 oldAmount,
        uint256 newAmount
    ) internal pure returns (bytes memory) {
        IExecutorHelper.Platypus memory platypus = abi.decode(data, (IExecutorHelper.Platypus));
        platypus.collectAmount = (platypus.collectAmount * newAmount) / oldAmount;
        return abi.encode(platypus);
    }

    function newWrappedstETHSwap(
        bytes memory data,
        uint256 oldAmount,
        uint256 newAmount
    ) internal pure returns (bytes memory) {
        IExecutorHelper.WSTETH memory wstEthData = abi.decode(data, (IExecutorHelper.WSTETH));
        wstEthData.amount = (wstEthData.amount * newAmount) / oldAmount;
        return abi.encode(wstEthData);
    }

    function newPSM(
        bytes memory data,
        uint256 oldAmount,
        uint256 newAmount
    ) internal pure returns (bytes memory) {
        IExecutorHelper.PSM memory psm = abi.decode(data, (IExecutorHelper.PSM));
        psm.amountIn = (psm.amountIn * newAmount) / oldAmount;
        return abi.encode(psm);
    }

    function newFrax(
        bytes memory data,
        uint256 oldAmount,
        uint256 newAmount
    ) internal pure returns (bytes memory) {
        IExecutorHelper.UniSwap memory frax = abi.decode(data, (IExecutorHelper.UniSwap));
        frax.collectAmount = (frax.collectAmount * newAmount) / oldAmount;
        return abi.encode(frax);
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 1000000
  },
  "viaIR": true,
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"components":[{"internalType":"enum SwapType","name":"swapType","type":"uint8"},{"internalType":"address","name":"extRouter","type":"address"},{"internalType":"bytes","name":"extCalldata","type":"bytes"},{"internalType":"bool","name":"needScale","type":"bool"}],"internalType":"struct SwapData","name":"data","type":"tuple"}],"name":"swap","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080806040523461001657613207908161001c8239f35b600080fdfe60406080815260049081361015610020575b5050361561001e57600080fd5b005b600091823560e01c632bdb823c146100385750610011565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc6060813601126103495781359073ffffffffffffffffffffffffffffffffffffffff82169283830361034557602491823560449182359567ffffffffffffffff8711610341576080878601928836030112610341576100cd906100c8878901916100c283610373565b906106b9565b610373565b95606481013580151581036103205784901561032457508135918583101561032057846100fb920190610394565b916001810361028a5750610110918391610cdd565b955b61028257925b865196610124886104a2565b602988527f416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c60208901527f7565206661696c656400000000000000000000000000000000000000000000008189015284471061020157853b156101a657886101a28982808b8b8b602083519301915af161019c6105c5565b9061065b565b5080f35b91601d7f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000009260206064969551957f08c379a0000000000000000000000000000000000000000000000000000000008752860152840152820152fd5b9160267f416464726573733a20696e73756666696369656e742062616c616e636520666f9260206084969551957f08c379a00000000000000000000000000000000000000000000000000000000087528601528401528201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152fd5b508692610118565b85858b8d60028b95146000146102f5575090600d60649460207f6e6f7420737570706f72746564000000000000000000000000000000000000009451957f08c379a0000000000000000000000000000000000000000000000000000000008752860152840152820152fd5b806001857f4e487b710000000000000000000000000000000000000000000000000000000088945252fd5b8a80fd5b9161033b92610334920190610394565b369161058e565b95610112565b8980fd5b8580fd5b8380fd5b359073ffffffffffffffffffffffffffffffffffffffff8216820361036e57565b600080fd5b3573ffffffffffffffffffffffffffffffffffffffff8116810361036e5790565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18136030182121561036e570180359067ffffffffffffffff821161036e5760200191813603831361036e57565b60a0810190811067ffffffffffffffff82111761040157604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040810190811067ffffffffffffffff82111761040157604052565b60c0810190811067ffffffffffffffff82111761040157604052565b610100810190811067ffffffffffffffff82111761040157604052565b610120810190811067ffffffffffffffff82111761040157604052565b6060810190811067ffffffffffffffff82111761040157604052565b6080810190811067ffffffffffffffff82111761040157604052565b60e0810190811067ffffffffffffffff82111761040157604052565b610140810190811067ffffffffffffffff82111761040157604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761040157604052565b67ffffffffffffffff811161040157601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b92919261059a82610554565b916105a86040519384610513565b82948184528183011161036e578281602093846000960137010152565b3d156105f0573d906105d682610554565b916105e46040519384610513565b82523d6000602084013e565b606090565b60005b8381106106085750506000910152565b81810151838201526020016105f8565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602093610654815180928187528780880191016105f5565b0116010190565b90919015610667575090565b8151156106775750805190602001fd5b6106b5906040519182917f08c379a0000000000000000000000000000000000000000000000000000000008352602060048401526024830190610618565b0390fd5b9073ffffffffffffffffffffffffffffffffffffffff9182811690811561097e576040918251809581957fdd62ed3e0000000000000000000000000000000000000000000000000000000083523060048401521691826024830152602096879160449788915afa801561097357600090610937575b6b7fffffffffffffffffffffff91501061074a575b5050505050565b8251906000808784017f095ea7b30000000000000000000000000000000000000000000000000000000094858252846024820152828982015288815261078f816104be565b519082875af161079d6105c5565b816108ff575b50156108a357916000929183809386519089820193845260248201527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff888201528781526107f0816104be565b51925af16107fc6105c5565b8161086b575b501561080f578080610743565b606492917f5361666520417070726f766500000000000000000000000000000000000000009151927f08c379a00000000000000000000000000000000000000000000000000000000084526004840152600c6024840152820152fd5b80915051848115918215610884575b5050905038610802565b838092935001031261036e578361089b9101610984565b80843861087a565b6064867f5361666520417070726f76650000000000000000000000000000000000000000878751927f08c379a00000000000000000000000000000000000000000000000000000000084526004840152600c6024840152820152fd5b80915051878115918215610918575b50509050386107a3565b838092935001031261036e578661092f9101610984565b80873861090e565b8682813d831161096c575b61094c8183610513565b8101031261096957506b7fffffffffffffffffffffff905161072e565b80fd5b503d610942565b84513d6000823e3d90fd5b50505050565b5190811515820361036e57565b67ffffffffffffffff81116104015760051b60200190565b81601f8201121561036e578035916109c083610991565b926109ce6040519485610513565b808452602092838086019260051b82010192831161036e578301905b8282106109f8575050505090565b838091610a048461034d565b8152019101906109ea565b81601f8201121561036e57803591610a2683610991565b92610a346040519485610513565b808452602092838086019260051b82010192831161036e578301905b828210610a5e575050505090565b81358152908301908301610a50565b9080601f8301121561036e57816020610a889335910161058e565b90565b91909161016090818185031261036e576040519182019067ffffffffffffffff9183811083821117610401576040528294610ac58261034d565b8452610ad36020830161034d565b6020850152604082013583811161036e5781610af09184016109a9565b6040850152606082013583811161036e5781610b0d918401610a0f565b6060850152608082013583811161036e5781610b2a9184016109a9565b608085015260a082013583811161036e5781610b47918401610a0f565b60a0850152610b5860c0830161034d565b60c085015260e082013560e085015261010080830135908501526101208083013590850152610140928383013590811161036e57610b969201610a6d565b910152565b90815180825260208080930193019160005b828110610bbb575050505090565b835173ffffffffffffffffffffffffffffffffffffffff1685529381019392810192600101610bad565b90815180825260208080930193019160005b828110610c05575050505090565b835185529381019392810192600101610bf7565b90610a889173ffffffffffffffffffffffffffffffffffffffff91828251168152826020830151166020820152610c9e610c8c610c7a610c686040860151610160806040880152860190610b9b565b60608601518582036060870152610be5565b60808501518482036080860152610b9b565b60a084015183820360a0850152610be5565b9260c08301511660c082015260e082015160e0820152610100808301519082015261012080830151908201526101408092015191818403910152610618565b909160049280841161036e5782357fffffffff000000000000000000000000000000000000000000000000000000001691848401917fe21fd0e9000000000000000000000000000000000000000000000000000000008403610f005784017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc92602084878403011261036e57359467ffffffffffffffff9586811161036e5760a0910193848303011261036e5760405190610d97826103e5565b610da287850161034d565b8252610db06024850161034d565b9660208301978852604485013587811161036e578282610dd292880101610a6d565b60408401908152606486013588811161036e578383610df392890101610a8b565b9360608101948552608487013598891161036e57610e42610e24610ec395610e8f95610a889c610ed49b0101610a6d565b966080830197885286519084516020610120840151161515926114db565b83528552604051998a9860208a0152602060248a015273ffffffffffffffffffffffffffffffffffffffff8092511660448a0152511660648801525160a0608488015260e4870190610618565b9151917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbc92838783030160a4880152610c19565b9151908483030160c4850152610618565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282610513565b909391907f8af033fb00000000000000000000000000000000000000000000000000000000840361104d5782019060807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc848403011261036e57359473ffffffffffffffffffffffffffffffffffffffff861680960361036e5767ffffffffffffffff90602484013582811161036e578382610f9e92870101610a8b565b91604485013581811161036e578483610fb992880101610a6d565b96606486013591821161036e57610a8897610fe461100d9661103e95610fea95610ed49a0101610a6d565b94611136565b9390604051988997602089015260248801526080604488015260a4870190610c19565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc9384878303016064880152610618565b91848303016084850152610618565b6084866020604051917f08c379a00000000000000000000000000000000000000000000000000000000083528201526024808201527f496e7075745363616c696e6748656c7065723a20496e76616c69642073656c6560448201527f63746f72000000000000000000000000000000000000000000000000000000006064820152fd5b60405190610160820182811067ffffffffffffffff821117610401576040528161014060009182815282602082015260609283604083015283808301528360808301528360a08301528060c08301528060e0830152806101008301526101208201520152565b9192906111416110d0565b5060e0830151928484146114d557848461115a92612ece565b908051810193602094858101868483031261036e57868401519367ffffffffffffffff9485811161036e5760a091018093031261036e576040805161119e816103e5565b8884015186811161036e57840183603f8201121561036e5789810151906111c482610991565b916111d185519384610513565b808352848c84019160051b8301019186831161036e57858d9101915b8383106114bd575050505081528184015186811161036e5784019583603f8801121561036e57898701519661122188610991565b9761122e8551998a610513565b808952848c8a019160051b8301019186831161036e57858d9101915b8383106114ad575084019889525050606085015181811161036e5785019380603f8601121561036e578a8501519461128186610991565b9561128e86519788610513565b808752858d88019160051b8301019183831161036e57868101915b83831061148857505050508383019485526080860151956060840196875260a081015192831161036e579a6112ea92819a9b9c999897969594990101612f6b565b936080870194855286515160005b81811061143f5750506113659161131660a09c611331938851612fad565b865280519b8c988a808b0152519189015260e0880190610b9b565b9451947fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc09586888303016060890152610be5565b905195848683030160808701528651908183528083019281808460051b8301019901936000915b8483106113e957505050505050916113e594916113b9935160a086015251908483030160c0850152610618565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101855284610513565b9190565b919395969798509193988480611429837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe086600196030187528d51610618565b9b019301930190928c989796959394929461138c565b8061146b848f9c9e9d9c611466906114606001968e9f9a9b9c9d9e51612eba565b51612e3f565b612e81565b611476828c51612eba565b52019a98999a979695949392976112f8565b825186811161036e578f916114a2878b8594870101612f6b565b8152019201916112a9565b82518152918101918d910161124a565b81906114c884612f4a565b8152019101908c906111ed565b93509150565b939290936114e76110d0565b5060e081015191838314612e3757612a8657828261150492612ece565b91845185019460208187031261036e5760208101519067ffffffffffffffff821161036e5760e082820188031261036e576040519660e0880188811067ffffffffffffffff821117610401576040526020838301015167ffffffffffffffff811161036e5760208201603f828686010101121561036e576020818585010101519061158e82610991565b9161159c6040519384610513565b80835260208301916020850160408360051b838a8a010101011161036e576040818888010101925b60408360051b838a8a01010101841061291e575050505088526115eb604084840101612f4a565b60208901526115fe606084840101612f4a565b6040890152818301608081015160608a015261161c9060a001612f4a565b608089015281830160c081015160a08a015260e0015167ffffffffffffffff811161036e5761165393602080930193010101612f6b565b60c086015261166a82611466836060890151612e3f565b606086015261167e818360c0880151612fad565b60c08601528451519060005b8281106118495750505050604051926020808501528381519160e0604083015261012082018351809152610140906020828501928260051b8601019501916000905b82821061175e57505050506113e59260c06113b99273ffffffffffffffffffffffffffffffffffffffff806020830151166060870152806040830151166080870152606082015160a08701526080820151168286015260a081015160e086015201517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc084830301610100850152610618565b9193947ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec0908792949703018252855190815180825260208201906020808260051b85010194019260005b8281106117ca57505050505060208060019297019201920188949391926116cc565b9091929394602080827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08660019503018852885190827fffffffff00000000000000000000000000000000000000000000000000000000816118358551604086526040860190610618565b9401511691015297019501939291016117a8565b611854818851612eba565b518051156128ef5760200151907fffffffff000000000000000000000000000000000000000000000000000000006020830151167fd07961740000000000000000000000000000000000000000000000000000000081146000146118cb5750816118c284876001955161306f565b90525b0161168a565b7f234c8880000000000000000000000000000000000000000000000000000000008103611ac5575081516101408180518101031261036e57604051908161014081011067ffffffffffffffff610140840111176104015786611466866119d093610140860160405261193f60208201612f4a565b865261194d60408201612f4a565b602087015261195e60608201612f4a565b604087015261196f608082016131b5565b606087015261198060a082016131b5565b60808701526119c561014060c0830151928360a08a015260e081015160c08a015261010081015160e08a01526119b96101208201612f4a565b6101008a015201610984565b610120870152612e3f565b60a08201526101206040519173ffffffffffffffffffffffffffffffffffffffff815116602084015273ffffffffffffffffffffffffffffffffffffffff602082015116604084015273ffffffffffffffffffffffffffffffffffffffff604082015116606084015260ff80606083015116608085015260808201511660a084015260a081015160c084015260c081015160e084015260e081015161010084015273ffffffffffffffffffffffffffffffffffffffff610100820151168284015201511515610140820152610140815261016081019281841067ffffffffffffffff85111761040157600193604052526118c5565b7fcbf622d3000000000000000000000000000000000000000000000000000000008103611c3f575081516101208180518101031261036e57600192611ba6876114668760405195611b1587610485565b611b2160208201612f4a565b8752611b2f60408201612f4a565b6020880152611b4060608201612f4a565b6040880152611b51608082016131c3565b6060880152611b6260a082016131c3565b6080880152611b9b61012060c0830151928360a08b015260e081015160c08b0152611b906101008201610984565b60e08b015201610984565b610100880152612e3f565b60a08301526101006040519273ffffffffffffffffffffffffffffffffffffffff80825116602086015280602083015116604086015260408201511660608501526060810151600f90810b60808601526080820151900b60a085015260a081015160c085015260c081015160e085015260e0810151151582850152015115156101208301526101208252611c39826104f6565b526118c5565b7f4944c815000000000000000000000000000000000000000000000000000000008103611c7d575081611c7684876001955161306f565b90526118c5565b7f9e8aa935000000000000000000000000000000000000000000000000000000008103611e3757508151916101008380518101031261036e5760405190611cc382610468565b611ccf60208501612f4a565b8252611cdd60408501612f4a565b6020830152611cee60608501612f4a565b6040830152611cff60808501612f4a565b606083015260a084015180608084015260c085015160a084015260e08501519073ffffffffffffffffffffffffffffffffffffffff8216820361036e57611466878a92611d5a61010060019a611d649760c08b015201610984565b60e0880152612e3f565b608083015260e06040519273ffffffffffffffffffffffffffffffffffffffff815116602085015273ffffffffffffffffffffffffffffffffffffffff602082015116604085015273ffffffffffffffffffffffffffffffffffffffff604082015116606085015273ffffffffffffffffffffffffffffffffffffffff6060820151166080850152608081015160a085015260a081015160c085015273ffffffffffffffffffffffffffffffffffffffff60c08201511682850152015115156101008301526101008252611c3982610485565b7fee76c642000000000000000000000000000000000000000000000000000000008103611ee3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f496e7075745363616c696e6748656c7065723a2043616e206e6f74207363616c60448201527f65205246512073776170000000000000000000000000000000000000000000006064820152608490fd5b7fa5d0728f000000000000000000000000000000000000000000000000000000008103611fe55750815160c08180518101031261036e57600192604051611f298161044c565b611f3560208401612f4a565b815260408301519260208201938452611f5060608201612f4a565b9360408301948552611f6460808301612f4a565b6060840190815260a083015193611f928c6114668c60c060808601988a8a5201519860a08601998a52612e3f565b84526040519673ffffffffffffffffffffffffffffffffffffffff93848093511660208a015251604089015251166060870152511660808501525160a08401525160c083015260c08252611c39826104da565b7f583e56d70000000000000000000000000000000000000000000000000000000081036120b8575081519160608380518101031261036e5760405190606082019382851067ffffffffffffffff8611176104015760019460405261204b60208201612f4a565b835260408101519061207b896114668961206e606060208a019688885201610984565b9560408901968752612e3f565b815273ffffffffffffffffffffffffffffffffffffffff6040519451166020850152516040840152511515606083015260608252611c39826104be565b7f8a5da90f000000000000000000000000000000000000000000000000000000008103612213575081516101208180518101031261036e5760019261218387611466876040519561210887610485565b61211460208201612f4a565b875261212260408201612f4a565b602088015261213360608201612f4a565b604088015261214460808201612f4a565b6060880152611b9b61012060a0830151928360808b015260c081015160a08b015261217160e08201612f4a565b60c08b0152611b906101008201610984565b60808301526101006040519273ffffffffffffffffffffffffffffffffffffffff808251166020860152806020830151166040860152806040830151166060860152806060830151166080860152608082015160a086015260a082015160c086015260c08201511660e085015260e0810151151582850152015115156101208301526101208252611c39826104f6565b7fa067e24b00000000000000000000000000000000000000000000000000000000810361224a575081611c7684876001955161306f565b7fad2261ff0000000000000000000000000000000000000000000000000000000081036123565750815160c08180518101031261036e576001926040516122908161044c565b61229c60208401612f4a565b81526122aa60408401612f4a565b90602081019182526122be60608501612f4a565b936040820194855260808101519160608101908382526123018c6114668c6122f460c060a08901519860808801998a5201612f4a565b9760a08601988952612e3f565b82526040519673ffffffffffffffffffffffffffffffffffffffff8096818094511660208b015251166040890152511660608701525160808601525160a0850152511660c083015260c08252611c39826104da565b7f9f05446300000000000000000000000000000000000000000000000000000000810361248b575081516101008180518101031261036e5760019261240c8761146687604051956123a687610468565b6123b260208201612f4a565b87526123c060408201612f4a565b60208801526123d160608201612f4a565b604088015260808101516060880152611d5a61010060a0830151928360808b015260c081015160a08b015260e081015160c08b015201610984565b608083015260e06040519273ffffffffffffffffffffffffffffffffffffffff808251166020860152806020830151166040860152604082015116606085015260608101516080850152608081015160a085015260a081015160c085015260c081015182850152015115156101008301526101008252611c3982610485565b7ff4de862e000000000000000000000000000000000000000000000000000000008103612537576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f496e7075745363616c696e6748656c7065723a2043616e206e6f74207363616c60448201527f65205246512073776170000000000000000000000000000000000000000000006064820152608490fd5b7f3b5490e100000000000000000000000000000000000000000000000000000000810361256e575081611c7684876001955161306f565b7f3a32adab00000000000000000000000000000000000000000000000000000000810361261a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f496e7075745363616c696e6748656c7065723a2043616e206e6f74207363616c60448201527f65205246512073776170000000000000000000000000000000000000000000006064820152608490fd5b7f78c3ad1f00000000000000000000000000000000000000000000000000000000810361272b5750815160a08180518101031261036e57604051928360a081011067ffffffffffffffff60a086011117610401578360a06001950160405261268460208401612f4a565b815261269260408401612f4a565b90602081019182526126a660608501612f4a565b93604082019485526080810151916126dc8b6114668b6126cf60a0606087019789895201612f4a565b9660808601978852612e3f565b82526040519573ffffffffffffffffffffffffffffffffffffffff8095818094511660208a01525116604088015251166060860152516080850152511660a083015260a08252611c398261044c565b7fefd9d5c3000000000000000000000000000000000000000000000000000000008103612762575081611c7684876001955161306f565b7fbfe1b858000000000000000000000000000000000000000000000000000000000361286b57815160c08180518101031261036e576001926040516127a68161044c565b6127b260208401612f4a565b81526127c060408401612f4a565b92602082019384526127d460608201612f4a565b93604083019485526127e860808301612f4a565b6060840190815260a0830151936128168c6114668c60c060808601988a8a5201519860a08601998a52612e3f565b84526040519673ffffffffffffffffffffffffffffffffffffffff8094818094511660208b01525116604089015251166060870152511660808501525160a08401525160c083015260c08252611c39826104da565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f4167677265676174696f6e4578656375746f723a204465782074797065206e6f60448201527f7420737570706f727465640000000000000000000000000000000000000000006064820152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b835167ffffffffffffffff811161036e5760208701605f82858c8c01010101121561036e57604081848b8b01010101518761295882610991565b926129666040519485610513565b828452602080850192018b8d0187018201600585901b016060011161036e578b60608c8389838282878601010101945b8860051b93010101010181106129b95750505090825250602093840193016115c4565b80519267ffffffffffffffff841161036e578c8e0188018301909301926040848d037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0011261036e5760405193612a0f85610430565b60608101519067ffffffffffffffff821161036e57612a3a6080928f60206060910191840101612f6b565b86520151937fffffffff000000000000000000000000000000000000000000000000000000008516850361036e57838f958f926020606095828e94838095015281520195019496612996565b8282612a959296939496612ece565b91815182019060208383031261036e5760208301519167ffffffffffffffff831161036e5760a083850182031261036e57604096875193612ad5856103e5565b6020818701015167ffffffffffffffff811161036e578187010160208401603f8201121561036e57602081015190612b0c82610991565b91612b198c519384610513565b8083528b602084019160051b8301019160208701831161036e578c01905b828210612e1f57505050855288818701015167ffffffffffffffff811161036e578187010160208401603f8201121561036e57602081015190612b7982610991565b91612b868c519384610513565b8083528b602084019160051b8301019160208701831161036e578c01905b828210612e0f575050506020860152606081870101519567ffffffffffffffff871161036e5760208401603f888484010101121561036e5760208783830101015196612bef88610991565b97612bfc8c51998a610513565b80895260208901602087018d8360051b858888010101011161036e578c838686010101905b8d8360051b858888010101018210612dd5575050505089860196875260808282010151936060870194855260a0838301015167ffffffffffffffff811161036e57612c7793602080939a999a0193010101612f6b565b926080860193845285515160005b818110612da2575050839291612ca191612cc49a969551612fad565b8252612cf960208551998a96828089015260a089519189015260e0880190610b9b565b960151957fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc09687878303016060880152610be5565b92519285858203016080860152835180825260208201916020808360051b8301019601926000915b838310612d4d575050505050936113b992916113e5955160a086015251908483030160c0850152610618565b919398975091939495602080612d8d837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe086600196030187528c51610618565b9a019301930190928b97989695949293612d21565b80612dbd846114668761146060019660208f9e9f0151612eba565b612dcb8260208b0151612eba565b5201969596612c85565b81519067ffffffffffffffff821161036e5760208f9291612e02829385848e01918a8d8d01010101612f6b565b8152019201919050612c21565b8151815260209182019101612ba4565b60208091612e2c84612f4a565b815201910190612b37565b509150509190565b81810292918115918404141715612e5257565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8115612e8b570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b80518210156128ef5760209160051b010190565b91612ed76110d0565b506101008301612eec83611466848451612e3f565b80825215612f40575b508060e08401526040830151519160005b838110612f14575050505090565b60019060608601612f3982612f328661146689611460858851612eba565b9251612eba565b5201612f06565b6001905238612ef5565b519073ffffffffffffffffffffffffffffffffffffffff8216820361036e57565b81601f8201121561036e578051612f8181610554565b92612f8f6040519485610513565b8184526020828401011161036e57610a8891602080850191016105f5565b9182516020908181116000146130105750604092838580518101031261036e57612ff69061146685805197612fe189610430565b85810151895201519484880195808752612e3f565b8252825193519084015251818301528152610a88816104a2565b818194929414613022575b5050505090565b928480929394829601031261036e576130419284611466920151612e3f565b906040519181830152815261305581610430565b3880808061301b565b519063ffffffff8216820361036e57565b91909161012091828280518101031261036e576040519361308f85610485565b61309b60208401612f4a565b85526130a960408401612f4a565b60208601908152906130bd60608501612f4a565b60408701908152956130d160808601612f4a565b6060820190815260a086015193608083019185835260c08801519360a0810194855260e089016131009061305e565b9560c08201968752610100978b898c016131199061305e565b9b60e085019c8d520161312b9061305e565b998984019a8b5261313b91612e3f565b9061314591612e81565b845260408051915173ffffffffffffffffffffffffffffffffffffffff908116602084015293518416908201529951821660608b0152511660808901525160a08801525160c08701525163ffffffff90811660e087015292518316908501525116818301528152610a88816104f6565b519060ff8216820361036e57565b519081600f0b820361036e5756fea26469706673582212207a3ffa10232ce561c2dd7b65568a52fbd88373b0829690d61f633d12cb7d2b0a64736f6c63430008110033

Deployed Bytecode

0x60406080815260049081361015610020575b5050361561001e57600080fd5b005b600091823560e01c632bdb823c146100385750610011565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc6060813601126103495781359073ffffffffffffffffffffffffffffffffffffffff82169283830361034557602491823560449182359567ffffffffffffffff8711610341576080878601928836030112610341576100cd906100c8878901916100c283610373565b906106b9565b610373565b95606481013580151581036103205784901561032457508135918583101561032057846100fb920190610394565b916001810361028a5750610110918391610cdd565b955b61028257925b865196610124886104a2565b602988527f416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c60208901527f7565206661696c656400000000000000000000000000000000000000000000008189015284471061020157853b156101a657886101a28982808b8b8b602083519301915af161019c6105c5565b9061065b565b5080f35b91601d7f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000009260206064969551957f08c379a0000000000000000000000000000000000000000000000000000000008752860152840152820152fd5b9160267f416464726573733a20696e73756666696369656e742062616c616e636520666f9260206084969551957f08c379a00000000000000000000000000000000000000000000000000000000087528601528401528201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152fd5b508692610118565b85858b8d60028b95146000146102f5575090600d60649460207f6e6f7420737570706f72746564000000000000000000000000000000000000009451957f08c379a0000000000000000000000000000000000000000000000000000000008752860152840152820152fd5b806001857f4e487b710000000000000000000000000000000000000000000000000000000088945252fd5b8a80fd5b9161033b92610334920190610394565b369161058e565b95610112565b8980fd5b8580fd5b8380fd5b359073ffffffffffffffffffffffffffffffffffffffff8216820361036e57565b600080fd5b3573ffffffffffffffffffffffffffffffffffffffff8116810361036e5790565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18136030182121561036e570180359067ffffffffffffffff821161036e5760200191813603831361036e57565b60a0810190811067ffffffffffffffff82111761040157604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040810190811067ffffffffffffffff82111761040157604052565b60c0810190811067ffffffffffffffff82111761040157604052565b610100810190811067ffffffffffffffff82111761040157604052565b610120810190811067ffffffffffffffff82111761040157604052565b6060810190811067ffffffffffffffff82111761040157604052565b6080810190811067ffffffffffffffff82111761040157604052565b60e0810190811067ffffffffffffffff82111761040157604052565b610140810190811067ffffffffffffffff82111761040157604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761040157604052565b67ffffffffffffffff811161040157601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b92919261059a82610554565b916105a86040519384610513565b82948184528183011161036e578281602093846000960137010152565b3d156105f0573d906105d682610554565b916105e46040519384610513565b82523d6000602084013e565b606090565b60005b8381106106085750506000910152565b81810151838201526020016105f8565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602093610654815180928187528780880191016105f5565b0116010190565b90919015610667575090565b8151156106775750805190602001fd5b6106b5906040519182917f08c379a0000000000000000000000000000000000000000000000000000000008352602060048401526024830190610618565b0390fd5b9073ffffffffffffffffffffffffffffffffffffffff9182811690811561097e576040918251809581957fdd62ed3e0000000000000000000000000000000000000000000000000000000083523060048401521691826024830152602096879160449788915afa801561097357600090610937575b6b7fffffffffffffffffffffff91501061074a575b5050505050565b8251906000808784017f095ea7b30000000000000000000000000000000000000000000000000000000094858252846024820152828982015288815261078f816104be565b519082875af161079d6105c5565b816108ff575b50156108a357916000929183809386519089820193845260248201527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff888201528781526107f0816104be565b51925af16107fc6105c5565b8161086b575b501561080f578080610743565b606492917f5361666520417070726f766500000000000000000000000000000000000000009151927f08c379a00000000000000000000000000000000000000000000000000000000084526004840152600c6024840152820152fd5b80915051848115918215610884575b5050905038610802565b838092935001031261036e578361089b9101610984565b80843861087a565b6064867f5361666520417070726f76650000000000000000000000000000000000000000878751927f08c379a00000000000000000000000000000000000000000000000000000000084526004840152600c6024840152820152fd5b80915051878115918215610918575b50509050386107a3565b838092935001031261036e578661092f9101610984565b80873861090e565b8682813d831161096c575b61094c8183610513565b8101031261096957506b7fffffffffffffffffffffff905161072e565b80fd5b503d610942565b84513d6000823e3d90fd5b50505050565b5190811515820361036e57565b67ffffffffffffffff81116104015760051b60200190565b81601f8201121561036e578035916109c083610991565b926109ce6040519485610513565b808452602092838086019260051b82010192831161036e578301905b8282106109f8575050505090565b838091610a048461034d565b8152019101906109ea565b81601f8201121561036e57803591610a2683610991565b92610a346040519485610513565b808452602092838086019260051b82010192831161036e578301905b828210610a5e575050505090565b81358152908301908301610a50565b9080601f8301121561036e57816020610a889335910161058e565b90565b91909161016090818185031261036e576040519182019067ffffffffffffffff9183811083821117610401576040528294610ac58261034d565b8452610ad36020830161034d565b6020850152604082013583811161036e5781610af09184016109a9565b6040850152606082013583811161036e5781610b0d918401610a0f565b6060850152608082013583811161036e5781610b2a9184016109a9565b608085015260a082013583811161036e5781610b47918401610a0f565b60a0850152610b5860c0830161034d565b60c085015260e082013560e085015261010080830135908501526101208083013590850152610140928383013590811161036e57610b969201610a6d565b910152565b90815180825260208080930193019160005b828110610bbb575050505090565b835173ffffffffffffffffffffffffffffffffffffffff1685529381019392810192600101610bad565b90815180825260208080930193019160005b828110610c05575050505090565b835185529381019392810192600101610bf7565b90610a889173ffffffffffffffffffffffffffffffffffffffff91828251168152826020830151166020820152610c9e610c8c610c7a610c686040860151610160806040880152860190610b9b565b60608601518582036060870152610be5565b60808501518482036080860152610b9b565b60a084015183820360a0850152610be5565b9260c08301511660c082015260e082015160e0820152610100808301519082015261012080830151908201526101408092015191818403910152610618565b909160049280841161036e5782357fffffffff000000000000000000000000000000000000000000000000000000001691848401917fe21fd0e9000000000000000000000000000000000000000000000000000000008403610f005784017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc92602084878403011261036e57359467ffffffffffffffff9586811161036e5760a0910193848303011261036e5760405190610d97826103e5565b610da287850161034d565b8252610db06024850161034d565b9660208301978852604485013587811161036e578282610dd292880101610a6d565b60408401908152606486013588811161036e578383610df392890101610a8b565b9360608101948552608487013598891161036e57610e42610e24610ec395610e8f95610a889c610ed49b0101610a6d565b966080830197885286519084516020610120840151161515926114db565b83528552604051998a9860208a0152602060248a015273ffffffffffffffffffffffffffffffffffffffff8092511660448a0152511660648801525160a0608488015260e4870190610618565b9151917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbc92838783030160a4880152610c19565b9151908483030160c4850152610618565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282610513565b909391907f8af033fb00000000000000000000000000000000000000000000000000000000840361104d5782019060807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc848403011261036e57359473ffffffffffffffffffffffffffffffffffffffff861680960361036e5767ffffffffffffffff90602484013582811161036e578382610f9e92870101610a8b565b91604485013581811161036e578483610fb992880101610a6d565b96606486013591821161036e57610a8897610fe461100d9661103e95610fea95610ed49a0101610a6d565b94611136565b9390604051988997602089015260248801526080604488015260a4870190610c19565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc9384878303016064880152610618565b91848303016084850152610618565b6084866020604051917f08c379a00000000000000000000000000000000000000000000000000000000083528201526024808201527f496e7075745363616c696e6748656c7065723a20496e76616c69642073656c6560448201527f63746f72000000000000000000000000000000000000000000000000000000006064820152fd5b60405190610160820182811067ffffffffffffffff821117610401576040528161014060009182815282602082015260609283604083015283808301528360808301528360a08301528060c08301528060e0830152806101008301526101208201520152565b9192906111416110d0565b5060e0830151928484146114d557848461115a92612ece565b908051810193602094858101868483031261036e57868401519367ffffffffffffffff9485811161036e5760a091018093031261036e576040805161119e816103e5565b8884015186811161036e57840183603f8201121561036e5789810151906111c482610991565b916111d185519384610513565b808352848c84019160051b8301019186831161036e57858d9101915b8383106114bd575050505081528184015186811161036e5784019583603f8801121561036e57898701519661122188610991565b9761122e8551998a610513565b808952848c8a019160051b8301019186831161036e57858d9101915b8383106114ad575084019889525050606085015181811161036e5785019380603f8601121561036e578a8501519461128186610991565b9561128e86519788610513565b808752858d88019160051b8301019183831161036e57868101915b83831061148857505050508383019485526080860151956060840196875260a081015192831161036e579a6112ea92819a9b9c999897969594990101612f6b565b936080870194855286515160005b81811061143f5750506113659161131660a09c611331938851612fad565b865280519b8c988a808b0152519189015260e0880190610b9b565b9451947fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc09586888303016060890152610be5565b905195848683030160808701528651908183528083019281808460051b8301019901936000915b8483106113e957505050505050916113e594916113b9935160a086015251908483030160c0850152610618565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101855284610513565b9190565b919395969798509193988480611429837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe086600196030187528d51610618565b9b019301930190928c989796959394929461138c565b8061146b848f9c9e9d9c611466906114606001968e9f9a9b9c9d9e51612eba565b51612e3f565b612e81565b611476828c51612eba565b52019a98999a979695949392976112f8565b825186811161036e578f916114a2878b8594870101612f6b565b8152019201916112a9565b82518152918101918d910161124a565b81906114c884612f4a565b8152019101908c906111ed565b93509150565b939290936114e76110d0565b5060e081015191838314612e3757612a8657828261150492612ece565b91845185019460208187031261036e5760208101519067ffffffffffffffff821161036e5760e082820188031261036e576040519660e0880188811067ffffffffffffffff821117610401576040526020838301015167ffffffffffffffff811161036e5760208201603f828686010101121561036e576020818585010101519061158e82610991565b9161159c6040519384610513565b80835260208301916020850160408360051b838a8a010101011161036e576040818888010101925b60408360051b838a8a01010101841061291e575050505088526115eb604084840101612f4a565b60208901526115fe606084840101612f4a565b6040890152818301608081015160608a015261161c9060a001612f4a565b608089015281830160c081015160a08a015260e0015167ffffffffffffffff811161036e5761165393602080930193010101612f6b565b60c086015261166a82611466836060890151612e3f565b606086015261167e818360c0880151612fad565b60c08601528451519060005b8281106118495750505050604051926020808501528381519160e0604083015261012082018351809152610140906020828501928260051b8601019501916000905b82821061175e57505050506113e59260c06113b99273ffffffffffffffffffffffffffffffffffffffff806020830151166060870152806040830151166080870152606082015160a08701526080820151168286015260a081015160e086015201517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc084830301610100850152610618565b9193947ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec0908792949703018252855190815180825260208201906020808260051b85010194019260005b8281106117ca57505050505060208060019297019201920188949391926116cc565b9091929394602080827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08660019503018852885190827fffffffff00000000000000000000000000000000000000000000000000000000816118358551604086526040860190610618565b9401511691015297019501939291016117a8565b611854818851612eba565b518051156128ef5760200151907fffffffff000000000000000000000000000000000000000000000000000000006020830151167fd07961740000000000000000000000000000000000000000000000000000000081146000146118cb5750816118c284876001955161306f565b90525b0161168a565b7f234c8880000000000000000000000000000000000000000000000000000000008103611ac5575081516101408180518101031261036e57604051908161014081011067ffffffffffffffff610140840111176104015786611466866119d093610140860160405261193f60208201612f4a565b865261194d60408201612f4a565b602087015261195e60608201612f4a565b604087015261196f608082016131b5565b606087015261198060a082016131b5565b60808701526119c561014060c0830151928360a08a015260e081015160c08a015261010081015160e08a01526119b96101208201612f4a565b6101008a015201610984565b610120870152612e3f565b60a08201526101206040519173ffffffffffffffffffffffffffffffffffffffff815116602084015273ffffffffffffffffffffffffffffffffffffffff602082015116604084015273ffffffffffffffffffffffffffffffffffffffff604082015116606084015260ff80606083015116608085015260808201511660a084015260a081015160c084015260c081015160e084015260e081015161010084015273ffffffffffffffffffffffffffffffffffffffff610100820151168284015201511515610140820152610140815261016081019281841067ffffffffffffffff85111761040157600193604052526118c5565b7fcbf622d3000000000000000000000000000000000000000000000000000000008103611c3f575081516101208180518101031261036e57600192611ba6876114668760405195611b1587610485565b611b2160208201612f4a565b8752611b2f60408201612f4a565b6020880152611b4060608201612f4a565b6040880152611b51608082016131c3565b6060880152611b6260a082016131c3565b6080880152611b9b61012060c0830151928360a08b015260e081015160c08b0152611b906101008201610984565b60e08b015201610984565b610100880152612e3f565b60a08301526101006040519273ffffffffffffffffffffffffffffffffffffffff80825116602086015280602083015116604086015260408201511660608501526060810151600f90810b60808601526080820151900b60a085015260a081015160c085015260c081015160e085015260e0810151151582850152015115156101208301526101208252611c39826104f6565b526118c5565b7f4944c815000000000000000000000000000000000000000000000000000000008103611c7d575081611c7684876001955161306f565b90526118c5565b7f9e8aa935000000000000000000000000000000000000000000000000000000008103611e3757508151916101008380518101031261036e5760405190611cc382610468565b611ccf60208501612f4a565b8252611cdd60408501612f4a565b6020830152611cee60608501612f4a565b6040830152611cff60808501612f4a565b606083015260a084015180608084015260c085015160a084015260e08501519073ffffffffffffffffffffffffffffffffffffffff8216820361036e57611466878a92611d5a61010060019a611d649760c08b015201610984565b60e0880152612e3f565b608083015260e06040519273ffffffffffffffffffffffffffffffffffffffff815116602085015273ffffffffffffffffffffffffffffffffffffffff602082015116604085015273ffffffffffffffffffffffffffffffffffffffff604082015116606085015273ffffffffffffffffffffffffffffffffffffffff6060820151166080850152608081015160a085015260a081015160c085015273ffffffffffffffffffffffffffffffffffffffff60c08201511682850152015115156101008301526101008252611c3982610485565b7fee76c642000000000000000000000000000000000000000000000000000000008103611ee3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f496e7075745363616c696e6748656c7065723a2043616e206e6f74207363616c60448201527f65205246512073776170000000000000000000000000000000000000000000006064820152608490fd5b7fa5d0728f000000000000000000000000000000000000000000000000000000008103611fe55750815160c08180518101031261036e57600192604051611f298161044c565b611f3560208401612f4a565b815260408301519260208201938452611f5060608201612f4a565b9360408301948552611f6460808301612f4a565b6060840190815260a083015193611f928c6114668c60c060808601988a8a5201519860a08601998a52612e3f565b84526040519673ffffffffffffffffffffffffffffffffffffffff93848093511660208a015251604089015251166060870152511660808501525160a08401525160c083015260c08252611c39826104da565b7f583e56d70000000000000000000000000000000000000000000000000000000081036120b8575081519160608380518101031261036e5760405190606082019382851067ffffffffffffffff8611176104015760019460405261204b60208201612f4a565b835260408101519061207b896114668961206e606060208a019688885201610984565b9560408901968752612e3f565b815273ffffffffffffffffffffffffffffffffffffffff6040519451166020850152516040840152511515606083015260608252611c39826104be565b7f8a5da90f000000000000000000000000000000000000000000000000000000008103612213575081516101208180518101031261036e5760019261218387611466876040519561210887610485565b61211460208201612f4a565b875261212260408201612f4a565b602088015261213360608201612f4a565b604088015261214460808201612f4a565b6060880152611b9b61012060a0830151928360808b015260c081015160a08b015261217160e08201612f4a565b60c08b0152611b906101008201610984565b60808301526101006040519273ffffffffffffffffffffffffffffffffffffffff808251166020860152806020830151166040860152806040830151166060860152806060830151166080860152608082015160a086015260a082015160c086015260c08201511660e085015260e0810151151582850152015115156101208301526101208252611c39826104f6565b7fa067e24b00000000000000000000000000000000000000000000000000000000810361224a575081611c7684876001955161306f565b7fad2261ff0000000000000000000000000000000000000000000000000000000081036123565750815160c08180518101031261036e576001926040516122908161044c565b61229c60208401612f4a565b81526122aa60408401612f4a565b90602081019182526122be60608501612f4a565b936040820194855260808101519160608101908382526123018c6114668c6122f460c060a08901519860808801998a5201612f4a565b9760a08601988952612e3f565b82526040519673ffffffffffffffffffffffffffffffffffffffff8096818094511660208b015251166040890152511660608701525160808601525160a0850152511660c083015260c08252611c39826104da565b7f9f05446300000000000000000000000000000000000000000000000000000000810361248b575081516101008180518101031261036e5760019261240c8761146687604051956123a687610468565b6123b260208201612f4a565b87526123c060408201612f4a565b60208801526123d160608201612f4a565b604088015260808101516060880152611d5a61010060a0830151928360808b015260c081015160a08b015260e081015160c08b015201610984565b608083015260e06040519273ffffffffffffffffffffffffffffffffffffffff808251166020860152806020830151166040860152604082015116606085015260608101516080850152608081015160a085015260a081015160c085015260c081015182850152015115156101008301526101008252611c3982610485565b7ff4de862e000000000000000000000000000000000000000000000000000000008103612537576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f496e7075745363616c696e6748656c7065723a2043616e206e6f74207363616c60448201527f65205246512073776170000000000000000000000000000000000000000000006064820152608490fd5b7f3b5490e100000000000000000000000000000000000000000000000000000000810361256e575081611c7684876001955161306f565b7f3a32adab00000000000000000000000000000000000000000000000000000000810361261a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f496e7075745363616c696e6748656c7065723a2043616e206e6f74207363616c60448201527f65205246512073776170000000000000000000000000000000000000000000006064820152608490fd5b7f78c3ad1f00000000000000000000000000000000000000000000000000000000810361272b5750815160a08180518101031261036e57604051928360a081011067ffffffffffffffff60a086011117610401578360a06001950160405261268460208401612f4a565b815261269260408401612f4a565b90602081019182526126a660608501612f4a565b93604082019485526080810151916126dc8b6114668b6126cf60a0606087019789895201612f4a565b9660808601978852612e3f565b82526040519573ffffffffffffffffffffffffffffffffffffffff8095818094511660208a01525116604088015251166060860152516080850152511660a083015260a08252611c398261044c565b7fefd9d5c3000000000000000000000000000000000000000000000000000000008103612762575081611c7684876001955161306f565b7fbfe1b858000000000000000000000000000000000000000000000000000000000361286b57815160c08180518101031261036e576001926040516127a68161044c565b6127b260208401612f4a565b81526127c060408401612f4a565b92602082019384526127d460608201612f4a565b93604083019485526127e860808301612f4a565b6060840190815260a0830151936128168c6114668c60c060808601988a8a5201519860a08601998a52612e3f565b84526040519673ffffffffffffffffffffffffffffffffffffffff8094818094511660208b01525116604089015251166060870152511660808501525160a08401525160c083015260c08252611c39826104da565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f4167677265676174696f6e4578656375746f723a204465782074797065206e6f60448201527f7420737570706f727465640000000000000000000000000000000000000000006064820152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b835167ffffffffffffffff811161036e5760208701605f82858c8c01010101121561036e57604081848b8b01010101518761295882610991565b926129666040519485610513565b828452602080850192018b8d0187018201600585901b016060011161036e578b60608c8389838282878601010101945b8860051b93010101010181106129b95750505090825250602093840193016115c4565b80519267ffffffffffffffff841161036e578c8e0188018301909301926040848d037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0011261036e5760405193612a0f85610430565b60608101519067ffffffffffffffff821161036e57612a3a6080928f60206060910191840101612f6b565b86520151937fffffffff000000000000000000000000000000000000000000000000000000008516850361036e57838f958f926020606095828e94838095015281520195019496612996565b8282612a959296939496612ece565b91815182019060208383031261036e5760208301519167ffffffffffffffff831161036e5760a083850182031261036e57604096875193612ad5856103e5565b6020818701015167ffffffffffffffff811161036e578187010160208401603f8201121561036e57602081015190612b0c82610991565b91612b198c519384610513565b8083528b602084019160051b8301019160208701831161036e578c01905b828210612e1f57505050855288818701015167ffffffffffffffff811161036e578187010160208401603f8201121561036e57602081015190612b7982610991565b91612b868c519384610513565b8083528b602084019160051b8301019160208701831161036e578c01905b828210612e0f575050506020860152606081870101519567ffffffffffffffff871161036e5760208401603f888484010101121561036e5760208783830101015196612bef88610991565b97612bfc8c51998a610513565b80895260208901602087018d8360051b858888010101011161036e578c838686010101905b8d8360051b858888010101018210612dd5575050505089860196875260808282010151936060870194855260a0838301015167ffffffffffffffff811161036e57612c7793602080939a999a0193010101612f6b565b926080860193845285515160005b818110612da2575050839291612ca191612cc49a969551612fad565b8252612cf960208551998a96828089015260a089519189015260e0880190610b9b565b960151957fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc09687878303016060880152610be5565b92519285858203016080860152835180825260208201916020808360051b8301019601926000915b838310612d4d575050505050936113b992916113e5955160a086015251908483030160c0850152610618565b919398975091939495602080612d8d837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe086600196030187528c51610618565b9a019301930190928b97989695949293612d21565b80612dbd846114668761146060019660208f9e9f0151612eba565b612dcb8260208b0151612eba565b5201969596612c85565b81519067ffffffffffffffff821161036e5760208f9291612e02829385848e01918a8d8d01010101612f6b565b8152019201919050612c21565b8151815260209182019101612ba4565b60208091612e2c84612f4a565b815201910190612b37565b509150509190565b81810292918115918404141715612e5257565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8115612e8b570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b80518210156128ef5760209160051b010190565b91612ed76110d0565b506101008301612eec83611466848451612e3f565b80825215612f40575b508060e08401526040830151519160005b838110612f14575050505090565b60019060608601612f3982612f328661146689611460858851612eba565b9251612eba565b5201612f06565b6001905238612ef5565b519073ffffffffffffffffffffffffffffffffffffffff8216820361036e57565b81601f8201121561036e578051612f8181610554565b92612f8f6040519485610513565b8184526020828401011161036e57610a8891602080850191016105f5565b9182516020908181116000146130105750604092838580518101031261036e57612ff69061146685805197612fe189610430565b85810151895201519484880195808752612e3f565b8252825193519084015251818301528152610a88816104a2565b818194929414613022575b5050505090565b928480929394829601031261036e576130419284611466920151612e3f565b906040519181830152815261305581610430565b3880808061301b565b519063ffffffff8216820361036e57565b91909161012091828280518101031261036e576040519361308f85610485565b61309b60208401612f4a565b85526130a960408401612f4a565b60208601908152906130bd60608501612f4a565b60408701908152956130d160808601612f4a565b6060820190815260a086015193608083019185835260c08801519360a0810194855260e089016131009061305e565b9560c08201968752610100978b898c016131199061305e565b9b60e085019c8d520161312b9061305e565b998984019a8b5261313b91612e3f565b9061314591612e81565b845260408051915173ffffffffffffffffffffffffffffffffffffffff908116602084015293518416908201529951821660608b0152511660808901525160a08801525160c08701525163ffffffff90811660e087015292518316908501525116818301528152610a88816104f6565b519060ff8216820361036e57565b519081600f0b820361036e5756fea26469706673582212207a3ffa10232ce561c2dd7b65568a52fbd88373b0829690d61f633d12cb7d2b0a64736f6c63430008110033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.