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

Bridge UI update #745

Merged
merged 4 commits into from
Sep 19, 2024
Merged
Changes from all commits
Commits
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
46 changes: 23 additions & 23 deletions docs/developers/guides/bridge/how-to-bridge-erc20-tokens.mdx
Original file line number Diff line number Diff line change
@@ -7,13 +7,14 @@ image: /img/socialCards/bridge-erc-20-tokens-between-ethereum-and-linea.jpg

:::note

We recommend that only tech operators that are providing liquidity use Linea's native bridge to transfer
ERC-20 tokens.
We recommend that only tech operators that are providing liquidity use Linea's native bridge to
transfer ERC-20 tokens.

For everyday bridge transfers, we recommend you use the
[MetaMask Portfolio bridge](https://portfolio.metamask.io/bridge), which aggregates bridging options
across Linea and shows you the best rates. Alternatively, use one of the
[third-party bridges](https://bridge.linea.build/) available to users.

:::

ERC-20 tokens can only be bridged using manual claiming, which
@@ -27,23 +28,23 @@ transferred token amount, this could be a
the value is displayed. The chance of encountering this is quite low, but still good to know about.
:::

The guide on [how to bridge ETH](./how-to-bridge-eth.md) shows how to use our bridge
The guide on [how to bridge ETH](./how-to-bridge-eth.mdx) shows how to use our bridge
and appropriately fund your wallet.

1. Go to the Linea [token bridge](https://bridge.linea.build/).
1. Go to the [Linea bridge](https://bridge.linea.build/).

2. Connect your wallet in the top-right corner of the page.

<div class="center-container">
<div class="img-medium">
<div class="img-large">
<img
src="/img/article_images/Use_Linea/Bridge_your_tokens/How_to_bridge_ERC20_tokens_between_Ethereum_and_Linea/Linea_Bridge_connect_wallet_button.png"
src="/img/article_images/Use_Linea/Bridge_your_tokens/How_to_bridge_ETH_between_Ethereum_and_Linea/Linea_Bridge_connect_wallet_button.png"
alt="Linea bridge connect wallet button"
/>
</div>
</div>

3. On the [token bridge](https://bridge.linea.build/), go to the token selection menu by clicking on the current token symbol (ETH in this case).
3. Enter the token selection menu by clicking on the current token symbol (ETH in this case).

<div class="center-container">
<div class="img-medium">
@@ -54,7 +55,9 @@ and appropriately fund your wallet.
</div>
</div>

4. Select one of the available tokens in the list. If the token is not in the list, paste the address of the token you want to add into the search bar.
4. Select one of the available tokens in the list. If the token is not in the list, use the search
bar to find it by contract address, symbol, or its full name. Click on your preferred token to
select it.

<div class="center-container">
<div class="img-medium">
@@ -65,9 +68,7 @@ and appropriately fund your wallet.
</div>
</div>

5. Click on the token to select it.

6. You now can bridge this token, and it will be saved in your token list for future bridging.
5. You now can bridge this token, and it will be saved in your token list for future bridging.

<div class="center-container">
<div class="img-medium">
@@ -80,17 +81,16 @@ and appropriately fund your wallet.

## Token bridge decimal mismatch

When a user bridges an ERC-20 token from one chain to the other (e.g. Mainnet to Linea) and the token
has not been deployed on the destination chain, the Token Bridge Smart Contract will attempt to
determine the “decimals” of the ERC-20 token. If the "decimals" cannot be determined by reading the
origin ERC-20 token contract (e.g. a token contract does not adhere to the
[ERC-20 standard](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/)), it will default
to 18 decimals.
When an ERC-20 token is bridged from one chain to the other and the token has not been deployed on
the destination chain, the Token Bridge Smart Contract will attempt to determine the “decimals” of
the ERC-20 token. If the decimals cannot be determined by reading the origin ERC-20 token contract
(e.g. a token contract does not adhere to the [ERC-20 standard](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/)),
it will default to 18 decimals.

It's important to note that encountering this situation is uncommon, as most tokens with specified
decimals usually adhere to the ERC-20 standards.
This can result in the token quantities displaying incorrectly on the destination chain. For example,
if a token has 16 decimals on L1 but doesn't specify the decimals in token contract, it will
default to 18 decimals on Linea. Bridging 1 token from L1 will show up as 0.01 on L2. When you
bridge back the 0.01 to L1, it'll become 1 token again.

Here's a simple example to help you understand what this means: if a token has 16 decimals on L1 but
doesn't specify the decimals in token contract, then it defaults to 18 decimals on Linea due to
missing information. Bridging 1 token from L1 will show up as 0.01 on L2. When you bridge back the
0.01 to L1, it'll become 1 token again.
Decimal mismatches are rare, since most tokens with specified decimals usually adhere to the ERC-20
standards.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/users/move-funds/bridge.mdx
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ You can select the option most appropriate to you:
the simplest option for most users.
- **Third-party bridges for users** - Use alternative third-party bridges.
- **Linea Native Bridge** - Best suited for tech operators, dapp teams, and liquidity
providers. For more guidance on the native bridge, see [here](../../developers/guides/bridge/how-to-bridge-eth.md).
providers. For more guidance on the native bridge, see [here](../../developers/guides/bridge/how-to-bridge-eth.mdx).

:::info
The Linea Native Bridge is a slower option that should not be used for time-sensitive transfers.
2 changes: 1 addition & 1 deletion docs/users/move-funds/fund.mdx
Original file line number Diff line number Diff line change
@@ -75,4 +75,4 @@ Linea Sepolia address:
- [GetBlock](https://getblock.io/faucet/linea-sepolia/)
- [HackQuest](https://www.hackquest.io/en/faucets/59141) (and check out their [Linea Learning Track](https://www.hackquest.io/en/learning-track/9be129e7-575b-49bd-a64e-1bbe32427ace))

Alternatively, [use the Linea Native Bridge to bridge tokens between Sepolia and Linea Sepolia](../../developers/guides/bridge/how-to-bridge-eth.md).
Alternatively, [use the Linea Native Bridge to bridge tokens between Sepolia and Linea Sepolia](../../developers/guides/bridge/how-to-bridge-eth.mdx).
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.