Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Learn page on Wrapped Ether (WETH) #8203

Merged
merged 55 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
d14eb8f
Add Learn page on Wrapped Ether (WETH)
emmanuel-awosika Oct 7, 2022
e0bcc0b
Update wrapped-ether.md
emmanuel-awosika Oct 12, 2022
80af2a0
Update wrapped-ether.md
emmanuel-awosika Nov 7, 2022
4329da8
Apply suggestions from code review
emmanuel-awosika Dec 21, 2022
8bbc8db
Update wrapped-ether.md
emmanuel-awosika Dec 21, 2022
f3aa7a2
Update src/content/wrapped-ether.md
emmanuel-awosika Dec 21, 2022
06c641e
Added info about formal verification of WETH
emmanuel-awosika Dec 21, 2022
be4824a
Update wrapped-ether.md
emmanuel-awosika Dec 31, 2022
36dd02f
Update WETH page based on feedback
emmanuel-awosika Feb 17, 2023
d80a252
Update wrapped-ether.md
emmanuel-awosika Feb 20, 2023
c231284
Update wrapped-ether.md
emmanuel-awosika Feb 21, 2023
8db2c41
Update wrapped-ether.md
emmanuel-awosika Feb 21, 2023
d989438
Apply suggestions from code review
emmanuel-awosika Feb 22, 2023
752eec6
Update wrapped-ether.md
emmanuel-awosika Feb 22, 2023
603dcae
Update wrapped-ether.md
emmanuel-awosika Feb 22, 2023
b330f22
Update wrapped-ether.md
emmanuel-awosika Feb 22, 2023
8d47382
Merge branch 'dev' into pr/emmanuel-awosika/8203
corwintines Aug 15, 2023
8bce1fd
Merge branch 'dev' into pr/emmanuel-awosika/8203
corwintines Jan 26, 2024
f965106
Merge branch 'dev' into pr/emmanuel-awosika/8203
corwintines Mar 11, 2024
4e2acf6
setup wrapped-ether page in new repo structure
corwintines Mar 11, 2024
222732c
rework weth intro
corwintines Mar 13, 2024
3cb77f8
edits
corwintines Mar 18, 2024
dd6324d
Update public/content/wrapped-ether/index.md
wackerow Mar 18, 2024
7e6c477
Update public/content/wrapped-ether/index.md
corwintines Mar 21, 2024
d7aa8ff
Update public/content/wrapped-ether/index.md
corwintines Mar 21, 2024
20568d6
Update public/content/wrapped-ether/index.md
corwintines Mar 21, 2024
8a8ced9
Update public/content/wrapped-ether/index.md
corwintines Mar 21, 2024
fc62e46
Update public/content/wrapped-ether/index.md
corwintines Mar 21, 2024
240f085
Update public/content/wrapped-ether/index.md
corwintines Mar 21, 2024
00096ae
Update public/content/wrapped-ether/index.md
corwintines Mar 21, 2024
07220fa
Update public/content/wrapped-ether/index.md
corwintines Mar 21, 2024
2e4ab92
Update public/content/wrapped-ether/index.md
corwintines Mar 21, 2024
9cbc2cd
Update public/content/wrapped-ether/index.md
corwintines Mar 21, 2024
59a6cb8
Update public/content/wrapped-ether/index.md
corwintines Mar 21, 2024
5f4348b
Glossary use
corwintines Mar 21, 2024
8810d72
copy fixes
corwintines Mar 21, 2024
76eb2b1
wrapped-ether -> wrapped-eth
corwintines Mar 21, 2024
0f874e4
change requests
corwintines Mar 21, 2024
f501195
Merge branch 'dev' into weth-edit
corwintines Mar 21, 2024
1ac0a02
reword
corwintines Mar 21, 2024
4c14665
fix broken element
corwintines Mar 21, 2024
764c469
change requests
corwintines Mar 21, 2024
2f8d017
change requests
corwintines Mar 21, 2024
6cc21c6
remove further reading articles
corwintines Mar 21, 2024
16a9fa5
Merge branch 'dev' into pr/8203
wackerow Mar 22, 2024
b222922
Merge branch 'dev' into weth-edit
wackerow Mar 22, 2024
f5038db
chore: rename to wrapped-eth
wackerow Mar 22, 2024
0668dfb
Merge branch 'weth-edit' into pr/8203
wackerow Mar 22, 2024
df16dc5
Merge branch 'dev' into pr/emmanuel-awosika/8203
corwintines Mar 25, 2024
3191a11
wording around conversion
corwintines Mar 25, 2024
a6246d1
Add other networks contracts FAQ
corwintines Mar 25, 2024
6747394
Add content to link out to /wrapped-eth page
corwintines Mar 26, 2024
8e65124
chore: defi capitalization, linting
wackerow Mar 26, 2024
2bcb9c6
fix: use Translation component for htmr strings
wackerow Mar 26, 2024
718399c
fix: markdown whitespace syntax
wackerow Mar 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions public/content/wrapped-ether/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
---
title: Wrapped Ether (WETH)
description: An introduction to Wrapped Ether (WETH)—an ERC20-compatible version of Ether (ETH).
lang: en
---

