ETH Price: $3,183.13 (-7.52%)
Gas: 3 Gwei

Contract

0xc8D1335d18C0Ef56A00Dbb8b7A639183EE1C4d78
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Deposit From U C...200211712024-06-04 21:33:3550 days ago1717536815IN
0xc8D1335d...3EE1C4d78
0 ETH0.0069737612.25498674
Deposit From U C...198494662024-05-11 21:26:3574 days ago1715462795IN
0xc8D1335d...3EE1C4d78
0 ETH0.002099763.68991173
Deposit From U C...198364192024-05-10 1:39:3576 days ago1715305175IN
0xc8D1335d...3EE1C4d78
0 ETH0.002276224
Deposit From U C...194092422024-03-11 3:42:47136 days ago1710128567IN
0xc8D1335d...3EE1C4d78
0 ETH0.0233847841.09406813
Deposit From U C...191374862024-02-02 1:35:35174 days ago1706837735IN
0xc8D1335d...3EE1C4d78
0 ETH0.0141410524.85006217
Deposit From U C...190671642024-01-23 5:01:11184 days ago1705986071IN
0xc8D1335d...3EE1C4d78
0 ETH0.005428949.54028897
Deposit From U C...190534112024-01-21 6:21:23185 days ago1705818083IN
0xc8D1335d...3EE1C4d78
0 ETH0.00514499.04114546
Deposit From U C...190143312024-01-15 19:20:35191 days ago1705346435IN
0xc8D1335d...3EE1C4d78
0 ETH0.0194044434.09942076
Deposit From U C...189085002023-12-31 22:40:59206 days ago1704062459IN
0xc8D1335d...3EE1C4d78
0 ETH0.0073081212.84256924
Deposit From U C...188990392023-12-30 14:51:47207 days ago1703947907IN
0xc8D1335d...3EE1C4d78
0 ETH0.0096342716.93003366
Deposit From U C...188470782023-12-23 7:38:23214 days ago1703317103IN
0xc8D1335d...3EE1C4d78
0 ETH0.0134151223.57439518
Deposit From U C...187841162023-12-14 11:34:35223 days ago1702553675IN
0xc8D1335d...3EE1C4d78
0 ETH0.0201756835.45472427
Deposit From U C...186509782023-11-25 20:05:47242 days ago1700942747IN
0xc8D1335d...3EE1C4d78
0 ETH0.0139613524.53428273
Deposit From U C...185344192023-11-09 12:34:23258 days ago1699533263IN
0xc8D1335d...3EE1C4d78
0 ETH0.0215534437.87585772
Deposit From U C...184396992023-10-27 6:17:11271 days ago1698387431IN
0xc8D1335d...3EE1C4d78
0 ETH0.0072204412.68847511
Deposit From U C...184186372023-10-24 7:29:35274 days ago1698132575IN
0xc8D1335d...3EE1C4d78
0 ETH0.0076465713.43731283
Deposit From U C...184179222023-10-24 5:05:47275 days ago1698123947IN
0xc8D1335d...3EE1C4d78
0 ETH0.0104271418.32360714
Deposit From U C...183744462023-10-18 3:05:23281 days ago1697598323IN
0xc8D1335d...3EE1C4d78
0 ETH0.003940316.92430755
Deposit From U C...183591582023-10-15 23:48:59283 days ago1697413739IN
0xc8D1335d...3EE1C4d78
0 ETH0.003800676.67893018
Deposit From U C...183152232023-10-09 20:13:47289 days ago1696882427IN
0xc8D1335d...3EE1C4d78
0 ETH0.0062325410.95244179
Deposit From U C...182992102023-10-07 14:29:35291 days ago1696688975IN
0xc8D1335d...3EE1C4d78
0 ETH0.004072167.15601805
Deposit From U C...181939252023-09-22 21:02:11306 days ago1695416531IN
0xc8D1335d...3EE1C4d78
0 ETH0.007074912.43271841
Deposit From U C...181844852023-09-21 13:15:35307 days ago1695302135IN
0xc8D1335d...3EE1C4d78
0 ETH0.0065344811.48305092
Deposit From U C...181390642023-09-15 3:50:59314 days ago1694749859IN
0xc8D1335d...3EE1C4d78
0 ETH0.0060159210.57197531
Deposit From U C...180829792023-09-07 7:10:59321 days ago1694070659IN
0xc8D1335d...3EE1C4d78
0 ETH0.0058859510.34338663
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
178063442023-07-30 14:08:47360 days ago1690726127
0xc8D1335d...3EE1C4d78
0.32115332 ETH
178063442023-07-30 14:08:47360 days ago1690726127
0xc8D1335d...3EE1C4d78
0.32115332 ETH
177749252023-07-26 4:39:35365 days ago1690346375
0xc8D1335d...3EE1C4d78
1.27194179 ETH
177749252023-07-26 4:39:35365 days ago1690346375
0xc8D1335d...3EE1C4d78
1.27194179 ETH
177385982023-07-21 2:38:47370 days ago1689907127
0xc8D1335d...3EE1C4d78
0.05098442 ETH
177385982023-07-21 2:38:47370 days ago1689907127
0xc8D1335d...3EE1C4d78
0.05098442 ETH
176477882023-07-08 8:13:47382 days ago1688804027
0xc8D1335d...3EE1C4d78
0.06450845 ETH
176477882023-07-08 8:13:47382 days ago1688804027
0xc8D1335d...3EE1C4d78
0.06450845 ETH
175947472023-06-30 21:25:59390 days ago1688160359
0xc8D1335d...3EE1C4d78
5.1674009 ETH
175947472023-06-30 21:25:59390 days ago1688160359
0xc8D1335d...3EE1C4d78
5.1674009 ETH
175710092023-06-27 13:33:47393 days ago1687872827
0xc8D1335d...3EE1C4d78
0.1336714 ETH
175710092023-06-27 13:33:47393 days ago1687872827
0xc8D1335d...3EE1C4d78
0.1336714 ETH
174519802023-06-10 19:56:23410 days ago1686426983
0xc8D1335d...3EE1C4d78
0.96701794 ETH
174519802023-06-10 19:56:23410 days ago1686426983
0xc8D1335d...3EE1C4d78
0.96701794 ETH
174136282023-06-05 10:07:47415 days ago1685959667
0xc8D1335d...3EE1C4d78
3.10703962 ETH
174136282023-06-05 10:07:47415 days ago1685959667
0xc8D1335d...3EE1C4d78
3.10703962 ETH
173328482023-05-25 1:18:11427 days ago1684977491
0xc8D1335d...3EE1C4d78
0.28558823 ETH
173328482023-05-25 1:18:11427 days ago1684977491
0xc8D1335d...3EE1C4d78
0.28558823 ETH
172486942023-05-13 4:27:47439 days ago1683952067
0xc8D1335d...3EE1C4d78
0.38801295 ETH
172486942023-05-13 4:27:47439 days ago1683952067
0xc8D1335d...3EE1C4d78
0.38801295 ETH
171273492023-04-26 2:11:35456 days ago1682475095
0xc8D1335d...3EE1C4d78
0.68557907 ETH
171273492023-04-26 2:11:35456 days ago1682475095
0xc8D1335d...3EE1C4d78
0.68557907 ETH
170727082023-04-18 9:33:11463 days ago1681810391
0xc8D1335d...3EE1C4d78
0.06905398 ETH
170727082023-04-18 9:33:11463 days ago1681810391
0xc8D1335d...3EE1C4d78
0.06905398 ETH
170725232023-04-18 8:55:35463 days ago1681808135
0xc8D1335d...3EE1C4d78
0.15718053 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
stkCvxCrvZaps

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 17 : StrategyZaps.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "SafeERC20.sol";
import "ERC20.sol";
import "IGenericVault.sol";
import "ICurveV2Pool.sol";
import "ICurveFactoryPool.sol";
import "ICurveTriCrypto.sol";
import "ICVXLocker.sol";
import "IUniV2Router.sol";
import "ITriPool.sol";
import "IBooster.sol";
import "IRewards.sol";
import "IUnionVault.sol";

