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.
Copy function authorizeProtocol (
address uTokenVault
) external onlyOwner Authorizes the Unlockd Protocol to interact with the WETH contract.
Parameters:
uTokenVault: The address of the UTokenVault contract.
Copy function depositETH ( address onBehalfOf) external payable override Deposits ETH and mints corresponding WETH tokens.
onBehalfOf: The address to deposit ETH on behalf of.
Copy function withdrawETH ( uint256 amount , address to) external override Withdraws WETH tokens and receives ETH.
amount: The amount of WETH to withdraw.
to: The address to receive the withdrawn ETH.
Performs an emergency transfer of ERC20 tokens.
token: The address of the token to transfer.
to: The recipient address of the token transfer.
amount: The amount of tokens to transfer.
Performs an emergency transfer of ETH.
to: The recipient address of the ETH transfer.
amount: The amount of ETH to transfer.
Returns the address of the WETH contract.