# What Is Wrapped Ether (WETH)? {#what-is-wrapped-ether-weth}
Wrapped Ether (WETH) is an ERC-20 token representing Ethereum’s native Ether (ETH) coin. As a native cryptocurrency, the use of ETH is limited to transferring value and paying for computation on the Ethereum network. Using ETH in dapps is technically difficult because of its limitations.

Transforming ETH into an ERC-20 token (WETH) increases the number of things you can do with it. Because there's significant demand to use ETH in the ecosystem, wrapped Ether (WETH) solves this problem by providing an ERC20-compliant version of ETH to use in dapps or swap with other ERC-20 tokens.

Today, **nearly 3% of the circulating ETH supply is locked in the WETH token contract** making it one of the most popular smart contracts. WETH is especially popular with users interacting with applications in Ethereum's Decentralized Finance (DeFi) ecosystem.

## What are wrapped tokens? {#intro-to-wrapped-tokens}

A wrapped token is a token whose value is pegged to an underlying asset. An amount of the original asset is deposited into a smart contract—similar to a digital bank vault—that mints an equal amount of wrapped tokens. The vault holds the deposit until you're ready to exchange your wrapped tokens for the original asset.

Wrapping ETH today requires depositing it in a smart contract which creates an amount of wrapped ETH (WETH) tokens equal to the original deposit. You can also “unwrap” ETH by sending WETH tokens to the contract and receiving ETH in return.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a comma after "smart contract" for clarity:

- Wrapping ETH today requires depositing it in a smart contract which creates an amount of wrapped ETH (WETH) tokens equal to the original deposit.
+ Wrapping ETH today requires depositing it in a smart contract, which creates an amount of wrapped ETH (WETH) tokens equal to the original deposit.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
Wrapping ETH today requires depositing it in a smart contract which creates an amount of wrapped ETH (WETH) tokens equal to the original deposit. You can also “unwrap” ETH by sending WETH tokens to the contract and receiving ETH in return.
Wrapping ETH today requires depositing it in a smart contract, which creates an amount of wrapped ETH (WETH) tokens equal to the original deposit. You can also “unwrap” ETH by sending WETH tokens to the contract and receiving ETH in return.


In all cases, the conversion between WETH and ETH is always completed at a 1:1 ratio. Since the smart contract locks up ETH before minting WETH tokens, the value of WETH tokens in circulation is backed by ETH held in reserves. This keeps the prices of WETH and ETH relatively equal and ensures you can always swap both assets without realizing a loss.

## Why do we need to wrap ETH? {#why-do-we-need-to-wrap-eth}

Common use cases for wrapping tokens include extending the functionality of a token and allowing the use of a token outside its native blockchain. With Wrapped Ether (WETH), the goal is to make ETH more useful by giving it the features of an ERC-20 token.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Common use cases for wrapping tokens include extending the functionality of a token and allowing the use of a token outside its native blockchain. With Wrapped Ether (WETH), the goal is to make ETH more useful by giving it the features of an ERC-20 token.

i dont think this paragraph needs to be there