contract stkCvxCrvZaps {
    using SafeERC20 for IERC20;

    address public immutable vault;

    address private constant CONVEX_LOCKER =
        0x72a19342e8F1838460eBFCCEf09F6585e32db86E;
    address private constant CVXCRV_STAKING_CONTRACT =
        0x3Fe65692bfCD0e6CF84cB1E7d24108E434A7587e;
    address private constant CURVE_CRV_ETH_POOL =
        0x8301AE4fc9c624d1D396cbDAa1ed877821D7C511;
    address private constant CURVE_CVX_ETH_POOL =
        0xB576491F1E6e5E62f1d8F26062Ee822B40B0E0d4;
    address private constant CURVE_CVXCRV_CRV_POOL =
        0x9D0464996170c6B9e75eED71c68B99dDEDf279e8;

    address private constant CRV_TOKEN =
        0xD533a949740bb3306d119CC777fa900bA034cd52;
    address private constant CVXCRV_TOKEN =
        0x62B9c7356A2Dc64a1969e19C23e4f579F9810Aa7;
    address private constant CVX_TOKEN =
        0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B;
    address private constant UNION_CRV =
        0x83507cc8C8B67Ed48BADD1F59F684D5d02884C81;
    address private constant WETH_TOKEN =
        0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
    address private constant USDT_TOKEN =
        0xdAC17F958D2ee523a2206206994597C13D831ec7;
    address private constant TRICRYPTO =
        0xD51a44d3FaE010294C616388b506AcdA1bfAAE46;
    address private constant TRIPOOL =
        0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7;
    address private constant TRICRV =
        0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490;
    address private constant BOOSTER =
        0xF403C135812408BFbE8713b5A23a04b3D48AAE31;
    address private constant CONVEX_TRIPOOL_TOKEN =
        0x30D9410ED1D5DA1F6C8391af5338C93ab8d4035C;
    address private constant CONVEX_TRIPOOL_REWARDS =
        0x689440f2Ff927E1f24c72F1087E1FAF471eCe1c8;

    uint256 private constant CRVETH_ETH_INDEX = 0;
    uint256 private constant CRVETH_CRV_INDEX = 1;
    int128 private constant CVXCRV_CRV_INDEX = 0;
    int128 private constant CVXCRV_CVXCRV_INDEX = 1;
    uint256 private constant CVXETH_ETH_INDEX = 0;
    uint256 private constant CVXETH_CVX_INDEX = 1;

    ICurveV2Pool cvxEthSwap = ICurveV2Pool(CURVE_CVX_ETH_POOL);
    ICurveV2Pool crvEthSwap = ICurveV2Pool(CURVE_CRV_ETH_POOL);
    ITriPool triPool = ITriPool(TRIPOOL);
    IBooster booster = IBooster(BOOSTER);
    IRewards triPoolRewards = IRewards(CONVEX_TRIPOOL_REWARDS);
    ICurveFactoryPool crvCvxCrvSwap = ICurveFactoryPool(CURVE_CVXCRV_CRV_POOL);
    ICurveTriCrypto triCryptoSwap = ICurveTriCrypto(TRICRYPTO);
    ICVXLocker locker = ICVXLocker(CONVEX_LOCKER);

    constructor(address _vault) {
        vault = _vault;
    }

    /// @notice Set approvals for the contracts used when swapping & staking
    function setApprovals() external {
        IERC20(CRV_TOKEN).safeApprove(CURVE_CRV_ETH_POOL, 0);
        IERC20(CRV_TOKEN).safeApprove(CURVE_CRV_ETH_POOL, type(uint256).max);

        IERC20(CVXCRV_TOKEN).safeApprove(CVXCRV_STAKING_CONTRACT, 0);
        IERC20(CVXCRV_TOKEN).safeApprove(
            CVXCRV_STAKING_CONTRACT,
            type(uint256).max
        );

        IERC20(CVXCRV_TOKEN).safeApprove(CURVE_CVXCRV_CRV_POOL, 0);
        IERC20(CVXCRV_TOKEN).safeApprove(
            CURVE_CVXCRV_CRV_POOL,
            type(uint256).max
        );

        IERC20(CRV_TOKEN).safeApprove(CURVE_CVXCRV_CRV_POOL, 0);
        IERC20(CRV_TOKEN).safeApprove(CURVE_CVXCRV_CRV_POOL, type(uint256).max);

        IERC20(TRICRV).safeApprove(BOOSTER, 0);
        IERC20(TRICRV).safeApprove(BOOSTER, type(uint256).max);

        IERC20(USDT_TOKEN).safeApprove(TRIPOOL, 0);
        IERC20(USDT_TOKEN).safeApprove(TRIPOOL, type(uint256).max);

        IERC20(CONVEX_TRIPOOL_TOKEN).safeApprove(CONVEX_TRIPOOL_REWARDS, 0);
        IERC20(CONVEX_TRIPOOL_TOKEN).safeApprove(
            CONVEX_TRIPOOL_REWARDS,
            type(uint256).max
        );

        IERC20(CVXCRV_TOKEN).safeApprove(vault, 0);
        IERC20(CVXCRV_TOKEN).safeApprove(vault, type(uint256).max);

        IERC20(CVX_TOKEN).safeApprove(CONVEX_LOCKER, 0);
        IERC20(CVX_TOKEN).safeApprove(CONVEX_LOCKER, type(uint256).max);

        IERC20(CRV_TOKEN).safeApprove(CURVE_CRV_ETH_POOL, 0);
        IERC20(CRV_TOKEN).safeApprove(CURVE_CRV_ETH_POOL, type(uint256).max);
    }

    /// @notice Swap CRV for cvxCRV on Curve
    /// @param amount - amount to swap
    /// @param recipient - where swapped tokens will be sent to
    /// @param minAmountOut - minimum expected amount of output tokens
    /// @return amount of CRV obtained after the swap
    function _crvToCvxCrv(
        uint256 amount,
        address recipient,
        uint256 minAmountOut
    ) internal returns (uint256) {
        return
            crvCvxCrvSwap.exchange(
                CVXCRV_CRV_INDEX,
                CVXCRV_CVXCRV_INDEX,
                amount,
                minAmountOut,
                recipient
            );
    }

    /// @notice Swap cvxCRV for CRV on Curve
    /// @param amount - amount to swap
    /// @param recipient - where swapped tokens will be sent to
    /// @param minAmountOut - minimum expected amount of output tokens
    /// @return amount of CRV obtained after the swap
    function _cvxCrvToCrv(
        uint256 amount,
        address recipient,
        uint256 minAmountOut
    ) internal returns (uint256) {
        return
            crvCvxCrvSwap.exchange(
                CVXCRV_CVXCRV_INDEX,
                CVXCRV_CRV_INDEX,
                amount,
                minAmountOut,
                recipient
            );
    }

    /// @notice Swap CRV for native ETH on Curve
    /// @param amount - amount to swap
    /// @param minAmountOut - minimum expected amount of output tokens
    /// @return amount of ETH obtained after the swap
    function _crvToEth(uint256 amount, uint256 minAmountOut)
        internal
        returns (uint256)
    {
        return
            crvEthSwap.exchange_underlying{value: 0}(
                CRVETH_CRV_INDEX,
                CRVETH_ETH_INDEX,
                amount,
                minAmountOut
            );
    }

    /// @notice Swap native ETH for CRV on Curve
    /// @param amount - amount to swap
    /// @param minAmountOut - minimum expected amount of output tokens
    /// @return amount of CRV obtained after the swap
    function _ethToCrv(uint256 amount, uint256 minAmountOut)
        internal
        returns (uint256)
    {
        return
            crvEthSwap.exchange_underlying{value: amount}(
                CRVETH_ETH_INDEX,
                CRVETH_CRV_INDEX,
                amount,
                minAmountOut
            );
    }

    /// @notice Swap native ETH for CVX on Curve
    /// @param amount - amount to swap
    /// @param minAmountOut - minimum expected amount of output tokens
    /// @return amount of CRV obtained after the swap
    function _ethToCvx(uint256 amount, uint256 minAmountOut)
        internal
        returns (uint256)
    {
        return
            cvxEthSwap.exchange_underlying{value: amount}(
                CVXETH_ETH_INDEX,
                CVXETH_CVX_INDEX,
                amount,
                minAmountOut
            );
    }

    /////////////////////////////////////////////////////////////

    /// @notice Deposit into the pounder from ETH
    /// @param minAmountOut - min amount of lp tokens expected
    /// @param to - address to stake on behalf of
    function depositFromEth(uint256 minAmountOut, address to)
        external
        payable
        notToZeroAddress(to)
    {
        require(msg.value > 0, "cheap");
        _depositFromEth(msg.value, minAmountOut, to);
    }

    /// @notice Internal function to deposit ETH to the pounder
    /// @param amount - amount of ETH
    /// @param minAmountOut - min amount of lp tokens expected
    /// @param to - address to stake on behalf of
    function _depositFromEth(
        uint256 amount,
        uint256 minAmountOut,
        address to
    ) internal {
        uint256 _crvAmount = _ethToCrv(amount, 0);
        _crvToCvxCrv(_crvAmount, address(this), minAmountOut);
        IGenericVault(vault).depositAll(to);
    }

    /// @notice Deposit into the pounder from CRV
    /// @param amount - amount of CRV
    /// @param minAmountOut - min amount of cvxCRV expected
    /// @param to - address to stake on behalf of
    function depositFromCrv(
        uint256 amount,
        uint256 minAmountOut,
        address to
    ) external notToZeroAddress(to) {
        IERC20(CRV_TOKEN).safeTransferFrom(msg.sender, address(this), amount);
        _crvToCvxCrv(amount, address(this), minAmountOut);
        IGenericVault(vault).depositAll(to);
    }

    /// @notice Deposit into the pounder from legacy uCRV
    /// @param amount - amount of uCRV
    /// @param minAmountOut - min amount of cvxCRV expected
    /// @param to - address to stake on behalf of
    function depositFromUCrv(
        uint256 amount,
        uint256 minAmountOut,
        address to
    ) external notToZeroAddress(to) {
        IERC20(UNION_CRV).safeTransferFrom(msg.sender, address(this), amount);
        IUnionVault(UNION_CRV).withdrawAll(address(this));
        IGenericVault(vault).depositAll(to);
    }

    /// @notice Deposit into the pounder from any token via Uni interface
    /// @notice Use at your own risk
    /// @dev Zap contract needs approval for spending of inputToken
    /// @param amount - min amount of input token
    /// @param minAmountOut - min amount of cvxCRV expected
    /// @param router - address of the router to use. e.g. 0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F for Sushi
    /// @param inputToken - address of the token to swap from, needs to have an ETH pair on router used
    /// @param to - address to stake on behalf of
    function depositViaUniV2EthPair(
        uint256 amount,
        uint256 minAmountOut,
        address router,
        address inputToken,
        address to
    ) external notToZeroAddress(to) {
        require(router != address(0));

        IERC20(inputToken).safeTransferFrom(msg.sender, address(this), amount);
        address[] memory _path = new address[](2);
        _path[0] = inputToken;
        _path[1] = WETH_TOKEN;

        IERC20(inputToken).safeApprove(router, 0);
        IERC20(inputToken).safeApprove(router, amount);

        IUniV2Router(router).swapExactTokensForETH(
            amount,
            1,
            _path,
            address(this),
            block.timestamp + 1
        );
        _depositFromEth(address(this).balance, minAmountOut, to);
    }

    /// @notice Retrieves a user's vault shares and withdraw all
    /// @param _amount - amount of shares to retrieve
    /// @return amount withdrawn
    function _claimAndWithdraw(uint256 _amount) internal returns (uint256) {
        IERC20(vault).safeTransferFrom(msg.sender, address(this), _amount);
        return IGenericVault(vault).withdrawAll(address(this));
    }

    /// @notice Claim as native ETH
    /// @param amount - amount to withdraw
    /// @param minAmountOut - minimum amount of ETH expected
    /// @param to - address to send ETH to
    /// @return amount of ETH withdrawn
    function claimFromVaultAsEth(
        uint256 amount,
        uint256 minAmountOut,
        address to
    ) public notToZeroAddress(to) returns (uint256) {
        uint256 _ethAmount = _claimAsEth(amount, minAmountOut);
        (bool success, ) = to.call{value: _ethAmount}("");
        require(success, "ETH transfer failed");
        return _ethAmount;
    }

    /// @notice Withdraw as native CRV
    /// @param amount - amount to withdraw
    /// @param to - address that will receive the CRV
    /// @param minAmountOut - min amount of  CRV expected
    /// @return amount of CRV withdrawn
    function claimFromVaultAsCrv(
        uint256 amount,
        uint256 minAmountOut,
        address to
    ) public returns (uint256) {
        uint256 _cvxCrvAmount = _claimAndWithdraw(amount);
        return _cvxCrvToCrv(_cvxCrvAmount, to, minAmountOut);
    }

    /// @notice Withdraw as native ETH (internal)
    /// @param _amount - amount to withdraw
    /// @param _minAmountOut - min amount of ETH expected
    /// @return amount of ETH withdrawn
    function _claimAsEth(uint256 _amount, uint256 _minAmountOut)
        internal
        returns (uint256)
    {
        uint256 _crvAmount = claimFromVaultAsCrv(_amount, 0, address(this));
        return _crvToEth(_crvAmount, _minAmountOut);
    }

    /// @notice Claim to any token via a univ2 router
    /// @notice Use at your own risk
    /// @param amount - amount of uFXS to unstake
    /// @param minAmountOut - min amount of output token expected
    /// @param router - address of the router to use. e.g. 0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F for Sushi
    /// @param outputToken - address of the token to swap to
    /// @param to - address of the final recipient of the swapped tokens
    function claimFromVaultViaUniV2EthPair(
        uint256 amount,
        uint256 minAmountOut,
        address router,
        address outputToken,
        address to
    ) public notToZeroAddress(to) {
        require(router != address(0));
        _claimAsEth(amount, 0);
        address[] memory _path = new address[](2);
        _path[0] = WETH_TOKEN;
        _path[1] = outputToken;
        IUniV2Router(router).swapExactETHForTokens{
            value: address(this).balance
        }(minAmountOut, _path, to, block.timestamp + 1);
    }

    /// @notice Claim as USDT via Tricrypto
    /// @param amount - the amount of uFXS to unstake
    /// @param minAmountOut - the min expected amount of USDT to receive
    /// @param to - the adress that will receive the USDT
    /// @return amount of USDT obtained
    function claimFromVaultAsUsdt(
        uint256 amount,
        uint256 minAmountOut,
        address to
    ) public notToZeroAddress(to) returns (uint256) {
        uint256 _ethAmount = claimFromVaultAsEth(amount, 0, address(this));
        _swapEthToUsdt(_ethAmount, minAmountOut);
        uint256 _usdtAmount = IERC20(USDT_TOKEN).balanceOf(address(this));
        IERC20(USDT_TOKEN).safeTransfer(to, _usdtAmount);
        return _usdtAmount;
    }

    /// @notice swap ETH to USDT via Curve's tricrypto
    /// @param amount - the amount of ETH to swap
    /// @param minAmountOut - the minimum amount expected
    function _swapEthToUsdt(uint256 amount, uint256 minAmountOut) internal {
        triCryptoSwap.exchange{value: amount}(
            2, // ETH
            0, // USDT
            amount,
            minAmountOut,
            true
        );
    }

    /// @notice Unstake from the Pounder to stables and stake on 3pool convex for yield
    /// @param amount - amount of uCRV to unstake
    /// @param minAmountOut - minimum amount of 3CRV (NOT USDT!)
    /// @param to - address on behalf of which to stake
    function claimFromVaultAndStakeIn3PoolConvex(
        uint256 amount,
        uint256 minAmountOut,
        address to
    ) public notToZeroAddress(to) {
        // claim as USDT
        uint256 _usdtAmount = claimFromVaultAsUsdt(amount, 0, address(this));
        // add USDT to Tripool
        triPool.add_liquidity([0, 0, _usdtAmount], minAmountOut);
        // deposit on Convex
        booster.depositAll(9, false);
        // stake on behalf of user
        triPoolRewards.stakeFor(
            to,
            IERC20(CONVEX_TRIPOOL_TOKEN).balanceOf(address(this))
        );
    }

    /// @notice Claim as CVX via CurveCVX
    /// @param amount - the amount of uFXS to unstake
    /// @param minAmountOut - the min expected amount of USDT to receive
    /// @param to - the adress that will receive the CVX
    /// @param lock - whether to lock the CVX or not
    /// @return amount of CVX obtained
    function claimFromVaultAsCvx(
        uint256 amount,
        uint256 minAmountOut,
        address to,
        bool lock
    ) public notToZeroAddress(to) returns (uint256) {
        uint256 _ethAmount = _claimAsEth(amount, 0);
        uint256 _cvxAmount = _ethToCvx(_ethAmount, minAmountOut);
        if (lock) {
            locker.lock(to, _cvxAmount, 0);
        } else {
            IERC20(CVX_TOKEN).safeTransfer(to, _cvxAmount);
        }
        return _cvxAmount;
    }

    modifier notToZeroAddress(address _to) {
        require(_to != address(0), "Invalid address!");
        _;
    }

    receive() external payable {}
}

