ETH Price: $3,488.45 (+2.78%)
Gas: 3 Gwei

Contract

0x2F55e27E669F070dEf7B5771dB72f6B31A6d4df8
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Flash Withdraw E...203397142024-07-19 9:35:1122 hrs ago1721381711IN
0x2F55e27E...31A6d4df8
0 ETH0.003290546.28668716
Flash Withdraw E...203396922024-07-19 9:30:4722 hrs ago1721381447IN
0x2F55e27E...31A6d4df8
0 ETH0.003531926.3819815
Flash Withdraw E...203389922024-07-19 7:10:1124 hrs ago1721373011IN
0x2F55e27E...31A6d4df8
0 ETH0.003847816.76634832
Flash Withdraw E...203221552024-07-16 22:46:593 days ago1721170019IN
0x2F55e27E...31A6d4df8
0 ETH0.003134935.48777151
Flash Withdraw E...203099292024-07-15 5:49:475 days ago1721022587IN
0x2F55e27E...31A6d4df8
0 ETH0.001571983.13906882
Flash Withdraw E...203099172024-07-15 5:47:235 days ago1721022443IN
0x2F55e27E...31A6d4df8
0 ETH0.001622353.10325839
Flash Withdraw E...203099062024-07-15 5:45:115 days ago1721022311IN
0x2F55e27E...31A6d4df8
0 ETH0.001658682.95899398
Flash Withdraw E...203018482024-07-14 2:46:116 days ago1720925171IN
0x2F55e27E...31A6d4df8
0 ETH0.001532352.7501793
Flash Withdraw E...202998322024-07-13 20:00:476 days ago1720900847IN
0x2F55e27E...31A6d4df8
0 ETH0.001336212.37348356
Flash Withdraw E...202978562024-07-13 13:22:476 days ago1720876967IN
0x2F55e27E...31A6d4df8
0 ETH0.001361762.44569152
Flash Withdraw E...202874562024-07-12 2:31:118 days ago1720751471IN
0x2F55e27E...31A6d4df8
0 ETH0.001873692.68100264
Flash Withdraw E...202754082024-07-10 10:09:599 days ago1720606199IN
0x2F55e27E...31A6d4df8
0 ETH0.002362294.35285702
Flash Withdraw E...202705412024-07-09 17:51:2310 days ago1720547483IN
0x2F55e27E...31A6d4df8
0 ETH0.002518814.17576193
Flash Withdraw E...202678622024-07-09 8:51:3510 days ago1720515095IN
0x2F55e27E...31A6d4df8
0 ETH0.000436024.17826941
Flash Withdraw E...202585992024-07-08 1:45:4712 days ago1720403147IN
0x2F55e27E...31A6d4df8
0 ETH0.002053773.45815826
Flash Withdraw E...202572902024-07-07 21:22:4712 days ago1720387367IN
0x2F55e27E...31A6d4df8
0 ETH0.00111962
Flash Withdraw E...202569932024-07-07 20:22:5912 days ago1720383779IN
0x2F55e27E...31A6d4df8
0 ETH0.000884271.61900001
Flash Withdraw E...202567262024-07-07 19:29:1112 days ago1720380551IN
0x2F55e27E...31A6d4df8
0 ETH0.000777511.32086779
Flash Withdraw E...202474772024-07-06 12:30:5913 days ago1720269059IN
0x2F55e27E...31A6d4df8
0 ETH0.00135982.40754399
Flash Withdraw E...202468592024-07-06 10:25:5913 days ago1720261559IN
0x2F55e27E...31A6d4df8
0 ETH0.00174693.1159858
Flash Withdraw E...202466172024-07-06 9:37:2313 days ago1720258643IN
0x2F55e27E...31A6d4df8
0 ETH0.001939913.40115941
Flash Withdraw E...202460712024-07-06 7:46:5914 days ago1720252019IN
0x2F55e27E...31A6d4df8
0 ETH0.001736643.17664064
Flash Withdraw E...202371122024-07-05 1:46:2315 days ago1720143983IN
0x2F55e27E...31A6d4df8
0 ETH0.005336929.03416495
Flash Withdraw E...202370162024-07-05 1:27:1115 days ago1720142831IN
0x2F55e27E...31A6d4df8
0 ETH0.004930377.74557975
Flash Withdraw E...202195482024-07-02 14:52:4717 days ago1719931967IN
0x2F55e27E...31A6d4df8
0 ETH0.004627028.17363289
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
203397142024-07-19 9:35:1122 hrs ago1721381711
0x2F55e27E...31A6d4df8
0.15226428 ETH
203397142024-07-19 9:35:1122 hrs ago1721381711
0x2F55e27E...31A6d4df8
0.15226428 ETH
203396922024-07-19 9:30:4722 hrs ago1721381447
0x2F55e27E...31A6d4df8
0.07601693 ETH
203396922024-07-19 9:30:4722 hrs ago1721381447
0x2F55e27E...31A6d4df8
0.07601693 ETH
203389922024-07-19 7:10:1124 hrs ago1721373011
0x2F55e27E...31A6d4df8
0.07111502 ETH
203389922024-07-19 7:10:1124 hrs ago1721373011
0x2F55e27E...31A6d4df8
0.07111502 ETH
203221552024-07-16 22:46:593 days ago1721170019
0x2F55e27E...31A6d4df8
0.1046229 ETH
203221552024-07-16 22:46:593 days ago1721170019
0x2F55e27E...31A6d4df8
0.1046229 ETH
203099292024-07-15 5:49:475 days ago1721022587
0x2F55e27E...31A6d4df8
0.07801002 ETH
203099292024-07-15 5:49:475 days ago1721022587
0x2F55e27E...31A6d4df8
0.07801002 ETH
203099172024-07-15 5:47:235 days ago1721022443
0x2F55e27E...31A6d4df8
0.15658467 ETH
203099172024-07-15 5:47:235 days ago1721022443
0x2F55e27E...31A6d4df8
0.15658467 ETH
203099062024-07-15 5:45:115 days ago1721022311
0x2F55e27E...31A6d4df8
0.14537487 ETH
203099062024-07-15 5:45:115 days ago1721022311
0x2F55e27E...31A6d4df8
0.14537487 ETH
203018482024-07-14 2:46:116 days ago1720925171
0x2F55e27E...31A6d4df8
0.08497997 ETH
203018482024-07-14 2:46:116 days ago1720925171
0x2F55e27E...31A6d4df8
0.08497997 ETH
202998322024-07-13 20:00:476 days ago1720900847
0x2F55e27E...31A6d4df8
0.01583446 ETH
202998322024-07-13 20:00:476 days ago1720900847
0x2F55e27E...31A6d4df8
0.01583446 ETH
202978562024-07-13 13:22:476 days ago1720876967
0x2F55e27E...31A6d4df8
0.09723328 ETH
202978562024-07-13 13:22:476 days ago1720876967
0x2F55e27E...31A6d4df8
0.09723328 ETH
202874562024-07-12 2:31:118 days ago1720751471
0x2F55e27E...31A6d4df8
0.00797542 ETH
202874562024-07-12 2:31:118 days ago1720751471
0x2F55e27E...31A6d4df8
0.00797542 ETH
202754082024-07-10 10:09:599 days ago1720606199
0x2F55e27E...31A6d4df8
0.00863998 ETH
202754082024-07-10 10:09:599 days ago1720606199
0x2F55e27E...31A6d4df8
0.00863998 ETH
202705412024-07-09 17:51:2310 days ago1720547483
0x2F55e27E...31A6d4df8
0.05254451 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CrabHelper

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion
File 1 of 9 : CrabHelper.sol
//SPDX-License-Identifier: BUSL-1.1

