Vault Intro

VaultWstETH

Contract: 0xE946Dd7d03F6F5C440F68c84808Ca88d26475FC5 The core asset is wstETH.

deposit

function deposit(uint256 _assets, address _receiver)
public
returns (uint256 shares_);

see IERC4626.sol

withdraw

function withdraw(uint256 _assets, address _receiver, address _owner)
public
returns (uint256 shares_);

see IERC4626.sol

mint

function mint(uint256 _shares, address _receiver)
public
returns (uint256 assets_);

see IERC4626.sol

redeem

function redeem(uint256 _shares, address _receiver, address _owner)
public
returns (uint256 assetsAfterFee_);

see IERC4626.sol

VaultWstETHWrapper

0xF2254b4dA1D68540b855e4D219AaC1EF0eDBA575

deposit

function deposit(uint256 _wethAmount, bytes calldata _swapCalldata, uint256 _minWstEthIn, address _receiver)
external
payable
returns (uint256 shares_);
  • @dev Invest initial assets into the vault using ETH or WETH.

  • @param _wethAmount The amount of WETH to be invested.Here, the sum of wethAmount and msg.value together constitute the amount that needs to be exchanged for wstETH. This is used to request exchange data from 1inch with calldata, where srcToken is 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE and dstToken is 0x5979D7b546E38E414F7E9822514be443A4800529.

  • @param _swapCalldata The calldata for the 1inch exchange operation.

  • @param _minWstEthIn The minimum amount of token to be obtained during the 1inch exchange operation.

  • @param _receiver The recipient of the share tokens.

  • @return shares_ The amount of share tokens obtained.

withdraw

function withdraw(
uint256 _amount,
bytes calldata _swapCalldata,
uint256 _minEthOut,
address _receiver,
bool _isWeth
) external returns (uint256 returnEthAmount_);
  • @dev Withdraw native assets ETH or WETH from the vault.

  • @param _amount The amount of wstETH to be withdrawn from the vault.

  • @param _swapCalldata The calldata for the 1inch exchange operation.The calldata used to request an exchange from 1inch, where srcToken is 0x5979D7b546E38E414F7E9822514be443A4800529, and dstToken is 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE.The src amount consumed is VaultWstETHWrapper.getWithdrawSwapAmount(_amount),because the vault's withdrawal fee needs to be deducted.

  • @param _minEthOut The minimum amount of token to be obtained during the exchange.

  • @param _receiver The recipient of the redeemed assets.

  • @param _isWeth Whether to redeem the assets in the form of WETH.Regardless of whether the asset requested for redemption is WETH or ETH, use the address of ETH as the dstToken when requesting from 1inch.

  • @return returnEthAmount_ The actual amount of ETH(WETH) redeemed.

Last updated