File 2 of 17 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "IERC20.sol";
import "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'
        // solhint-disable-next-line max-line-length
        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));
        }
    }

    /**
     * @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
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 3 of 17 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.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 4 of 17 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.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 5 of 17 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "IERC20.sol";
import "IERC20Metadata.sol";
import "Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping (address => uint256) private _balances;

    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The defaut value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        _approve(sender, _msgSender(), currentAllowance - amount);

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        _approve(_msgSender(), spender, currentAllowance - subtractedValue);

        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        _balances[sender] = senderBalance - amount;
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        _balances[account] = accountBalance - amount;
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}

File 6 of 17 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT

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 7 of 17 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 8 of 17 : IGenericVault.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface IGenericVault {
    function withdraw(address _to, uint256 _shares)
        external
        returns (uint256 withdrawn);

    function withdrawAll(address _to) external returns (uint256 withdrawn);

    function depositAll(address _to) external returns (uint256 _shares);

    function deposit(address _to, uint256 _amount)
        external
        returns (uint256 _shares);

    function harvest() external;

    function balanceOfUnderlying(address user)
        external
        view
        returns (uint256 amount);

    function totalUnderlying() external view returns (uint256 total);

    function totalSupply() external view returns (uint256 total);

    function underlying() external view returns (address);

    function strategy() external view returns (address);

    function platform() external view returns (address);

    function setPlatform(address _platform) external;

    function setPlatformFee(uint256 _fee) external;

    function setCallIncentive(uint256 _incentive) external;

    function setWithdrawalPenalty(uint256 _penalty) external;

    function setApprovals() external;

    function callIncentive() external view returns (uint256);

    function platformFee() external view returns (uint256);
}

File 9 of 17 : ICurveV2Pool.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface ICurveV2Pool {
    function get_dy(
        uint256 i,
        uint256 j,
        uint256 dx
    ) external view returns (uint256);

    function calc_token_amount(uint256[2] calldata amounts)
        external
        view
        returns (uint256);

    function exchange_underlying(
        uint256 i,
        uint256 j,
        uint256 dx,
        uint256 min_dy
    ) external payable returns (uint256);

    function add_liquidity(uint256[2] calldata amounts, uint256 min_mint_amount)
        external
        returns (uint256);

    function lp_price() external view returns (uint256);

    function exchange(
        uint256 i,
        uint256 j,
        uint256 dx,
        uint256 min_dy
    ) external payable returns (uint256);

    function exchange(
        uint256 i,
        uint256 j,
        uint256 dx,
        uint256 min_dy,
        bool use_eth
    ) external payable returns (uint256);

    function exchange(
        uint256 i,
        uint256 j,
        uint256 dx,
        uint256 min_dy,
        bool use_eth,
        address receiver
    ) external payable returns (uint256);

    function price_oracle() external view returns (uint256);

    function remove_liquidity_one_coin(
        uint256 token_amount,
        uint256 i,
        uint256 min_amount,
        bool use_eth,
        address receiver
    ) external returns (uint256);
}

File 10 of 17 : ICurveFactoryPool.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface ICurveFactoryPool {
    function get_dy(
        int128 i,
        int128 j,
        uint256 dx
    ) external view returns (uint256);

    function get_balances() external view returns (uint256[2] memory);

    function add_liquidity(
        uint256[2] memory _amounts,
        uint256 _min_mint_amount,
        address _receiver
    ) external returns (uint256);

    function exchange(
        int128 i,
        int128 j,
        uint256 _dx,
        uint256 _min_dy,
        address _receiver
    ) external returns (uint256);
}

File 11 of 17 : ICurveTriCrypto.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface ICurveTriCrypto {
    function exchange(
        uint256 i,
        uint256 j,
        uint256 dx,
        uint256 min_dy,
        bool use_eth
    ) external payable;

    function get_dy(
        uint256 i,
        uint256 j,
        uint256 dx
    ) external view returns (uint256);

    function price_oracle(uint256 k) external view returns (uint256);
}

File 12 of 17 : ICVXLocker.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface ICVXLocker {
    function lock(
        address _account,
        uint256 _amount,
        uint256 _spendRatio
    ) external;

    function balances(address _user)
        external
        view
        returns (
            uint112 locked,
            uint112 boosted,
            uint32 nextUnlockIndex
        );
}

File 13 of 17 : IUniV2Router.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface IUniV2Router {
    function swapExactTokensForETH(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external payable returns (uint256[] memory amounts);

    function swapExactETHForTokens(
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external payable returns (uint256[] memory amounts);

    function swapExactTokensForTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

    function getAmountsOut(uint256 amountIn, address[] memory path)
        external
        view
        returns (uint256[] memory amounts);
}

File 14 of 17 : ITriPool.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface ITriPool {
    function add_liquidity(uint256[3] calldata amounts, uint256 min_mint_amount)
        external;

    function get_virtual_price() external view returns (uint256);

    function exchange(
        uint256 i,
        uint256 j,
        uint256 dx,
        uint256 min_dy
    ) external;
}

File 15 of 17 : IBooster.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface IBooster {
    function depositAll(uint256 _pid, bool _stake) external returns (bool);

    function deposit(
        uint256 _pid,
        uint256 _amount,
        bool _stake
    ) external returns (bool);

    function withdraw(uint256 _pid, uint256 _amount) external returns (bool);

    function withdrawAll(uint256 _pid) external returns (bool);
}

File 16 of 17 : IRewards.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface IRewards {
    function balanceOf(address) external view returns (uint256);

    function stake(address, uint256) external;

    function stakeFor(address, uint256) external;

    function withdraw(address, uint256) external;

    function exit(address) external;

    function getReward(address) external;

    function queueNewRewards(uint256) external;

    function notifyRewardAmount(uint256) external;

    function addExtraReward(address) external;

    function stakingToken() external view returns (address);

    function rewardToken() external view returns (address);

    function earned(address account) external view returns (uint256);
}

File 17 of 17 : IUnionVault.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface IUnionVault {
    enum Option {
        Claim,
        ClaimAsETH,
        ClaimAsCRV,
        ClaimAsCVX,
        ClaimAndStake
    }

    function withdraw(address _to, uint256 _shares)
        external
        returns (uint256 withdrawn);

    function withdrawAll(address _to) external returns (uint256 withdrawn);

    function withdrawAs(
        address _to,
        uint256 _shares,
        Option option
    ) external;

    function withdrawAs(
        address _to,
        uint256 _shares,
        Option option,
        uint256 minAmountOut
    ) external;

    function withdrawAllAs(address _to, Option option) external;

    function withdrawAllAs(
        address _to,
        Option option,
        uint256 minAmountOut
    ) external;

    function depositAll(address _to) external returns (uint256 _shares);

    function deposit(address _to, uint256 _amount)
        external
        returns (uint256 _shares);

    function harvest() external;

    function balanceOfUnderlying(address user)
        external
        view
        returns (uint256 amount);

    function outstanding3CrvRewards() external view returns (uint256 total);

    function outstandingCvxRewards() external view returns (uint256 total);

    function outstandingCrvRewards() external view returns (uint256 total);

    function totalUnderlying() external view returns (uint256 total);

    function underlying() external view returns (address);

    function setPlatform(address _platform) external;

    function setPlatformFee(uint256 _fee) external;

    function setCallIncentive(uint256 _incentive) external;

    function setWithdrawalPenalty(uint256 _penalty) external;

    function withdrawalPenalty() external view returns (uint256);

    function setApprovals() external;
}

Settings
{
  "evmVersion": "istanbul",
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "libraries": {
    "StrategyZaps.sol": {}
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_vault","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"claimFromVaultAndStakeIn3PoolConvex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"claimFromVaultAsCrv","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bool","name":"lock","type":"bool"}],"name":"claimFromVaultAsCvx","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"claimFromVaultAsEth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"claimFromVaultAsUsdt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"router","type":"address"},{"internalType":"address","name":"outputToken","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"claimFromVaultViaUniV2EthPair","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"depositFromCrv","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"depositFromEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"depositFromUCrv","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"router","type":"address"},{"internalType":"address","name":"inputToken","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"depositViaUniV2EthPair","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setApprovals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a0604052600080546001600160a01b031990811673b576491f1e6e5e62f1d8f26062ee822b40b0e0d417909155600180548216738301ae4fc9c624d1d396cbdaa1ed877821d7c51117905560028054821673bebc44782c7db0a1a60cb6fe97d0b483032ff1c717905560038054821673f403c135812408bfbe8713b5a23a04b3d48aae3117905560048054821673689440f2ff927e1f24c72f1087e1faf471ece1c8179055600580548216739d0464996170c6b9e75eed71c68b99ddedf279e817905560068054821673d51a44d3fae010294c616388b506acda1bfaae46179055600780549091167372a19342e8f1838460ebfccef09f6585e32db86e17905534801561010c57600080fd5b50604051611e17380380611e1783398101604081905261012b9161013c565b6001600160a01b031660805261016c565b60006020828403121561014e57600080fd5b81516001600160a01b038116811461016557600080fd5b9392505050565b608051611c6d6101aa600039600081816102260152818161034a01528181610dd701528181610e170152818161141e015261145b0152611c6d6000f3fe6080604052600436106100ab5760003560e01c80638702ca5c116100645780638702ca5c1461017f5780638757b15b1461019f578063a8d9693d146101b4578063dbc199d7146101d4578063f3bb2ca1146101f4578063fbfa77cf1461021457600080fd5b806326600ecb146100b757806331247e06146100cc57806343a7887e146100ec57806377212cf31461010c578063775491dc1461012c57806379e8aeeb1461015f57600080fd5b366100b257005b600080fd5b6100ca6100c536600461184e565b610260565b005b3480156100d857600080fd5b506100ca6100e736600461187a565b6102d8565b3480156100f857600080fd5b506100ca61010736600461187a565b6103cd565b34801561011857600080fd5b506100ca61012736600461187a565b610605565b34801561013857600080fd5b5061014c61014736600461187a565b6106d0565b6040519081526020015b60405180910390f35b34801561016b57600080fd5b506100ca61017a3660046118af565b6107c3565b34801561018b57600080fd5b506100ca61019a3660046118af565b610970565b3480156101ab57600080fd5b506100ca610ade565b3480156101c057600080fd5b5061014c6101cf36600461187a565b610f12565b3480156101e057600080fd5b5061014c6101ef36600461187a565b610f36565b34801561020057600080fd5b5061014c61020f366004611917565b611010565b34801561022057600080fd5b506102487f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610156565b806001600160a01b0381166102905760405162461bcd60e51b81526004016102879061195f565b60405180910390fd5b600034116102c85760405162461bcd60e51b8152602060048201526005602482015264063686561760dc1b6044820152606401610287565b6102d33484846110f8565b505050565b806001600160a01b0381166102ff5760405162461bcd60e51b81526004016102879061195f565b61031f73d533a949740bb3306d119cc777fa900ba034cd52333087611112565b61032a843085611183565b50604051639f0d5f2760e01b81526001600160a01b0383811660048301527f00000000000000000000000000000000000000000000000000000000000000001690639f0d5f2790602401602060405180830381600087803b15801561038e57600080fd5b505af11580156103a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c69190611989565b5050505050565b806001600160a01b0381166103f45760405162461bcd60e51b81526004016102879061195f565b6000610402856000306106d0565b60025460408051606081018252600080825260208201528082018490529051634515cef360e01b81529293506001600160a01b0390911691634515cef39161044e9188906004016119a2565b600060405180830381600087803b15801561046857600080fd5b505af115801561047c573d6000803e3d6000fd5b505060035460405163303acfe760e11b815260096004820152600060248201526001600160a01b0390911692506360759fce9150604401602060405180830381600087803b1580156104cd57600080fd5b505af11580156104e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050591906119da565b50600480546040516370a0823160e01b815230928101929092526001600160a01b031690632ee409089085907330d9410ed1d5da1f6c8391af5338c93ab8d4035c906370a082319060240160206040518083038186803b15801561056857600080fd5b505afa15801561057c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a09190611989565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b1580156105e657600080fd5b505af11580156105fa573d6000803e3d6000fd5b505050505050505050565b806001600160a01b03811661062c5760405162461bcd60e51b81526004016102879061195f565b61064c7383507cc8c8b67ed48badd1f59f684d5d02884c81333087611112565b604051630fa09e6360e41b81523060048201527383507cc8c8b67ed48badd1f59f684d5d02884c819063fa09e63090602401602060405180830381600087803b15801561069857600080fd5b505af11580156106ac573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032a9190611989565b6000816001600160a01b0381166106f95760405162461bcd60e51b81526004016102879061195f565b600061070786600030610f36565b90506107138186611229565b6040516370a0823160e01b815230600482015260009073dac17f958d2ee523a2206206994597c13d831ec7906370a082319060240160206040518083038186803b15801561076057600080fd5b505afa158015610774573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107989190611989565b90506107b973dac17f958d2ee523a2206206994597c13d831ec786836112a0565b9695505050505050565b806001600160a01b0381166107ea5760405162461bcd60e51b81526004016102879061195f565b6001600160a01b0384166107fd57600080fd5b6108126001600160a01b038416333089611112565b604080516002808252606082018352600092602083019080368337019050509050838160008151811061084757610847611a0d565b60200260200101906001600160a01b031690816001600160a01b03168152505073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28160018151811061088f5761088f611a0d565b6001600160a01b0392831660209182029290920101526108b39085168660006112d0565b6108c76001600160a01b03851686896112d0565b6001600160a01b0385166318cbafe588600184306108e54284611a23565b6040518663ffffffff1660e01b8152600401610905959493929190611a8d565b600060405180830381600087803b15801561091f57600080fd5b505af1158015610933573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261095b9190810190611ac9565b506109674787856110f8565b50505050505050565b806001600160a01b0381166109975760405162461bcd60e51b81526004016102879061195f565b6001600160a01b0384166109aa57600080fd5b6109b58660006113f4565b5060408051600280825260608201835260009260208301908036833701905050905073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2816000815181106109ff576109ff611a0d565b60200260200101906001600160a01b031690816001600160a01b0316815250508381600181518110610a3357610a33611a0d565b6001600160a01b0392831660209182029290920101528516637ff36ab547888487610a5f426001611a23565b6040518663ffffffff1660e01b8152600401610a7e9493929190611b87565b6000604051808303818588803b158015610a9757600080fd5b505af1158015610aab573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f19168201604052610ad49190810190611ac9565b5050505050505050565b610b1273d533a949740bb3306d119cc777fa900ba034cd52738301ae4fc9c624d1d396cbdaa1ed877821d7c51160006112d0565b610b4773d533a949740bb3306d119cc777fa900ba034cd52738301ae4fc9c624d1d396cbdaa1ed877821d7c5116000196112d0565b610b7b7362b9c7356a2dc64a1969e19c23e4f579f9810aa7733fe65692bfcd0e6cf84cb1e7d24108e434a7587e60006112d0565b610bb07362b9c7356a2dc64a1969e19c23e4f579f9810aa7733fe65692bfcd0e6cf84cb1e7d24108e434a7587e6000196112d0565b610be47362b9c7356a2dc64a1969e19c23e4f579f9810aa7739d0464996170c6b9e75eed71c68b99ddedf279e860006112d0565b610c197362b9c7356a2dc64a1969e19c23e4f579f9810aa7739d0464996170c6b9e75eed71c68b99ddedf279e86000196112d0565b610c4d73d533a949740bb3306d119cc777fa900ba034cd52739d0464996170c6b9e75eed71c68b99ddedf279e860006112d0565b610c8273d533a949740bb3306d119cc777fa900ba034cd52739d0464996170c6b9e75eed71c68b99ddedf279e86000196112d0565b610cb6736c3f90f043a72fa612cbac8115ee7e52bde6e49073f403c135812408bfbe8713b5a23a04b3d48aae3160006112d0565b610ceb736c3f90f043a72fa612cbac8115ee7e52bde6e49073f403c135812408bfbe8713b5a23a04b3d48aae316000196112d0565b610d1f73dac17f958d2ee523a2206206994597c13d831ec773bebc44782c7db0a1a60cb6fe97d0b483032ff1c760006112d0565b610d5473dac17f958d2ee523a2206206994597c13d831ec773bebc44782c7db0a1a60cb6fe97d0b483032ff1c76000196112d0565b610d887330d9410ed1d5da1f6c8391af5338c93ab8d4035c73689440f2ff927e1f24c72f1087e1faf471ece1c860006112d0565b610dbd7330d9410ed1d5da1f6c8391af5338c93ab8d4035c73689440f2ff927e1f24c72f1087e1faf471ece1c86000196112d0565b610dfd7362b9c7356a2dc64a1969e19c23e4f579f9810aa77f000000000000000000000000000000000000000000000000000000000000000060006112d0565b610e3e7362b9c7356a2dc64a1969e19c23e4f579f9810aa77f00000000000000000000000000000000000000000000000000000000000000006000196112d0565b610e72734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b7372a19342e8f1838460ebfccef09f6585e32db86e60006112d0565b610ea7734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b7372a19342e8f1838460ebfccef09f6585e32db86e6000196112d0565b610edb73d533a949740bb3306d119cc777fa900ba034cd52738301ae4fc9c624d1d396cbdaa1ed877821d7c51160006112d0565b610f1073d533a949740bb3306d119cc777fa900ba034cd52738301ae4fc9c624d1d396cbdaa1ed877821d7c5116000196112d0565b565b600080610f1e8561140f565b9050610f2b8184866114e5565b9150505b9392505050565b6000816001600160a01b038116610f5f5760405162461bcd60e51b81526004016102879061195f565b6000610f6b86866113f4565b90506000846001600160a01b03168260405160006040518083038185875af1925050503d8060008114610fba576040519150601f19603f3d011682016040523d82523d6000602084013e610fbf565b606091505b50509050806110065760405162461bcd60e51b8152602060048201526013602482015272115512081d1c985b9cd9995c8819985a5b1959606a1b6044820152606401610287565b5095945050505050565b6000826001600160a01b0381166110395760405162461bcd60e51b81526004016102879061195f565b60006110468760006113f4565b905060006110548288611535565b905084156110ce5760075460405163e2ab691d60e01b81526001600160a01b03888116600483015260248201849052600060448301529091169063e2ab691d90606401600060405180830381600087803b1580156110b157600080fd5b505af11580156110c5573d6000803e3d6000fd5b505050506110ed565b6110ed734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b87836112a0565b979650505050505050565b60006111058460006115cc565b905061032a813085611183565b6040516001600160a01b038085166024830152831660448201526064810182905261117d9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611618565b50505050565b60055460405163ddc1f59d60e01b81526000600482018190526001602483015260448201869052606482018490526001600160a01b0385811660848401529092169063ddc1f59d9060a4015b602060405180830381600087803b1580156111e957600080fd5b505af11580156111fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112219190611989565b949350505050565b60065460405163394747c560e01b815260026004820152600060248201526044810184905260648101839052600160848201526001600160a01b039091169063394747c590849060a4016000604051808303818588803b15801561128c57600080fd5b505af1158015610967573d6000803e3d6000fd5b6040516001600160a01b0383166024820152604481018290526102d390849063a9059cbb60e01b90606401611146565b8015806113595750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561131f57600080fd5b505afa158015611333573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113579190611989565b155b6113c45760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610287565b6040516001600160a01b0383166024820152604481018290526102d390849063095ea7b360e01b90606401611146565b60008061140384600030610f12565b905061122181846116ea565b60006114466001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333085611112565b604051630fa09e6360e41b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063fa09e63090602401602060405180830381600087803b1580156114a757600080fd5b505af11580156114bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114df9190611989565b92915050565b60055460405163ddc1f59d60e01b81526001600482015260006024820181905260448201869052606482018490526001600160a01b0385811660848401529092169063ddc1f59d9060a4016111cf565b600080546040516365b2489b60e01b8152600481018390526001602482015260448101859052606481018490526001600160a01b03909116906365b2489b9085906084015b6020604051808303818588803b15801561159357600080fd5b505af11580156115a7573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f2f9190611989565b600180546040516365b2489b60e01b8152600060048201819052602482019390935260448101859052606481018490526001600160a01b03909116906365b2489b90859060840161157a565b600061166d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166117379092919063ffffffff16565b8051909150156102d3578080602001905181019061168b91906119da565b6102d35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610287565b600180546040516365b2489b60e01b815260048101929092526000602483018190526044830185905260648301849052916001600160a01b03909116906365b2489b90839060840161157a565b6060611221848460008585843b6117905760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610287565b600080866001600160a01b031685876040516117ac9190611be8565b60006040518083038185875af1925050503d80600081146117e9576040519150601f19603f3d011682016040523d82523d6000602084013e6117ee565b606091505b50915091506110ed82828660608315611808575081610f2f565b8251156118185782518084602001fd5b8160405162461bcd60e51b81526004016102879190611c04565b80356001600160a01b038116811461184957600080fd5b919050565b6000806040838503121561186157600080fd5b8235915061187160208401611832565b90509250929050565b60008060006060848603121561188f57600080fd5b83359250602084013591506118a660408501611832565b90509250925092565b600080600080600060a086880312156118c757600080fd5b85359450602086013593506118de60408701611832565b92506118ec60608701611832565b91506118fa60808701611832565b90509295509295909350565b801515811461191457600080fd5b50565b6000806000806080858703121561192d57600080fd5b843593506020850135925061194460408601611832565b9150606085013561195481611906565b939692955090935050565b60208082526010908201526f496e76616c696420616464726573732160801b604082015260600190565b60006020828403121561199b57600080fd5b5051919050565b60808101818460005b60038110156119ca5781518352602092830192909101906001016119ab565b5050508260608301529392505050565b6000602082840312156119ec57600080fd5b8151610f2f81611906565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008219821115611a4457634e487b7160e01b600052601160045260246000fd5b500190565b600081518084526020808501945080840160005b83811015611a825781516001600160a01b031687529582019590820190600101611a5d565b509495945050505050565b85815284602082015260a060408201526000611aac60a0830186611a49565b6001600160a01b0394909416606083015250608001529392505050565b60006020808385031215611adc57600080fd5b825167ffffffffffffffff80821115611af457600080fd5b818501915085601f830112611b0857600080fd5b815181811115611b1a57611b1a6119f7565b8060051b604051601f19603f83011681018181108582111715611b3f57611b3f6119f7565b604052918252848201925083810185019188831115611b5d57600080fd5b938501935b82851015611b7b57845184529385019392850192611b62565b98975050505050505050565b848152608060208201526000611ba06080830186611a49565b6001600160a01b03949094166040830152506060015292915050565b60005b83811015611bd7578181015183820152602001611bbf565b8381111561117d5750506000910152565b60008251611bfa818460208701611bbc565b9190910192915050565b6020815260008251806020840152611c23816040850160208701611bbc565b601f01601f1916919091016040019291505056fea264697066735822122049c9f25f90f6931ba7985decebc65a93f9803ad90df83d5be821bbc9685b5b1c64736f6c634300080900330000000000000000000000004ebad8dbd4edbd74db0278714fbd67ebc76b89b7

Deployed Bytecode

0x6080604052600436106100ab5760003560e01c80638702ca5c116100645780638702ca5c1461017f5780638757b15b1461019f578063a8d9693d146101b4578063dbc199d7146101d4578063f3bb2ca1146101f4578063fbfa77cf1461021457600080fd5b806326600ecb146100b757806331247e06146100cc57806343a7887e146100ec57806377212cf31461010c578063775491dc1461012c57806379e8aeeb1461015f57600080fd5b366100b257005b600080fd5b6100ca6100c536600461184e565b610260565b005b3480156100d857600080fd5b506100ca6100e736600461187a565b6102d8565b3480156100f857600080fd5b506100ca61010736600461187a565b6103cd565b34801561011857600080fd5b506100ca61012736600461187a565b610605565b34801561013857600080fd5b5061014c61014736600461187a565b6106d0565b6040519081526020015b60405180910390f35b34801561016b57600080fd5b506100ca61017a3660046118af565b6107c3565b34801561018b57600080fd5b506100ca61019a3660046118af565b610970565b3480156101ab57600080fd5b506100ca610ade565b3480156101c057600080fd5b5061014c6101cf36600461187a565b610f12565b3480156101e057600080fd5b5061014c6101ef36600461187a565b610f36565b34801561020057600080fd5b5061014c61020f366004611917565b611010565b34801561022057600080fd5b506102487f0000000000000000000000004ebad8dbd4edbd74db0278714fbd67ebc76b89b781565b6040516001600160a01b039091168152602001610156565b806001600160a01b0381166102905760405162461bcd60e51b81526004016102879061195f565b60405180910390fd5b600034116102c85760405162461bcd60e51b8152602060048201526005602482015264063686561760dc1b6044820152606401610287565b6102d33484846110f8565b505050565b806001600160a01b0381166102ff5760405162461bcd60e51b81526004016102879061195f565b61031f73d533a949740bb3306d119cc777fa900ba034cd52333087611112565b61032a843085611183565b50604051639f0d5f2760e01b81526001600160a01b0383811660048301527f0000000000000000000000004ebad8dbd4edbd74db0278714fbd67ebc76b89b71690639f0d5f2790602401602060405180830381600087803b15801561038e57600080fd5b505af11580156103a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c69190611989565b5050505050565b806001600160a01b0381166103f45760405162461bcd60e51b81526004016102879061195f565b6000610402856000306106d0565b60025460408051606081018252600080825260208201528082018490529051634515cef360e01b81529293506001600160a01b0390911691634515cef39161044e9188906004016119a2565b600060405180830381600087803b15801561046857600080fd5b505af115801561047c573d6000803e3d6000fd5b505060035460405163303acfe760e11b815260096004820152600060248201526001600160a01b0390911692506360759fce9150604401602060405180830381600087803b1580156104cd57600080fd5b505af11580156104e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050591906119da565b50600480546040516370a0823160e01b815230928101929092526001600160a01b031690632ee409089085907330d9410ed1d5da1f6c8391af5338c93ab8d4035c906370a082319060240160206040518083038186803b15801561056857600080fd5b505afa15801561057c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a09190611989565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b1580156105e657600080fd5b505af11580156105fa573d6000803e3d6000fd5b505050505050505050565b806001600160a01b03811661062c5760405162461bcd60e51b81526004016102879061195f565b61064c7383507cc8c8b67ed48badd1f59f684d5d02884c81333087611112565b604051630fa09e6360e41b81523060048201527383507cc8c8b67ed48badd1f59f684d5d02884c819063fa09e63090602401602060405180830381600087803b15801561069857600080fd5b505af11580156106ac573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032a9190611989565b6000816001600160a01b0381166106f95760405162461bcd60e51b81526004016102879061195f565b600061070786600030610f36565b90506107138186611229565b6040516370a0823160e01b815230600482015260009073dac17f958d2ee523a2206206994597c13d831ec7906370a082319060240160206040518083038186803b15801561076057600080fd5b505afa158015610774573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107989190611989565b90506107b973dac17f958d2ee523a2206206994597c13d831ec786836112a0565b9695505050505050565b806001600160a01b0381166107ea5760405162461bcd60e51b81526004016102879061195f565b6001600160a01b0384166107fd57600080fd5b6108126001600160a01b038416333089611112565b604080516002808252606082018352600092602083019080368337019050509050838160008151811061084757610847611a0d565b60200260200101906001600160a01b031690816001600160a01b03168152505073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28160018151811061088f5761088f611a0d565b6001600160a01b0392831660209182029290920101526108b39085168660006112d0565b6108c76001600160a01b03851686896112d0565b6001600160a01b0385166318cbafe588600184306108e54284611a23565b6040518663ffffffff1660e01b8152600401610905959493929190611a8d565b600060405180830381600087803b15801561091f57600080fd5b505af1158015610933573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261095b9190810190611ac9565b506109674787856110f8565b50505050505050565b806001600160a01b0381166109975760405162461bcd60e51b81526004016102879061195f565b6001600160a01b0384166109aa57600080fd5b6109b58660006113f4565b5060408051600280825260608201835260009260208301908036833701905050905073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2816000815181106109ff576109ff611a0d565b60200260200101906001600160a01b031690816001600160a01b0316815250508381600181518110610a3357610a33611a0d565b6001600160a01b0392831660209182029290920101528516637ff36ab547888487610a5f426001611a23565b6040518663ffffffff1660e01b8152600401610a7e9493929190611b87565b6000604051808303818588803b158015610a9757600080fd5b505af1158015610aab573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f19168201604052610ad49190810190611ac9565b5050505050505050565b610b1273d533a949740bb3306d119cc777fa900ba034cd52738301ae4fc9c624d1d396cbdaa1ed877821d7c51160006112d0565b610b4773d533a949740bb3306d119cc777fa900ba034cd52738301ae4fc9c624d1d396cbdaa1ed877821d7c5116000196112d0565b610b7b7362b9c7356a2dc64a1969e19c23e4f579f9810aa7733fe65692bfcd0e6cf84cb1e7d24108e434a7587e60006112d0565b610bb07362b9c7356a2dc64a1969e19c23e4f579f9810aa7733fe65692bfcd0e6cf84cb1e7d24108e434a7587e6000196112d0565b610be47362b9c7356a2dc64a1969e19c23e4f579f9810aa7739d0464996170c6b9e75eed71c68b99ddedf279e860006112d0565b610c197362b9c7356a2dc64a1969e19c23e4f579f9810aa7739d0464996170c6b9e75eed71c68b99ddedf279e86000196112d0565b610c4d73d533a949740bb3306d119cc777fa900ba034cd52739d0464996170c6b9e75eed71c68b99ddedf279e860006112d0565b610c8273d533a949740bb3306d119cc777fa900ba034cd52739d0464996170c6b9e75eed71c68b99ddedf279e86000196112d0565b610cb6736c3f90f043a72fa612cbac8115ee7e52bde6e49073f403c135812408bfbe8713b5a23a04b3d48aae3160006112d0565b610ceb736c3f90f043a72fa612cbac8115ee7e52bde6e49073f403c135812408bfbe8713b5a23a04b3d48aae316000196112d0565b610d1f73dac17f958d2ee523a2206206994597c13d831ec773bebc44782c7db0a1a60cb6fe97d0b483032ff1c760006112d0565b610d5473dac17f958d2ee523a2206206994597c13d831ec773bebc44782c7db0a1a60cb6fe97d0b483032ff1c76000196112d0565b610d887330d9410ed1d5da1f6c8391af5338c93ab8d4035c73689440f2ff927e1f24c72f1087e1faf471ece1c860006112d0565b610dbd7330d9410ed1d5da1f6c8391af5338c93ab8d4035c73689440f2ff927e1f24c72f1087e1faf471ece1c86000196112d0565b610dfd7362b9c7356a2dc64a1969e19c23e4f579f9810aa77f0000000000000000000000004ebad8dbd4edbd74db0278714fbd67ebc76b89b760006112d0565b610e3e7362b9c7356a2dc64a1969e19c23e4f579f9810aa77f0000000000000000000000004ebad8dbd4edbd74db0278714fbd67ebc76b89b76000196112d0565b610e72734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b7372a19342e8f1838460ebfccef09f6585e32db86e60006112d0565b610ea7734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b7372a19342e8f1838460ebfccef09f6585e32db86e6000196112d0565b610edb73d533a949740bb3306d119cc777fa900ba034cd52738301ae4fc9c624d1d396cbdaa1ed877821d7c51160006112d0565b610f1073d533a949740bb3306d119cc777fa900ba034cd52738301ae4fc9c624d1d396cbdaa1ed877821d7c5116000196112d0565b565b600080610f1e8561140f565b9050610f2b8184866114e5565b9150505b9392505050565b6000816001600160a01b038116610f5f5760405162461bcd60e51b81526004016102879061195f565b6000610f6b86866113f4565b90506000846001600160a01b03168260405160006040518083038185875af1925050503d8060008114610fba576040519150601f19603f3d011682016040523d82523d6000602084013e610fbf565b606091505b50509050806110065760405162461bcd60e51b8152602060048201526013602482015272115512081d1c985b9cd9995c8819985a5b1959606a1b6044820152606401610287565b5095945050505050565b6000826001600160a01b0381166110395760405162461bcd60e51b81526004016102879061195f565b60006110468760006113f4565b905060006110548288611535565b905084156110ce5760075460405163e2ab691d60e01b81526001600160a01b03888116600483015260248201849052600060448301529091169063e2ab691d90606401600060405180830381600087803b1580156110b157600080fd5b505af11580156110c5573d6000803e3d6000fd5b505050506110ed565b6110ed734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b87836112a0565b979650505050505050565b60006111058460006115cc565b905061032a813085611183565b6040516001600160a01b038085166024830152831660448201526064810182905261117d9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611618565b50505050565b60055460405163ddc1f59d60e01b81526000600482018190526001602483015260448201869052606482018490526001600160a01b0385811660848401529092169063ddc1f59d9060a4015b602060405180830381600087803b1580156111e957600080fd5b505af11580156111fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112219190611989565b949350505050565b60065460405163394747c560e01b815260026004820152600060248201526044810184905260648101839052600160848201526001600160a01b039091169063394747c590849060a4016000604051808303818588803b15801561128c57600080fd5b505af1158015610967573d6000803e3d6000fd5b6040516001600160a01b0383166024820152604481018290526102d390849063a9059cbb60e01b90606401611146565b8015806113595750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561131f57600080fd5b505afa158015611333573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113579190611989565b155b6113c45760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610287565b6040516001600160a01b0383166024820152604481018290526102d390849063095ea7b360e01b90606401611146565b60008061140384600030610f12565b905061122181846116ea565b60006114466001600160a01b037f0000000000000000000000004ebad8dbd4edbd74db0278714fbd67ebc76b89b716333085611112565b604051630fa09e6360e41b81523060048201527f0000000000000000000000004ebad8dbd4edbd74db0278714fbd67ebc76b89b76001600160a01b03169063fa09e63090602401602060405180830381600087803b1580156114a757600080fd5b505af11580156114bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114df9190611989565b92915050565b60055460405163ddc1f59d60e01b81526001600482015260006024820181905260448201869052606482018490526001600160a01b0385811660848401529092169063ddc1f59d9060a4016111cf565b600080546040516365b2489b60e01b8152600481018390526001602482015260448101859052606481018490526001600160a01b03909116906365b2489b9085906084015b6020604051808303818588803b15801561159357600080fd5b505af11580156115a7573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f2f9190611989565b600180546040516365b2489b60e01b8152600060048201819052602482019390935260448101859052606481018490526001600160a01b03909116906365b2489b90859060840161157a565b600061166d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166117379092919063ffffffff16565b8051909150156102d3578080602001905181019061168b91906119da565b6102d35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610287565b600180546040516365b2489b60e01b815260048101929092526000602483018190526044830185905260648301849052916001600160a01b03909116906365b2489b90839060840161157a565b6060611221848460008585843b6117905760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610287565b600080866001600160a01b031685876040516117ac9190611be8565b60006040518083038185875af1925050503d80600081146117e9576040519150601f19603f3d011682016040523d82523d6000602084013e6117ee565b606091505b50915091506110ed82828660608315611808575081610f2f565b8251156118185782518084602001fd5b8160405162461bcd60e51b81526004016102879190611c04565b80356001600160a01b038116811461184957600080fd5b919050565b6000806040838503121561186157600080fd5b8235915061187160208401611832565b90509250929050565b60008060006060848603121561188f57600080fd5b83359250602084013591506118a660408501611832565b90509250925092565b600080600080600060a086880312156118c757600080fd5b85359450602086013593506118de60408701611832565b92506118ec60608701611832565b91506118fa60808701611832565b90509295509295909350565b801515811461191457600080fd5b50565b6000806000806080858703121561192d57600080fd5b843593506020850135925061194460408601611832565b9150606085013561195481611906565b939692955090935050565b60208082526010908201526f496e76616c696420616464726573732160801b604082015260600190565b60006020828403121561199b57600080fd5b5051919050565b60808101818460005b60038110156119ca5781518352602092830192909101906001016119ab565b5050508260608301529392505050565b6000602082840312156119ec57600080fd5b8151610f2f81611906565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008219821115611a4457634e487b7160e01b600052601160045260246000fd5b500190565b600081518084526020808501945080840160005b83811015611a825781516001600160a01b031687529582019590820190600101611a5d565b509495945050505050565b85815284602082015260a060408201526000611aac60a0830186611a49565b6001600160a01b0394909416606083015250608001529392505050565b60006020808385031215611adc57600080fd5b825167ffffffffffffffff80821115611af457600080fd5b818501915085601f830112611b0857600080fd5b815181811115611b1a57611b1a6119f7565b8060051b604051601f19603f83011681018181108582111715611b3f57611b3f6119f7565b604052918252848201925083810185019188831115611b5d57600080fd5b938501935b82851015611b7b57845184529385019392850192611b62565b98975050505050505050565b848152608060208201526000611ba06080830186611a49565b6001600160a01b03949094166040830152506060015292915050565b60005b83811015611bd7578181015183820152602001611bbf565b8381111561117d5750506000910152565b60008251611bfa818460208701611bbc565b9190910192915050565b6020815260008251806020840152611c23816040850160208701611bbc565b601f01601f1916919091016040019291505056fea264697066735822122049c9f25f90f6931ba7985decebc65a93f9803ad90df83d5be821bbc9685b5b1c64736f6c63430008090033

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

0000000000000000000000004ebad8dbd4edbd74db0278714fbd67ebc76b89b7

-----Decoded View---------------
Arg [0] : _vault (address): 0x4eBaD8DbD4EdBd74DB0278714FbD67eBc76B89B7

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000004ebad8dbd4edbd74db0278714fbd67ebc76b89b7


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.