pragma solidity =0.7.6;

import {ICrabStrategyV2} from "../interfaces/ICrabStrategyV2.sol";
import {IWETH9} from "../interfaces/IWETH9.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";

import {StrategySwap} from "./helper/StrategySwap.sol";

/**
 * @dev CrabHelper contract
 * @notice Contract for Crab helper functions
 * @author Opyn team
 */
contract CrabHelper is StrategySwap, ReentrancyGuard {
    using Address for address payable;

    address public immutable crab;
    address public immutable weth;

    event FlashDepositERC20(
        address indexed depositor,
        address depositedERC20,
        uint256 depositedAmount,
        uint256 depositedEthAmount,
        uint256 crabAmount,
        uint256 returnedEth
    );

    event FlashWithdrawERC20(
        address indexed withdrawer,
        address withdrawnERC20,
        uint256 withdrawnAmount,
        uint256 withdrawnEthAmount,
        uint256 crabAmount
    );

    /**
     * @notice constructor
     * @param _crab address of crabV2 contract
     * @param _swapRouter address of Uniswap swap router
     */
    constructor(address _crab, address _swapRouter) StrategySwap(_swapRouter) {
        require(_crab != address(0), "Invalid crab address");

        crab = _crab;
        weth = ICrabStrategyV2(_crab).weth();
    }

    /**
     * @notice allows user to flash deposit into crab from an aribtrary ERC20
     * @param _ethToDeposit amount of ETH to deposit
     * @param _amountIn amount of ERC20 token to swap for weth
     * @param _minEthToGet min amount of ETH to receive in the swap
     * @param _erc20Fee pool fee for transfer ERC20/eth pool (3000 = 30bps)
     * @param _wPowerPerpFee pool fee for wPowerPerp/eth pool (3000 = 30bps)
     * @param _tokenIn ERC20 token to pay
     */
    function flashDepositERC20(
        uint256 _ethToDeposit,
        uint256 _amountIn,
        uint256 _minEthToGet,
        uint24 _erc20Fee,
        uint24 _wPowerPerpFee,
        address _tokenIn
    ) external nonReentrant {
        _swapExactInputSingle(_tokenIn, weth, msg.sender, address(this), _amountIn, _minEthToGet, _erc20Fee);

        IWETH9(weth).withdraw(IWETH9(weth).balanceOf(address(this)));
        ICrabStrategyV2(crab).flashDeposit{value: address(this).balance}(_ethToDeposit, _wPowerPerpFee);

        uint256 crabAmount = IERC20(crab).balanceOf(address(this));

        emit FlashDepositERC20(msg.sender, _tokenIn, _amountIn, _ethToDeposit, crabAmount, address(this).balance);

        IERC20(crab).transfer(msg.sender, crabAmount);

        if (address(this).balance > 0) {
            payable(msg.sender).sendValue(address(this).balance);
        }
    }

    /**
     * @notice allows user to flash withdraw from crab to an aribtrary ERC20
     * @param _crabAmount amount of crab shares to withdraw
     * @param _maxEthToPay max eth to pay in swap for wPowerPerp
     * @param _tokenOut ERC20 token to receive
     * @param _minAmountOut min amount of ERC20 to receive
     * @param _erc20Fee pool fee for transfer ERC20/eth pool (3000 = 30bps)
     * @param _wPowerPerpFee pool fee for wPowerPerp/eth pool (3000 = 30bps)
     */
    function flashWithdrawERC20(
        uint256 _crabAmount,
        uint256 _maxEthToPay,
        address _tokenOut,
        uint256 _minAmountOut,
        uint24 _erc20Fee,
        uint24 _wPowerPerpFee
    ) external nonReentrant {
        IERC20(crab).transferFrom(msg.sender, address(this), _crabAmount);

        ICrabStrategyV2(crab).flashWithdraw(_crabAmount, _maxEthToPay, _wPowerPerpFee);

        uint256 ethBalance = address(this).balance;
        IWETH9(weth).deposit{value: ethBalance}();
        uint256 tokenReceived = _swapExactInputSingle(
            weth,
            _tokenOut,
            address(this),
            msg.sender,
            ethBalance,
            _minAmountOut,
            _erc20Fee
        );

        emit FlashWithdrawERC20(msg.sender, _tokenOut, tokenReceived, ethBalance, _crabAmount);
    }

    /**
     * @notice receive function to allow ETH transfer to this contract
     */
    receive() external payable {
        require(msg.sender == weth || msg.sender == crab, "Cannot receive eth");
    }
}

