Wrap or unwrap
Wrap or unwrap

Ethereum Virtual Machine · Acts onchain

Wraps native ETH into WETH, or unwraps WETH back to native ETH, on the current chain. Wrap sends the amount by value to the chain's wrapped native contract; unwrap calls its withdraw. Both are one-to-one with no fee. Reach for it before a step that takes only the ERC-20 form, such as a Uniswap V2 pair or a lending market, or after one that pays out WETH when the next step needs native ETH.

Unwrap WETH to ETH

plug
evm
2actions
  1. 1·Take

    Take declares a named parameter called amount whose value the caller supplies when they run the plug, so the quantity is not fixed here but chosen at execution.

  2. 2·Wrap or unwrap

    Reading [the value in slot "0.0"], the unwrap action converts that amount of WETH at 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 into native ETH at 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE, wired to the caller-supplied amount from the prior step.

Take
to
  • Unwrap WETH to ETH

    plug
    evm
  • Wrap ETH to WETH

    plug
    evm

On other protocols · 3