> For the complete documentation index, see [llms.txt](https://alchemix-finance.gitbook.io/v2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alchemix-finance.gitbook.io/v2/wethgatewaycover/wethgateway.md).

# Functions

## constructor

```solidity
    function constructor() public;
```

## receive

```solidity
    function receive() external;
```

Allows for payments from the WETH contract.

## refreshAllowance

```solidity
    function refreshAllowance(address alchemist) external;
```

Refreshes the wrapped ethereum ERC20 approval for an alchemist contract.

### Parameters:

| Name        | Type    | Description                                                |
| ----------- | ------- | ---------------------------------------------------------- |
| `alchemist` | address | The address of the alchemist to refresh the allowance for. |

## depositUnderlying

```solidity
    function depositUnderlying(
        address alchemist,
        address yieldToken,
        uint256 amount,
        address recipient,
        uint256 minimumAmountOut
    ) external;
```

Takes ethereum, converts it to wrapped ethereum, and then deposits it into an alchemist.

See [IAlchemistV2Actions.depositUnderlying](https://github.com/alchemix-finance/v2-documentation/blob/master/docs/pages/alchemist/IAlchemistV2Actions.md#depositunderlying) for more details.

### Parameters:

| Name               | Type    | Description                                                                          |
| ------------------ | ------- | ------------------------------------------------------------------------------------ |
| `alchemist`        | address | The address of the alchemist to deposit wrapped ethereum into.                       |
| `yieldToken`       | address | The yield token to deposit the wrapped ethereum as.                                  |
| `amount`           | uint256 | The amount of ethereum to deposit.                                                   |
| `recipient`        | address | The address which will receive the deposited yield tokens.                           |
| `minimumAmountOut` | uint256 | The minimum amount of yield tokens that are expected to be deposited to `recipient`. |

## withdrawUnderlying

```solidity
    function withdrawUnderlying(
        address alchemist,
        address yieldToken,
        uint256 shares,
        address recipient,
        uint256 minimumAmountOut
    ) external;
```

Withdraws a wrapped ethereum based yield token from an alchemist, converts it to ethereum, and then transfers it to the recipient.

A withdraw approval on the alchemist is required for this call to succeed.

See [IAlchemistV2Actions.withdrawUnderlying](https://github.com/alchemix-finance/v2-documentation/blob/master/docs/pages/alchemist/IAlchemistV2Actions.md#withdrawunderlying) for more details.

### Parameters:

| Name               | Type    | Description                                                                               |
| ------------------ | ------- | ----------------------------------------------------------------------------------------- |
| `alchemist`        | address | The address of the alchemist to withdraw wrapped ethereum from.                           |
| `yieldToken`       | address | The address of the yield token to withdraw.                                               |
| `shares`           | uint256 | The amount of shares to withdraw.                                                         |
| `recipient`        | address | The address which will receive the ethereum.                                              |
| `minimumAmountOut` | uint256 | The minimum amount of underlying tokens that are expected to be withdrawn to `recipient`. |

## \_onlyWhitelisted

```solidity
    function _onlyWhitelisted() internal;
```

Checks the whitelist for msg.sender.

Reverts if msg.sender is not in the whitelist.