File 2 of 9 : ICrabStrategyV2.sol
// SPDX-License-Identifier: MIT

pragma solidity =0.7.6;

pragma abicoder v2;

interface ICrabStrategyV2 {
    function wPowerPerp() external view returns (address);

    function weth() external view returns (address);

    function flashDeposit(uint256 _ethToDeposit, uint24 _poolFee) external payable;

    function flashWithdraw(
        uint256 _crabAmount,
        uint256 _maxEthToPay,
        uint24 _poolFee
    ) external;
}

File 3 of 9 : IWETH9.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.7.6;

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

interface IWETH9 is IERC20 {
    function deposit() external payable;

    function withdraw(uint256 wad) external;
}

File 4 of 9 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @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);
}

File 5 of 9 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor () {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 6 of 9 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 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");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 7 of 9 : StrategySwap.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.7.6;
pragma abicoder v2;

import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

contract StrategySwap {
    ISwapRouter public immutable swapRouter;

    constructor(address _swapRouter) {
        require(_swapRouter != address(0), "invalid swap router address");
        swapRouter = ISwapRouter(_swapRouter);
    }

    /**
     * @notice swapExactInputSingle swaps a given amount of tokenIn for a maximum possible amount of tokenOut
     * @dev The calling address must approve this contract to spend at least `amountIn` worth of its tokenIn for this function to succeed.
     * @param _tokenIn token address to sell
     * @param _tokenOut token address to receive
     * @param _from from which user we are selling
     * @param _to Recipient to get the tokens
     * @param _amountIn Exact amount to sell
     * @param _minAmountOut Minimum amount to be paid
     * @param _fee pool fee
     * @return amountOut The amount of WETH9 received.
     */
    function _swapExactInputSingle(
        address _tokenIn,
        address _tokenOut,
        address _from,
        address _to,
        uint256 _amountIn,
        uint256 _minAmountOut,
        uint24 _fee
    ) internal returns (uint256 amountOut) {
        // _from must approve this contract

        // Transfer the specified amount of tokenIn to this contract.
        IERC20(_tokenIn).transferFrom(_from, address(this), _amountIn);

        // Approve the router to spend tokenIn.
        IERC20(_tokenIn).approve(address(swapRouter), _amountIn);

        // We also set the sqrtPriceLimitx96 to be 0 to ensure we swap our exact input amount.
        ISwapRouter.ExactInputSingleParams memory params = ISwapRouter.ExactInputSingleParams({
            tokenIn: _tokenIn,
            tokenOut: _tokenOut,
            fee: _fee,
            recipient: _to,
            deadline: block.timestamp,
            amountIn: _amountIn,
            amountOutMinimum: _minAmountOut,
            sqrtPriceLimitX96: 0
        });

        // The call to `exactInputSingle` executes the swap.
        amountOut = swapRouter.exactInputSingle(params);
    }
}

File 8 of 9 : ISwapRouter.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;

import '@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol';

/// @title Router token swapping functionality
/// @notice Functions for swapping tokens via Uniswap V3
interface ISwapRouter is IUniswapV3SwapCallback {
    struct ExactInputSingleParams {
        address tokenIn;
        address tokenOut;
        uint24 fee;
        address recipient;
        uint256 deadline;
        uint256 amountIn;
        uint256 amountOutMinimum;
        uint160 sqrtPriceLimitX96;
    }

    /// @notice Swaps `amountIn` of one token for as much as possible of another token
    /// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
    /// @return amountOut The amount of the received token
    function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut);

    struct ExactInputParams {
        bytes path;
        address recipient;
        uint256 deadline;
        uint256 amountIn;
        uint256 amountOutMinimum;
    }

    /// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
    /// @return amountOut The amount of the received token
    function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut);

    struct ExactOutputSingleParams {
        address tokenIn;
        address tokenOut;
        uint24 fee;
        address recipient;
        uint256 deadline;
        uint256 amountOut;
        uint256 amountInMaximum;
        uint160 sqrtPriceLimitX96;
    }

    /// @notice Swaps as little as possible of one token for `amountOut` of another token
    /// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata
    /// @return amountIn The amount of the input token
    function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn);

    struct ExactOutputParams {
        bytes path;
        address recipient;
        uint256 deadline;
        uint256 amountOut;
        uint256 amountInMaximum;
    }

    /// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)
    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata
    /// @return amountIn The amount of the input token
    function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn);
}