For context, [ERC-20](https://www.gemini.com/en-US/cryptopedia/erc20-token-standard-ethereum) defines a standard interface for fungible tokens, so anyone can create tokens that interact seamlessly with applications and other tokens in Ethereum's ecosystem. But, as the creation of Ether predates the ERC-20 standard, ETH tokens don’t conform to this specification. This means you can't easily exchange ETH for other ERC-20 tokens or use ETH coins in dapps built according to the ERC-20 standard.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For context, [ERC-20](https://www.gemini.com/en-US/cryptopedia/erc20-token-standard-ethereum) defines a standard interface for fungible tokens, so anyone can create tokens that interact seamlessly with applications and other tokens in Ethereum's ecosystem. But, as the creation of Ether predates the ERC-20 standard, ETH tokens don’t conform to this specification. This means you can't easily exchange ETH for other ERC-20 tokens or use ETH coins in dapps built according to the ERC-20 standard.
[ERC-20](https://www.gemini.com/en-US/cryptopedia/erc20-token-standard-ethereum) defines a standard interface for fungible tokens, so anyone can create tokens that interact seamlessly with applications and other tokens in Ethereum's ecosystem. But, as the creation of Ether predates the ERC-20 standard, ETH tokens don’t conform to this specification. This means you can't easily exchange ETH for other ERC-20 tokens or use ETH coins in dapps built according to the ERC-20 standard.


Wrapped Ether (WETH) was created to **make ETH compatible with applications and tokens implementing ERC-20 interfaces**. WETH also extends the functionality of native ETH token and gives you the opportunity to do the following:

- **Exchange ETH for ERC-20 tokens**: You cannot exchange ETH directly for other ERC-20 tokens (not without introducing trusted third parties or complex technical processes). WETH is a representation of Ether that complies with the ERC-20 fungible token standard and can be exchanged 1:1 for other ERC-20 tokens.

- **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 in ERC-20 standards using WETH removes this obstacle and enables developers to handle ETH and other tokens within the same dapp.

- **Interact with DeFi applications**: DeFi enables complex use-cases like [yield farms](https://blockworks.co/what-is-yield-farming-what-you-need-to-know/) and [automated market makers](https://www.gemini.com/cryptopedia/amm-what-are-automated-market-makers) (AMMs), but these applications need access to funds in your wallet to work. With ERC-20 tokens like WETH, you can approve a smart contract to deduct WETH tokens from your balance up to a predefined limit (a feature that's unavailable when using native ETH).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To improve clarity and avoid wordiness, consider shortening the phrase:

- With ERC-20 tokens like WETH, you can approve a smart contract to deduct WETH tokens from your balance up to a predefined limit (a feature that's unavailable when using native ETH).
+ With ERC-20 tokens like WETH, you can approve a smart contract to deduct WETH tokens from your balance up to a predefined limit, an unavailable feature when using native ETH.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
- **Interact with DeFi applications**: DeFi enables complex use-cases like [yield farms](https://blockworks.co/what-is-yield-farming-what-you-need-to-know/) and [automated market makers](https://www.gemini.com/cryptopedia/amm-what-are-automated-market-makers) (AMMs), but these applications need access to funds in your wallet to work. With ERC-20 tokens like WETH, you can approve a smart contract to deduct WETH tokens from your balance up to a predefined limit (a feature that's unavailable when using native ETH).
- **Interact with DeFi applications**: DeFi enables complex use-cases like [yield farms](https://blockworks.co/what-is-yield-farming-what-you-need-to-know/) and [automated market makers](https://www.gemini.com/cryptopedia/amm-what-are-automated-market-makers) (AMMs), but these applications need access to funds in your wallet to work. With ERC-20 tokens like WETH, you can approve a smart contract to deduct WETH tokens from your balance up to a predefined limit, an unavailable feature when using native ETH.


## Wrapped Ether (WETH) vs Ether (ETH): What is the difference? {#weth-vs-eth-differences}
Although they look similar, Wrapped Ether (WETH) and Ether (ETH) have subtle differences you should be aware of. For example, the Ethereum protocol recognizes Ether—but it has no native knowledge of WETH (and ERC-20 tokens), causing both assets to behave differently. We have listed other important distinctions between ETH and WETH tokens below:

| | **Ether (ETH)** | **Wrapped Ether (WETH)** |
|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Supply | **The supply of ETH is managed by the protocol.** The supply of ETH increases when Ethereum validators earn rewards for 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. |
| Ownership | **Ownership of ETH is defined and guaranteed by the Ethereum blockchain.** For example, protocol rules ensure you can always spend from an account’s ETH balance if you control the [private key](/glossary/#private-key). | **Ownership of WETH depends on the WETH token contract.** The contract defines ownership of WETH tokens and determines the conditions under which you can access your WETH balance. |
| Transfer | The transfer of ETH is intrinsic to the Ethereum protocol. Transfers are recorded on-chain and publicly verifiable. | **The transfer of WETH tokens occurs inside the WETH token contract and [isn’t directly recorded on-chain](https://coinmarketcap.com/alexandria/glossary/internal-transaction).** The blockchain only records the transaction authorizing the smart contract to deduct from the sender’s WETH balance. |
| 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). | You cannot pay gas for a transaction using WETH tokens (except when using a third-party relayer service). |
### Security considerations for using WETH {#weth-security-considerations}

As Ethereum's native asset, the security of ETH is guaranteed by the protocol—no one can steal your funds unless they have access to your private keys. Even in a [51% attack](https://academy.binance.com/en/glossary/51-percent-attack), attackers cannot create forged transactions to transfer ETH from your address without approval.

In comparison, Wrapped Ether (WETH) is not issued and secured by the Ethereum network and using it may involve certain risks. Still, WETH is considered a safe asset to own and use (compared to similar wrapped tokens) due to its unique qualities:

- **Simplistic design**: The canonical WETH smart contract has less than 60 lines of code and lacks complexities that can produce unintended bugs or exploitable vulnerabilities.
- **Zero admin controls**: Your interaction with WETH is fully **trustless** as no one has administrative control of the WETH token contract. As such, you don't have to worry about a malicious admin arbitrarily minting or burning tokens, censoring attempts to withdraw your ETH, or blacklisting transfers.
- **Non-upgradeable**: The WETH contract is non-upgradeable (unlike many variants) and has remained the same since its launch many years ago.
- **Extensively audited and tested**: Members of the Ethereum community (including auditors, developers, and security researchers) have tested the security of the WETH contract before *and* after its launch. The WETH contract has also passed formal verification, which is considered the highest security standard for Ethereum-based applications.

Now, while the WETH contract is considered very secure, some hypothetical attack scenarios exist including:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a comma after "exist" for better readability:

- Now, while the WETH contract is considered very secure, some hypothetical attack scenarios exist including:
+ Now, while the WETH contract is considered very secure, some hypothetical attack scenarios exist, including:

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
Now, while the WETH contract is considered very secure, some hypothetical attack scenarios exist including:
Now, while the WETH contract is considered very secure, some hypothetical attack scenarios exist, including:


- **An attacker mints WETH tokens without depositing ETH (the equivalent of printing money out of thin air)**. If the attacker successfully redeems these tokens for ETH, other owners may be unable to withdraw their ETH deposits.

- **An attacker exploits a vulnerability that allows them to drain the WETH contract of ETH deposited by users**. This would leave users with valueless WETH tokens without any backing.

- **A smart contract bug prevents users from unwrapping WETH and withdrawing ETH deposits.** While the chances of this happening are low, it is still a feasible scenario that could affect the safety of WETH assets.

Note that these security considerations apply **only if you’re using WETH issued on Ethereum**. [Blockchain bridges](/bridges/) make ETH usable on a non-Ethereum blockchain by issuing a variant of WETH compatible that blockchain’s technical standards.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be a missing preposition in this sentence. Consider revising it for clarity:

- Blockchain bridges make ETH usable on a non-Ethereum blockchain by issuing a variant of WETH compatible that blockchain’s technical standards.
+ Blockchain bridges make ETH usable on a non-Ethereum blockchain by issuing a variant of WETH compatible with that blockchain’s technical standards.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
Note that these security considerations apply **only if you’re using WETH issued on Ethereum**. [Blockchain bridges](/bridges/) make ETH usable on a non-Ethereum blockchain by issuing a variant of WETH compatible that blockchain’s technical standards.
Note that these security considerations apply **only if you’re using WETH issued on Ethereum**. [Blockchain bridges](/bridges/) make ETH usable on a non-Ethereum blockchain by issuing a variant of WETH compatible with that blockchain’s technical standards.


But this introduces additional security issues other than those described previously. For example, you must also believe the bridge is secure against attacks, the bridge operator(s) won’t freeze or steal your funds, etc.

## Frequently Asked Questions about Wrapped Ether (WETH) {#weth-frequently-asked-questions}

**Are ETH and WETH the same?**

No. Ether (ETH) is the native coin of the Ethereum blockchain, used as a unit of payment on the Ethereum network (including paying for transaction fees). Wrapped Ether (WETH) is an ERC20-compliant version of ETH primarily designed to make ETH tokens compatible with applications built on the ERC-20 standard.

**How does Wrapped Ether (WETH) work?**

Users wrap ETH by sending it to a smart contract that mints an equivalent amount of Wrapped ETH (WETH) in return. Another way to get wrapped ETH is to swap ETH for WETH tokens on a decentralized exchange (DEX).
Unwrapping ETH requires a similar workflow: send WETH to the smart contract and have an equivalent amount of ETH sent to your address. You can also unwrap ETH by swapping WETH for ETH directly using a decentralized exchange.

**Do you pay to wrap/unwrap ETH?**

No. You don’t pay to wrap ETH into WETH, as the assets are converted at a 1:1 ratio. However, interacting with the WETH contract to wrap/unwrap ETH involves sending an on-chain transaction—and this requires paying a gas fee. DEX platforms also charge for gas when executing swaps between ETH and WETH (or vice-versa).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expression "vice versa" is spelled without hyphens. Consider correcting it for accuracy:

- DEX platforms also charge for gas when executing swaps between ETH and WETH (or vice-versa).
+ DEX platforms also charge for gas when executing swaps between ETH and WETH (or vice versa).

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
No. You don’t pay to wrap ETH into WETH, as the assets are converted at a 1:1 ratio. However, interacting with the WETH contract to wrap/unwrap ETH involves sending an on-chain transaction—and this requires paying a gas fee. DEX platforms also charge for gas when executing swaps between ETH and WETH (or vice-versa).
No. You don’t pay to wrap ETH into WETH, as the assets are converted at a 1:1 ratio. However, interacting with the WETH contract to wrap/unwrap ETH involves sending an on-chain transaction—and this requires paying a gas fee. DEX platforms also charge for gas when executing swaps between ETH and WETH (or vice versa).


**Can I pay for gas with WETH?**

No. Ethereum nodes only accept ETH as payment for gas fees. You can only pay for gas in WETH only if using a third-party relayer that accepts the (signed) transaction off-chain and broadcasts it on-chain on your behalf. Typically, [relayers](https://blog.kyros.ventures/2022/07/24/meta-transaction-relayer-an-overview/) pay the gas fee for a relayed transactions from their ETH balance and accept payment for the service in ERC-20 tokens like WETH.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct the pluralization error for better grammatical accuracy:

- Typically, relayers pay the gas fee for a relayed transactions from their ETH balance and accept payment for the service in ERC-20 tokens like WETH.
+ Typically, relayers pay the gas fee for relayed transactions from their ETH balance and accept payment for the service in ERC-20 tokens like WETH.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
No. Ethereum nodes only accept ETH as payment for gas fees. You can only pay for gas in WETH only if using a third-party relayer that accepts the (signed) transaction off-chain and broadcasts it on-chain on your behalf. Typically, [relayers](https://blog.kyros.ventures/2022/07/24/meta-transaction-relayer-an-overview/) pay the gas fee for a relayed transactions from their ETH balance and accept payment for the service in ERC-20 tokens like WETH.
No. Ethereum nodes only accept ETH as payment for gas fees. You can only pay for gas in WETH only if using a third-party relayer that accepts the (signed) transaction off-chain and broadcasts it on-chain on your behalf. Typically, relayers pay the gas fee for relayed transactions from their ETH balance and accept payment for the service in ERC-20 tokens like WETH.


**Are WETH and ETH the same price?**

WETH is pegged 1:1 to the price of ETH, so the value of both assets are usually equal at any time. This peg is maintained by ensuring that every unit of WETH is backed by ETH held in reserves. Forces of supply and demand also keep the prices of ETH and WETH relatively equal:

- If WETH were cheaper, more people would buy it and convert it to the more expensive ETH at a 1:1 ratio to make profit. This would drive up demand for WETH and increase the price of WETH tokens.

- If WETH is more expensive, more people would buy ETH and convert it to WETH to sell at a profit. As the supply of WETH increases, the value of WETH tokens would drop—keeping the peg relatively stable.

**Why do people use WETH instead of ETH?**

WETH was created because the ETH token doesn't follow with the ERC-20 technical specification, making it difficult to use in decentralized applications (dapps). Unlike Ether, WETH follows the ERC-20 standard and is compatible with applications, such as decentralized exchanges and wallets, that support ERC-20 interfaces. WETH is also tradeable for other ERC-20 tokens while directly exchanging ETH for ERC-20 tokens requires complex accounting.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a comma after "tokens" for better readability:

- WETH is also tradeable for other ERC-20 tokens while directly exchanging ETH for ERC-20 tokens requires complex accounting.
+ WETH is also tradeable for other ERC-20 tokens, while directly exchanging ETH for ERC-20 tokens requires complex accounting.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
WETH was created because the ETH token doesn't follow with the ERC-20 technical specification, making it difficult to use in decentralized applications (dapps). Unlike Ether, WETH follows the ERC-20 standard and is compatible with applications, such as decentralized exchanges and wallets, that support ERC-20 interfaces. WETH is also tradeable for other ERC-20 tokens while directly exchanging ETH for ERC-20 tokens requires complex accounting.
WETH was created because the ETH token doesn't follow with the ERC-20 technical specification, making it difficult to use in decentralized applications (dapps). Unlike Ether, WETH follows the ERC-20 standard and is compatible with applications, such as decentralized exchanges and wallets, that support ERC-20 interfaces. WETH is also tradeable for other ERC-20 tokens, while directly exchanging ETH for ERC-20 tokens requires complex accounting.


**Is WETH safe?**

ETH is the safest asset because it is part of the Ethereum protocol, whereas WETH is defined in a smart contract which could feasibly be hacked. Nevertheless, 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a minor typo in "beeen." Correct it to "been" for grammatical accuracy:

- The WETH contract has also beeen formally verified, which is the highest security standard for smart contracts on Ethereum.
+ The WETH contract has also been formally verified, which is the highest security standard for smart contracts on Ethereum.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
ETH is the safest asset because it is part of the Ethereum protocol, whereas WETH is defined in a smart contract which could feasibly be hacked. Nevertheless, 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.
ETH is the safest asset because it is part of the Ethereum protocol, whereas WETH is defined in a smart contract which could feasibly be hacked. Nevertheless, WETH is generally considered secure because it is based on a simple, battle-tested smart contract. The WETH contract has also been formally verified, which is the highest security standard for smart contracts on Ethereum.


**Why am I seeing different WETH tokens?**

Besides the [canonical implementation of WETH](https://blog.0xproject.com/canonical-weth-a9aa7d0279dd) described on this page, there are other variants in the wild. These may be custom tokens created by dapp 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.**

**How can I add WETH to my Metamask wallet?**

The easiest way to add WETH on Metamask is to use the "Import Tokens" feature: search for "wrapped ether" and select WETH as the token you want to import. You'll need to make sure your Metamask wallet is connected to Ethereum Mainnet before trying to add WETH to your wallet.

Alternatively, you can add WETH to Metamask by clicking the "Custom Token" button (after selecting "Import Tokens"). Copy the WETH contract address from [Etherscan](https://etherscan.io/token/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2) and paste into the "Token Contract Address" field. If the contract address is correct, WETH should appear as the Token Symbol, after which you'll need to confirm importing WETH before it appears in your wallet.

## Further reading {#further-reading}
- [WTF is WETH?](https://weth.io/)
- [What are the cheapest ways to wrap ETH into WETH?](https://medium.com/@therugpush/cheapest-way-to-wrap-eth-into-weth-446cf1ddccf7)
- [WETH token information on Etherscan](https://etherscan.io/token/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2)
- [How To add Wrapped Ether (WETH) to Metamask](https://isitcrypto.com/add-weth-to-metamask/)
- [Formal Verification of WETH](https://zellic.io/blog/formal-verification-weth)


6 changes: 5 additions & 1 deletion src/lib/utils/gh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ const getGitLogFromPath = (path: string): string => {

const extractDateFromGitLogInfo = (logInfo: string): string => {
// Filter commit date in log and return date using ISOString format (same that GH API uses)
const lastCommitDate = logInfo
try {
const lastCommitDate = logInfo
.split("\n")
.filter((x) => x.startsWith("Date: "))[0]
.slice("Date:".length)
.trim()
return new Date(lastCommitDate).toISOString()
} catch {
return new Date().toISOString()
}
}

// This util filters the git log to get the file last commit info, and then the commit date (last update)
Comment on lines 13 to 28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [11-11]

Detected a potential security risk where user-controlled input (path) is passed directly to a shell command within getGitLogFromPath. This could lead to command injection if the input is not properly sanitized.

Consider validating or sanitizing the path parameter to ensure it does not contain shell metacharacters or use safer alternatives to execute shell commands that do not involve string concatenation.

Expand Down
1 change: 1 addition & 0 deletions src/lib/utils/md.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ const getPostSlugs = (dir: string, files: string[] = []) => {
"/terms-of-use",
"/web3",
"/whitepaper",
"/wrapped-ether",
"/zero-knowledge-proofs",
]

Expand Down
Loading