Skip to content

Commit 4e8a248

Browse files
authored
Merge pull request #8203 from emmanuel-awosika/patch-34
Add Learn page on Wrapped Ether (WETH)
2 parents c7007d7 + 718399c commit 4e8a248

File tree

11 files changed

+86
-4
lines changed

11 files changed

+86
-4
lines changed

public/content/defi/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ You can think of DeFi in layers:
324324
3. The protocols – [smart contracts](/glossary/#smart-contract) that provide the functionality, for example, a service that allows for decentralized lending of assets.
325325
4. [The applications](/dapps/) – the products we use to manage and access the protocols.
326326

327+
Note: much of DeFi uses the [ERC-20 standard](/glossary/#erc-20). Applications in DeFi use a wrapper for ETH called Wrapped Ether (WETH). [Learn more about wrapped ether](/wrapped-eth).
328+
327329
## Build DeFi {#build-defi}
328330

329331
DeFi is an open-source movement. The DeFi protocols and applications are all open for you to inspect, fork, and innovate on. Because of this layered stack (they all share the same base blockchain and assets), protocols can be mixed and matched to unlock unique combo opportunities.

public/content/developers/docs/standards/tokens/erc-20/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ Tokens can represent virtually anything in Ethereum:
1212

1313
- reputation points in an online platform
1414
- skills of a character in a game
15-
- lottery tickets
1615
- financial assets like a share in a company
1716
- a fiat currency like USD
1817
- an ounce of gold
1918
- and more...
2019

2120
Such a powerful feature of Ethereum must be handled by a robust standard, right? That's exactly
22-
where the ERC-20 plays its role! This standard allows developers to build token applications that are interoperable with other products and services.
21+
where the ERC-20 plays its role! This standard allows developers to build token applications that are interoperable with other products and services. The ERC-20 standard is also used to provide additional functionality to [ether](/glossary/#ether).
2322

2423
**What is ERC-20?**
2524

public/content/wrapped-eth/index.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
title: What is Wrapped Ether (WETH)
3+
description: An introduction to Wrapped ether (WETH)—an ERC20-compatible wrapper for ether (ETH).
4+
lang: en
5+
---
6+
7+
# Wrapped ether (WETH) {#intro-to-weth}
8+
9+
Ether (ETH) is the main currency of Ethereum. It's used for several purposes like staking, as a currency, and paying for gas fees for computation. **WETH is effectively an upgraded form of ETH with some additional functionality required by many applications and [ERC-20 tokens](/glossary/#erc-20)**, which are other types of digital assets on Ethereum. To work with these tokens, ETH must follow the same rules they do, known as the ERC-20 standard.
10+
11+
To bridge this gap, wrapped ETH (WETH) was created. **Wrapped ETH is a smart contract that lets you deposit any amount of ETH into the contract and receive the same amount in minted WETH** that conforms to the ERC-20 token standard. WETH is a representation of ETH that allows you to interact with it as an ERC-20 token, not as the native asset ETH. You will still need native ETH to pay for gas fees, so make sure you save some when depositing.
12+
13+
You are able to unwrap WETH for ETH by using the WETH smart contract. You can redeem any amount of WETH with the WETH smart contract, and you will receive the same amount in ETH. The WETH deposited is then burned and taken out of the circulating supply of WETH.
14+
15+
**Roughly ~3% of the circulating ETH supply is locked in the WETH token contract** making it one of the most used [smart contracts](/glossary/#smart-contract). WETH is especially important with users interacting with applications in decentralized finance (DeFi).
16+
17+
## Why do we need to wrap ETH as an ERC-20? {#why-do-we-need-to-wrap-eth}
18+
19+
[ERC-20](/developers/docs/standards/tokens/erc-20/) defines a standard interface for transferable tokens, so anyone can create tokens that interact seamlessly with applications and tokens that use this standard in Ethereum's ecosystem. Since **ETH predates the ERC-20 standard**, ETH doesn't conform to this specification. This means **you can't easily** exchange ETH for other ERC-20 tokens or **use ETH in apps using the ERC-20 standard**. Wrapping ETH gives you the opportunity to do the following:
20+
21+
- **Exchange ETH for ERC-20 tokens**: You cannot exchange ETH directly for other ERC-20 tokens. WETH is a representation of ether that complies with the ERC-20 fungible token standard and can be exchanged with other ERC-20 tokens.
22+
23+
- **Use ETH in dapps**: Because ETH isn’t ERC20-compatible, developers would need to create separate interfaces (one for ETH and another for ERC-20 tokens) in dapps. Wrapping ETH removes this obstacle and enables developers to handle ETH and other tokens within the same dapp. Many decentralized finance applications use this standard, and create markets for exchanging these tokens.
24+
25+
## Wrapped ether (WETH) vs ether (ETH): What is the difference? {#weth-vs-eth-differences}
26+
27+
28+
| | **Ether (ETH)** | **Wrapped Ether (WETH)** |
29+
|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
30+
| Supply | The supply of ETH is managed by the Ethereum protocol. The [issuance](/roadmap/merge/issuance) of ETH is handled by Ethereum validators when processing transactions and creating blocks. | WETH is an ERC-20 token whose supply is managed by a smart contract. New units of WETH are issued by the contract after it receives ETH deposits from users, or units of WETH are burned when a user wishes to redeem WETH for ETH. |
31+
| Ownership | Ownership is managed by the Ethereum protocol through your account balance. | Ownership of WETH is managed by the WETH token smart contract, secured by the Ethereum protocol. |
32+
| Gas | Ether (ETH) is the accepted unit of payment for computation on the Ethereum network. Gas fees are denominated in gwei (a unit of ether). | Paying gas with WETH tokens is not natively supported. |
33+
34+
## Frequently asked questions {#faq}
35+
36+
<ExpandableCard title="Do you pay to wrap/unwrap ETH?" eventCategory="/wrapped-eth" eventName="clicked Do you pay to wrap/unwrap ETH?">
37+
38+
You pay gas fees to wrap or unwrap ETH using the WETH contract.
39+
40+
</ExpandableCard>
41+
42+
<ExpandableCard title="Is WETH safe?" eventCategory="/wrapped-eth" eventName="clicked Is WETH safe?">
43+
44+
WETH is generally considered secure because it is based on a simple, battle-tested smart contract. The WETH contract has also beeen formally verified, which is the highest security standard for smart contracts on Ethereum.
45+
46+
</ExpandableCard>
47+
48+
<ExpandableCard title="Why am I seeing different WETH tokens?" eventCategory="/wrapped-eth" eventName="clicked Why am I seeing different WETH tokens?">
49+
50+
Besides the [canonical implementation of WETH](https://etherscan.io/token/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) described on this page, there are other variants in the wild. These may be custom tokens created by app developers or versions issued on other blockchains, and may behave differently or have different security properties. **Always double-check the token information to know which WETH implementation you're interacting with.**
51+
52+
</ExpandableCard>
53+
54+
<ExpandableCard title="What are the WETH contracts on other networks?" eventCategory="/wrapped-eth" eventName="clicked What are the WETH contracts on other networks?">
55+
56+
- [Ethereum Mainnet](https://etherscan.io/token/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2)
57+
- [Arbitrum](https://arbiscan.io/token/0x82af49447d8a07e3bd95bd0d56f35241523fbab1)
58+
- [Optimism](https://optimistic.etherscan.io/token/0x4200000000000000000000000000000000000006)
59+
60+
</ExpandableCard>
61+
62+
## Further reading {#further-reading}
63+
64+
- [WTF is WETH?](https://weth.io/)
65+
- [WETH token information on Etherscan](https://etherscan.io/token/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2)
66+
- [Formal Verification of WETH](https://zellic.io/blog/formal-verification-weth)

src/intl/en/common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@
417417
"what-is-ether": "What is ether (ETH)?",
418418
"what-is-ethereum": "What is Ethereum?",
419419
"withdrawals": "Staking withdrawals",
420+
"wrapped-ether": "Wrapped Ether",
420421
"yes": "Yes",
421422
"zero-knowledge-proofs": "Zero-knowledge proofs"
422423
}

src/intl/en/page-eth.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"page-eth-underpins": "ETH underpins the Ethereum financial system",
5656
"page-eth-underpins-desc": "Not satisfied with payments, the Ethereum community is building a whole financial system that's <a href=\"/glossary/#peer-to-peer-network\">peer-to-peer</a> and accessible to everyone.",
5757
"page-eth-underpins-desc-2": "You can use ETH as collateral to generate entirely different cryptocurrency tokens on Ethereum. Plus you can borrow, lend and earn interest on ETH and other ETH-backed tokens.",
58+
"page-eth-weth": "Wrapped ether (WETH) is used to extend the functionality of ETH to work with other tokens and applications. <a href=\"/wrapped-eth\">Learn more about WETH</a>.",
5859
"page-eth-uses": "Uses for ETH grow every day",
5960
"page-eth-uses-desc": "Because Ethereum is programmable, developers can shape ETH in countless ways.",
6061
"page-eth-uses-desc-2": "Back in 2015, all you could do was send ETH from one Ethereum account to another. Here are just some of things you can do today.",

src/intl/en/page-get-eth.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"page-get-eth-dexs-desc": "Decentralized exchanges are open marketplaces for ETH and other tokens. They connect buyers and sellers directly.",
2626
"page-get-eth-dexs-desc-2": "Instead of using a trusted third party to safeguard funds in the transaction, they use code. The seller's ETH will only be transferred when payment is guaranteed. This type of code is known as a smart contract.",
2727
"page-get-eth-dexs-desc-3": "This means there are fewer geographical restrictions than with centralized alternatives. If someone is selling what you want and accepting a payment method you can provide, you’re good to go.",
28+
"page-get-eth-dexs-desc-4": "Note: many dexes use wrapped ether (WETH) to function. <a href=\"/wrapped-eth\">Learn more about wrapped ether</a>.",
2829
"page-get-eth-do-not-copy": "Example: Do not copy",
2930
"page-get-eth-exchanges-disclaimer": "We collected this information manually. If you spot something wrong, let us know at",
3031
"page-get-eth-exchanges-empty-state-text": "Enter your country of residence to see a list of exchanges you may be able to use",

src/layouts/Static.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import DevconGrantsBanner from "@/components/DevconGrantsBanner"
1111
import EnergyConsumptionChart from "@/components/EnergyConsumptionChart"
1212
import FeedbackCard from "@/components/FeedbackCard"
1313
import GlossaryDefinition from "@/components/Glossary/GlossaryDefinition"
14+
import GlossaryTooltip from "@/components/Glossary/GlossaryTooltip"
1415
import { HubHero } from "@/components/Hero"
1516
import NetworkUpgradeSummary from "@/components/History/NetworkUpgradeSummary"
1617
import Link from "@/components/Link"
@@ -65,6 +66,7 @@ export const staticComponents = {
6566
Contributors,
6667
EnergyConsumptionChart,
6768
GlossaryDefinition,
69+
GlossaryTooltip,
6870
Icon,
6971
Link,
7072
Logo,

src/lib/utils/gh.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ const getGitLogFromPath = (path: string): string => {
1313

1414
const extractDateFromGitLogInfo = (logInfo: string): string => {
1515
// Filter commit date in log and return date using ISOString format (same that GH API uses)
16-
const lastCommitDate = logInfo
16+
try {
17+
const lastCommitDate = logInfo
1718
.split("\n")
1819
.filter((x) => x.startsWith("Date: "))[0]
1920
.slice("Date:".length)
2021
.trim()
2122
return new Date(lastCommitDate).toISOString()
23+
} catch {
24+
return new Date().toISOString()
25+
}
2226
}
2327

2428
// This util filters the git log to get the file last commit info, and then the commit date (last update)

src/lib/utils/md.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ const getPostSlugs = (dir: string, files: string[] = []) => {
266266
"/terms-of-use",
267267
"/web3",
268268
"/whitepaper",
269+
"/wrapped-eth",
269270
"/zero-knowledge-proofs",
270271
]
271272

src/pages/eth.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,9 @@ const EthPage = () => {
468468
description={t("page-eth-whats-defi-description")}
469469
image={defi}
470470
/>
471+
<InfoBanner isWarning>
472+
<Translation id="page-eth:page-eth-weth" />
473+
</InfoBanner>
471474
</Box>
472475
<TextDivider />
473476
<Box>

0 commit comments

Comments
 (0)