You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add bridge-usdc-relay.mdx with full Relay integration guide (quote, execute, status)
- Create 'Bridging' sidebar section nesting Stargate and Relay guides
- Rename USDC references to 'Bridged USDC' / 'USDC.e' on Tempo side (Circle C&D)
- Replace em dashes with hyphens across both guides
Amp-Thread-ID: https://ampcode.com/threads/T-019d4fbd-7519-75b6-960e-3c3326e6a3da
Co-authored-by: Amp <amp@ampcode.com>
description: Bridge USDC to and from Tempo using Stargate and LayerZero. Includes source chain addresses, cast commands, and TypeScript examples with viem.
2
+
title: Bridge via LayerZero
3
+
description: Bridge tokens to and from Tempo using LayerZero. Covers Stargate pools and standard OFT adapters with cast commands and TypeScript examples.
4
4
---
5
5
6
-
import { Tabs, Tab } from'vocs'
6
+
# Bridge via LayerZero
7
7
8
-
# Bridge USDC via Stargate
8
+
[LayerZero](https://layerzero.network) is the omnichain messaging protocol that powers token bridging on Tempo. Tokens are bridged using the [OFT (Omnichain Fungible Token)](https://docs.layerzero.network/v2/developers/evm/oft/quickstart) standard - the source chain locks or burns tokens and the destination chain mints the bridged equivalent.
9
9
10
-
[Stargate](https://stargate.finance/) uses [LayerZero](https://layerzero.network) to enable 1:1 USDC bridging between Tempo and other chains. Stargate locks USDC on the source chain and mints **USDC.e** (Bridged USDC) on Tempo, typically in under a minute.
10
+
There are two flavors of OFT on Tempo:
11
11
12
-
## Contracts on Tempo
12
+
-**Stargate** - an application built on LayerZero that manages liquidity pools. Tokens like USDC.e and EURC.e use Stargate's `sendToken()` interface.
13
+
-**Standard OFT** - token issuers (e.g. Tether for USDT0) deploy their own OFT adapters using LayerZero's `send()` interface directly.
14
+
15
+
Both use the same underlying LayerZero endpoint on Tempo.
1. Go to [stargate.finance](https://stargate.finance/)
41
-
2. Select your source chain (e.g. Ethereum) and USDC
69
+
2. Select your source chain and token (USDC or EURC)
42
70
3. Set **Tempo** as the destination chain
43
71
4. Enter the amount, approve, and send
44
72
45
-
### Using cast (Foundry)
73
+
####Using cast (Foundry)
46
74
47
-
Bridge USDC from Base to Tempo using `cast`. This calls `sendToken` on the Stargate pool on the source chain. This example uses [taxi mode](#bus-vs-taxi-mode) for immediate delivery.
75
+
This example bridges USDC from Base to Tempo. Replace addresses for other tokens or source chains.
48
76
49
-
#### Step 1 — Get a quote fee estimate from Stargate router
50
-
51
-
Use the same parameters you will pass to `sendToken`. Returns `(nativeFee, lzTokenFee)`.
To bridge USDC.e from Tempo back to another chain, call `sendToken` on the **StargateOFTUSDC** contract on Tempo. The process is the same — quote, approve, send — but the source contract and destination EID are swapped.
257
+
### Bridge from Tempo via Stargate
243
258
244
-
### Using cast (Foundry)
259
+
To bridge from Tempo back to another chain, call `sendToken` on the Stargate OFT contract on Tempo. The process is the same - quote, approve, send - but the source contract and destination EID are swapped.
245
260
246
-
Bridge USDC.e from Tempo to Base using `cast`. This calls `sendToken` on the **StargateOFTUSDC** contract on Tempo. This example uses [taxi mode](#bus-vs-taxi-mode) for immediate delivery.
261
+
#### Using cast (Foundry)
247
262
248
-
#### Step 1 — Quote the fee
263
+
This example bridges USDC.e from Tempo to Base.
249
264
250
-
Use the same parameters you will pass to `sendToken`. Returns `(nativeFee, lzTokenFee)`.
251
-
Take the first returned number as `<NATIVE_FEE>` (in stablecoin units, not ETH).
Tempo has no native gas token, so there is no `msg.value`. Standard LayerZero endpoints require `msg.value` to pay messaging fees, which doesn't work on Tempo.
361
-
362
-
**LZEndpointDollar** ([`0x0cEb237E109eE22374a567c6b09F373C73FA4cBb`](https://explore.tempo.xyz/address/0x0cEb237E109eE22374a567c6b09F373C73FA4cBb)) is an adapter contract that routes LayerZero messaging fees through a TIP-20 stablecoin instead of `msg.value`. It wraps the standard `EndpointV2` so that Stargate's OFT contracts can function on Tempo without modification.
363
-
364
-
This is transparent for end users:
365
-
366
-
-**Bridging to Tempo** — fees are paid in native gas on the source chain (ETH, MATIC, AVAX, etc.) as normal.
367
-
-**Bridging from Tempo** — `LZEndpointDollar` automatically deducts the messaging fee from a TIP-20 stablecoin. No `msg.value` is needed.
368
-
-**Developers** don't need to interact with `LZEndpointDollar` directly. The StargateOFTUSDC contract handles it internally.
369
-
370
-
## Bus vs. Taxi mode
368
+
### Bus vs. Taxi mode
371
369
372
370
Stargate offers two delivery modes:
373
371
374
372
| Mode |`oftCmd`| Delivery | Cost |
375
373
|------|----------|----------|------|
376
-
|**Taxi**|`0x` (empty) | Immediate — message sent right away | Higher gas cost |
377
-
|**Bus**|`0x00` (1 byte) | Batched — waits for other passengers | Lower gas cost |
374
+
|**Taxi**|`0x` (empty) | Immediate - message sent right away | Higher gas cost |
375
+
|**Bus**|`0x00` (1 byte) | Batched - waits for other passengers | Lower gas cost |
378
376
379
-
All examples above use taxi mode for immediate delivery. To use bus mode, set `oftCmd` to `0x00`:
377
+
All examples above use taxi mode. To use bus mode, set `oftCmd` to `0x00`:
380
378
381
379
```bash
382
-
# cast — bus mode
380
+
# cast - bus mode
383
381
oftCmd=0x00
384
382
```
385
383
386
384
```typescript
387
-
// viem — bus mode
385
+
// viem - bus mode
388
386
const sendParam = {
389
387
// ...
390
388
oftCmd: '0x00'asconst, // bus mode
@@ -395,9 +393,60 @@ const sendParam = {
395
393
Bus mode is not available on all routes. If a bus route is not configured for your source/destination pair, the transaction will revert. Use taxi mode (`0x`) for guaranteed delivery.
396
394
:::
397
395
396
+
## Standard OFT tokens
397
+
398
+
Tokens like USDT0, frxUSD, cUSD, and others are bridged using the standard LayerZero OFT `send()` interface. Each token issuer deploys their own OFT adapter contract. The `send()` interface uses the same `SendParam` struct as Stargate but calls `send()` instead of `sendToken()`.
399
+
400
+
To bridge a standard OFT token, you need the OFT adapter contract address on the source chain. Refer to the token issuer's documentation for their deployment addresses:
Tempo has no native gas token, so there is no `msg.value`. Standard LayerZero endpoints require `msg.value` to pay messaging fees, which doesn't work on Tempo.
438
+
439
+
**LZEndpointDollar** ([`0x0cEb237E109eE22374a567c6b09F373C73FA4cBb`](https://explore.tempo.xyz/address/0x0cEb237E109eE22374a567c6b09F373C73FA4cBb)) is an adapter contract that routes LayerZero messaging fees through a TIP-20 stablecoin instead of `msg.value`. It wraps the standard `EndpointV2` so that OFT contracts can function on Tempo without modification.
440
+
441
+
This is transparent for end users:
442
+
443
+
-**Bridging to Tempo** - fees are paid in native gas on the source chain (ETH, MATIC, AVAX, etc.) as normal.
444
+
-**Bridging from Tempo** - `LZEndpointDollar` automatically deducts the messaging fee from a TIP-20 stablecoin. No `msg.value` is needed.
445
+
-**Developers** don't need to interact with `LZEndpointDollar` directly. The OFT contracts on Tempo handle it internally.
0 commit comments