File 9 of 9 : IUniswapV3SwapCallback.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Callback for IUniswapV3PoolActions#swap
/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface
interface IUniswapV3SwapCallback {
    /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.
    /// @dev In the implementation you must pay the pool tokens owed for the swap.
    /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.
    /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.
    /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.
    /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.
    /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call
    function uniswapV3SwapCallback(
        int256 amount0Delta,
        int256 amount1Delta,
        bytes calldata data
    ) external;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_crab","type":"address"},{"internalType":"address","name":"_swapRouter","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":false,"internalType":"address","name":"depositedERC20","type":"address"},{"indexed":false,"internalType":"uint256","name":"depositedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"depositedEthAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"crabAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"returnedEth","type":"uint256"}],"name":"FlashDepositERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":false,"internalType":"address","name":"withdrawnERC20","type":"address"},{"indexed":false,"internalType":"uint256","name":"withdrawnAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawnEthAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"crabAmount","type":"uint256"}],"name":"FlashWithdrawERC20","type":"event"},{"inputs":[],"name":"crab","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ethToDeposit","type":"uint256"},{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"uint256","name":"_minEthToGet","type":"uint256"},{"internalType":"uint24","name":"_erc20Fee","type":"uint24"},{"internalType":"uint24","name":"_wPowerPerpFee","type":"uint24"},{"internalType":"address","name":"_tokenIn","type":"address"}],"name":"flashDepositERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_crabAmount","type":"uint256"},{"internalType":"uint256","name":"_maxEthToPay","type":"uint256"},{"internalType":"address","name":"_tokenOut","type":"address"},{"internalType":"uint256","name":"_minAmountOut","type":"uint256"},{"internalType":"uint24","name":"_erc20Fee","type":"uint24"},{"internalType":"uint24","name":"_wPowerPerpFee","type":"uint24"}],"name":"flashWithdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapRouter","outputs":[{"internalType":"contract ISwapRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60e060405234801561001057600080fd5b50604051610f84380380610f848339818101604052604081101561003357600080fd5b508051602090910151806001600160a01b03811661006c5760405162461bcd60e51b815260040161006390610176565b60405180910390fd5b60601b6001600160601b03191660805260016000556001600160a01b0382166100dc576040805162461bcd60e51b815260206004820152601460248201527f496e76616c696420637261622061646472657373000000000000000000000000604482015290519081900360640190fd5b816001600160a01b031660a0816001600160a01b031660601b81525050816001600160a01b0316633fc8cef36040518163ffffffff1660e01b815260040160206040518083038186803b15801561013257600080fd5b505afa158015610146573d6000803e3d6000fd5b505050506040513d602081101561015c57600080fd5b505160601b6001600160601b03191660c052506101ad9050565b6020808252601b908201527f696e76616c6964207377617020726f7574657220616464726573730000000000604082015260600190565b60805160601c60a05160601c60c05160601c610d6361022160003980606e52806103c3528061043c52806104cc528061057552806105bf52508060a052806102b4528061035d52806104f052806106a9528061073752806108505250806108e452806109b05280610a8a5250610d636000f3fe60806040526004361061005e5760003560e01c80634285512d116100435780634285512d146101a3578063bca4f628146101b8578063c31c9c071461021357610115565b806302c6600c1461011a5780633fc8cef31461017257610115565b3661011557336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806100c25750336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016145b610113576040805162461bcd60e51b815260206004820152601260248201527f43616e6e6f742072656365697665206574680000000000000000000000000000604482015290519081900360640190fd5b005b600080fd5b34801561012657600080fd5b50610113600480360360c081101561013d57600080fd5b508035906020810135906001600160a01b036040820135169060608101359062ffffff608082013581169160a0013516610228565b34801561017e57600080fd5b506101876104ca565b604080516001600160a01b039092168252519081900360200190f35b3480156101af57600080fd5b506101876104ee565b3480156101c457600080fd5b50610113600480360360c08110156101db57600080fd5b50803590602081013590604081013590606081013562ffffff9081169160808101359091169060a001356001600160a01b0316610512565b34801561021f57600080fd5b506101876108e2565b60026000541415610280576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000908155604080516323b872dd60e01b81523360048201523060248201526044810189905290516001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016926323b872dd92606480820193602093909283900390910190829087803b1580156102fe57600080fd5b505af1158015610312573d6000803e3d6000fd5b505050506040513d602081101561032857600080fd5b505060408051630b52b7ff60e41b8152600481018890526024810187905262ffffff8316604482015290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163b52b7ff091606480830192600092919082900301818387803b1580156103a457600080fd5b505af11580156103b8573d6000803e3d6000fd5b5050505060004790507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561041c57600080fd5b505af1158015610430573d6000803e3d6000fd5b505050505060006104667f0000000000000000000000000000000000000000000000000000000000000000873033868a8a610906565b604080516001600160a01b038916815260208101839052808201859052606081018b9052905191925033917f614f663be393aac8fd2c2993040a634f5b013b3d5f418cc59ad013e96eef53f99181900360800190a250506001600055505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b6002600054141561056a576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260005561059e817f00000000000000000000000000000000000000000000000000000000000000003330898989610906565b50604080516370a0823160e01b815230600482015290516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691632e1a7d4d9183916370a08231916024808301926020929190829003018186803b15801561060d57600080fd5b505afa158015610621573d6000803e3d6000fd5b505050506040513d602081101561063757600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925251602480830192600092919082900301818387803b15801561068f57600080fd5b505af11580156106a3573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663fc5b73ff4788856040518463ffffffff1660e01b8152600401808381526020018262ffffff168152602001925050506000604051808303818588803b15801561071a57600080fd5b505af115801561072e573d6000803e3d6000fd5b505050505060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156107a257600080fd5b505afa1580156107b6573d6000803e3d6000fd5b505050506040513d60208110156107cc57600080fd5b5051604080516001600160a01b0385168152602081018990528082018a905260608101839052476080820152905191925033917fc723e34ef5da33ff97116afe67fb4330d3189467330363a49eb6c9d2fd762a8c9181900360a00190a26040805163a9059cbb60e01b81523360048201526024810183905290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163a9059cbb9160448083019260209291908290030181600087803b15801561089857600080fd5b505af11580156108ac573d6000803e3d6000fd5b505050506040513d60208110156108c257600080fd5b505047156108d4576108d43347610b1e565b505060016000555050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6040516323b872dd60e01b81526000906001600160a01b038916906323b872dd9061093990899030908990600401610c47565b602060405180830381600087803b15801561095357600080fd5b505af1158015610967573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098b9190610c08565b5060405163095ea7b360e01b81526001600160a01b0389169063095ea7b3906109da907f0000000000000000000000000000000000000000000000000000000000000000908890600401610c6b565b602060405180830381600087803b1580156109f457600080fd5b505af1158015610a08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2c9190610c08565b5060408051610100810182526001600160a01b03808b168252898116602083015262ffffff851682840152878116606083015242608083015260a0820187905260c08201869052600060e0830152915163414bf38960e01b815290917f0000000000000000000000000000000000000000000000000000000000000000169063414bf38990610abf908490600401610c84565b602060405180830381600087803b158015610ad957600080fd5b505af1158015610aed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b119190610c2f565b9998505050505050505050565b80471015610b73576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015290519081900360640190fd5b6040516000906001600160a01b0384169083908381818185875af1925050503d8060008114610bbe576040519150601f19603f3d011682016040523d82523d6000602084013e610bc3565b606091505b5050905080610c035760405162461bcd60e51b815260040180806020018281038252603a815260200180610cf4603a913960400191505060405180910390fd5b505050565b600060208284031215610c19578081fd5b81518015158114610c28578182fd5b9392505050565b600060208284031215610c40578081fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6000610100820190506001600160a01b0380845116835280602085015116602084015262ffffff60408501511660408401528060608501511660608401526080840151608084015260a084015160a084015260c084015160c08401528060e08501511660e0840152509291505056fe416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564a2646970667358221220fcd43e471a4f1be2f1f1ccf4169e3d06484dd0cc15e022ffbfc5207a7fbbdf4664736f6c634300070600330000000000000000000000003b960e47784150f5a63777201ee2b15253d713e8000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564

Deployed Bytecode

0x60806040526004361061005e5760003560e01c80634285512d116100435780634285512d146101a3578063bca4f628146101b8578063c31c9c071461021357610115565b806302c6600c1461011a5780633fc8cef31461017257610115565b3661011557336001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21614806100c25750336001600160a01b037f0000000000000000000000003b960e47784150f5a63777201ee2b15253d713e816145b610113576040805162461bcd60e51b815260206004820152601260248201527f43616e6e6f742072656365697665206574680000000000000000000000000000604482015290519081900360640190fd5b005b600080fd5b34801561012657600080fd5b50610113600480360360c081101561013d57600080fd5b508035906020810135906001600160a01b036040820135169060608101359062ffffff608082013581169160a0013516610228565b34801561017e57600080fd5b506101876104ca565b604080516001600160a01b039092168252519081900360200190f35b3480156101af57600080fd5b506101876104ee565b3480156101c457600080fd5b50610113600480360360c08110156101db57600080fd5b50803590602081013590604081013590606081013562ffffff9081169160808101359091169060a001356001600160a01b0316610512565b34801561021f57600080fd5b506101876108e2565b60026000541415610280576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000908155604080516323b872dd60e01b81523360048201523060248201526044810189905290516001600160a01b037f0000000000000000000000003b960e47784150f5a63777201ee2b15253d713e816926323b872dd92606480820193602093909283900390910190829087803b1580156102fe57600080fd5b505af1158015610312573d6000803e3d6000fd5b505050506040513d602081101561032857600080fd5b505060408051630b52b7ff60e41b8152600481018890526024810187905262ffffff8316604482015290516001600160a01b037f0000000000000000000000003b960e47784150f5a63777201ee2b15253d713e8169163b52b7ff091606480830192600092919082900301818387803b1580156103a457600080fd5b505af11580156103b8573d6000803e3d6000fd5b5050505060004790507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561041c57600080fd5b505af1158015610430573d6000803e3d6000fd5b505050505060006104667f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2873033868a8a610906565b604080516001600160a01b038916815260208101839052808201859052606081018b9052905191925033917f614f663be393aac8fd2c2993040a634f5b013b3d5f418cc59ad013e96eef53f99181900360800190a250506001600055505050505050565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b7f0000000000000000000000003b960e47784150f5a63777201ee2b15253d713e881565b6002600054141561056a576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260005561059e817f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc23330898989610906565b50604080516370a0823160e01b815230600482015290516001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21691632e1a7d4d9183916370a08231916024808301926020929190829003018186803b15801561060d57600080fd5b505afa158015610621573d6000803e3d6000fd5b505050506040513d602081101561063757600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b168152600481019290925251602480830192600092919082900301818387803b15801561068f57600080fd5b505af11580156106a3573d6000803e3d6000fd5b505050507f0000000000000000000000003b960e47784150f5a63777201ee2b15253d713e86001600160a01b031663fc5b73ff4788856040518463ffffffff1660e01b8152600401808381526020018262ffffff168152602001925050506000604051808303818588803b15801561071a57600080fd5b505af115801561072e573d6000803e3d6000fd5b505050505060007f0000000000000000000000003b960e47784150f5a63777201ee2b15253d713e86001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156107a257600080fd5b505afa1580156107b6573d6000803e3d6000fd5b505050506040513d60208110156107cc57600080fd5b5051604080516001600160a01b0385168152602081018990528082018a905260608101839052476080820152905191925033917fc723e34ef5da33ff97116afe67fb4330d3189467330363a49eb6c9d2fd762a8c9181900360a00190a26040805163a9059cbb60e01b81523360048201526024810183905290516001600160a01b037f0000000000000000000000003b960e47784150f5a63777201ee2b15253d713e8169163a9059cbb9160448083019260209291908290030181600087803b15801561089857600080fd5b505af11580156108ac573d6000803e3d6000fd5b505050506040513d60208110156108c257600080fd5b505047156108d4576108d43347610b1e565b505060016000555050505050565b7f000000000000000000000000e592427a0aece92de3edee1f18e0157c0586156481565b6040516323b872dd60e01b81526000906001600160a01b038916906323b872dd9061093990899030908990600401610c47565b602060405180830381600087803b15801561095357600080fd5b505af1158015610967573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098b9190610c08565b5060405163095ea7b360e01b81526001600160a01b0389169063095ea7b3906109da907f000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564908890600401610c6b565b602060405180830381600087803b1580156109f457600080fd5b505af1158015610a08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2c9190610c08565b5060408051610100810182526001600160a01b03808b168252898116602083015262ffffff851682840152878116606083015242608083015260a0820187905260c08201869052600060e0830152915163414bf38960e01b815290917f000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564169063414bf38990610abf908490600401610c84565b602060405180830381600087803b158015610ad957600080fd5b505af1158015610aed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b119190610c2f565b9998505050505050505050565b80471015610b73576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015290519081900360640190fd5b6040516000906001600160a01b0384169083908381818185875af1925050503d8060008114610bbe576040519150601f19603f3d011682016040523d82523d6000602084013e610bc3565b606091505b5050905080610c035760405162461bcd60e51b815260040180806020018281038252603a815260200180610cf4603a913960400191505060405180910390fd5b505050565b600060208284031215610c19578081fd5b81518015158114610c28578182fd5b9392505050565b600060208284031215610c40578081fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6000610100820190506001600160a01b0380845116835280602085015116602084015262ffffff60408501511660408401528060608501511660608401526080840151608084015260a084015160a084015260c084015160c08401528060e08501511660e0840152509291505056fe416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564a2646970667358221220fcd43e471a4f1be2f1f1ccf4169e3d06484dd0cc15e022ffbfc5207a7fbbdf4664736f6c63430007060033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000003b960e47784150f5a63777201ee2b15253d713e8000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564

-----Decoded View---------------
Arg [0] : _crab (address): 0x3B960E47784150F5a63777201ee2B15253D713e8
Arg [1] : _swapRouter (address): 0xE592427A0AEce92De3Edee1F18E0157C05861564

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000003b960e47784150f5a63777201ee2b15253d713e8
Arg [1] : 000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564


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.