
Weth Wrap Unwrap
Wrap native gas tokens (ETH/MATIC) into ERC-20 equivalents (WETH/WMATIC) or unwrap back.
CategoryDeFiUtility
ChainsBASE_ETHETHMATICSETH
C
Cobo· Author
100 views·8 uses
Overview
Wrap native gas tokens (ETH/MATIC) into ERC-20 equivalents (WETH/WMATIC) or unwrap back.
Facts
•weth9 (ETH):
0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2•weth9 (BASE_ETH):
0x4200000000000000000000000000000000000006•weth9 (SETH):
0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14•wmatic (MATIC):
0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270•weth (MATIC, bridged ERC-20):
0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619 — no deposit/withdraw; obtain via bridge only•selector
deposit(): 0xd0e30db0•selector
withdraw(uint256): 0x2e1a7d4d•target_in: weth9 / wmatic contract only
Functions:
solidity
function deposit() external payable;function withdraw(uint256 wad) external;function approve(address guy, uint256 wad) external returns (bool);
Typical Flows
### Wrap — 1 tx
Send native ETH (or MATIC) directly to deposit() with a value:
text
tx.to = weth9_addresstx.value = amount_in_wei # e.g., 1e18 for 1 ETHtx.data = 0xd0e30db0 # deposit() selector, no args
### Unwrap — 1 tx
Call withdraw(wad) to receive native ETH back:
text
tx.to = weth9_addresstx.data = 0x2e1a7d4d| 0x{wad_32B} # amount to unwrap in wei
### Typical DeFi setup flow (wrap → approve → protocol)
1.
deposit() on WETH9 with value = amount — wrap ETH into WETH2.
approve(protocol_contract, amount) on WETH9 — grant protocol spend allowance3.Call the protocol (e.g., Uniswap
exactInputSingle, Aave supply, etc.)Policy Controls
•No approve step for wrap:
deposit() takes ETH as msg.value — no prior ERC-20 approve is needed.•Bridged WETH on Polygon is NOT wrappable:
0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619 is an ERC-20 bridged from Ethereum — deposit() on it does not work. Use the Polygon bridge to obtain it.•WMATIC ≠ WETH: On MATIC,
deposit()/withdraw() on WMATIC wraps the native gas token MATIC, not ETH.•Do not send ETH directly to the contract address: always call
deposit() with calldata 0xd0e30db0; some WETH9 deployments have a fallback that calls deposit(), but relying on it is not safe.•Not applicable for: cross-chain bridging of ETH — use
bridge-wormhole or bridge-layerzero; liquid staking (ETH → stETH/cbETH) — use dedicated staking protocols•Testnet: No real value; SETH tokens are worthless.
•Partial reference: use web search for unlisted tokens, contracts, parameters, or up-to-date addresses
References
•Docs:
https://ethereum.org/llms.txt — WETH9 contract ABI, Ethereum EVM spec, ERC-20 standard, WETH9 contract patterns.