# WethGateway

`WETHGateway.sol` is a contract that serves as a gateway for wrapping and unwrapping ETH and interacting with WETH (Wrapped ETH) within the Unlockd Protocol.

### Key functions:

<pre class="language-solidity"><code class="lang-solidity"><strong>function authorizeProtocol(
</strong>    address uTokenVault
) external onlyOwner
</code></pre>

Authorizes the Unlockd Protocol to interact with the WETH contract.

Parameters:

`uTokenVault`: The address of the UTokenVault contract.

***

```solidity
function depositETH(address onBehalfOf) external payable override
```

Deposits ETH and mints corresponding WETH tokens.

### Parameters:

`onBehalfOf`: The address to deposit ETH on behalf of.

***

```solidity
function withdrawETH(uint256 amount, address to) external override
```

Withdraws WETH tokens and receives ETH.

### Parameters:

`amount`: The amount of WETH to withdraw.

`to`: The address to receive the withdrawn ETH.

***

```solidity
function emergencyTokenTransfer(
    address token, 
    address to, 
    uint256 amount
) external onlyOwner
```

Performs an emergency transfer of ERC20 tokens.

### Parameters:

`token`: The address of the token to transfer.

`to`: The recipient address of the token transfer.

`amount`: The amount of tokens to transfer.

***

```solidity
function emergencyEtherTransfer(
    address to, 
    uint256 amount
) external onlyOwner
```

Performs an emergency transfer of ETH.

### Parameters:

`to`: The recipient address of the ETH transfer.

`amount`: The amount of ETH to transfer.

***

<pre class="language-solidity"><code class="lang-solidity"><strong>function getWETHAddress() external view returns (address)
</strong></code></pre>

Returns the address of the WETH contract.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://devs.unlockd.finance/vault-and-tokens/wethgateway.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
