Skip to content

docs: document TempoOFTWrapper as recommended bridge-out flow#412

Open
letstokenize wants to merge 5 commits into
mainfrom
add-tempo-oft-wrapper
Open

docs: document TempoOFTWrapper as recommended bridge-out flow#412
letstokenize wants to merge 5 commits into
mainfrom
add-tempo-oft-wrapper

Conversation

@letstokenize
Copy link
Copy Markdown
Contributor

Summary

Adds documentation for TempoOFTWrapper (0xbb95daF376cd63F258d7c37a4eFe57c10055E8E0), which collapses the bridge-out flow from 5 transactions + quote → 2 transactions + quote by bundling wrap, approve, and send atomically.

Why

LayerZero's "Support OFTs and OApps on Tempo" doc treats this wrapper as the default integration path, and Boltz Exchange uses it in production (see directSend.ts). Tempo docs currently only document the manual 5-tx flow, so anyone following Tempo's docs writes more code than they need to and pays more gas than required.

It also introduces a few related facts that LZ docs include but Tempo docs omit:

  • The fee token whitelist is not just USDC.e — it's USDC.e, USDT0, or pathUSD.
  • sendOFT reverts atomically if the re-quoted fee at execution exceeds maxNativeFee (slippage protection on the fee, not just the bridged amount).
  • Compose-with-refund-to-sender breaks under the wrapper because the wrapper becomes msg.sender — funds get refunded to the wrapper and are lost. Documented as a warning, with the manual flow kept as the supported alternative for that case.

Changes

  • Bridge from Tempo intro — Reframed to mention both flows up front and list the three accepted fee tokens.
  • New section: ### Recommended: TempoOFTWrapper with:
    • Contract address table
    • cast (Foundry) walkthrough: quote → approve → sendOFT
    • TypeScript (viem) walkthrough with full sendOFT ABI
    • Warnings: compose-refund pitfall, max-fee semantics
    • Preflight tip using eth_call
  • Existing 5-tx flow moved under ### Manual flow as the fallback for compose-with-refund cases.

Verification

The sendOFT ABI used here is verified against Boltz Exchange's TypeScript integration:

function sendOFT(
  address oft,
  address feeToken,
  (uint32 dstEid, bytes32 to, uint256 amountLD, uint256 minAmountLD,
   bytes extraOptions, bytes composeMsg, bytes oftCmd) sendParam,
  uint256 maxNativeFee
) returns (
  (bytes32 guid, uint64 nonce, (uint256 nativeFee, uint256 lzTokenFee) fee),
  (uint256 amountSentLD, uint256 amountReceivedLD)
)

Selector: 0xef9c7618. Contract has bytecode (~10KB) at 0xbb95daF376cd63F258d7c37a4eFe57c10055E8E0 on Tempo mainnet (verified via cast code).

Related

LayerZero's docs document a TempoOFTWrapper contract
(0xbb95daF376cd63F258d7c37a4eFe57c10055E8E0) that bundles wrap, approve,
and send into a single transaction, reducing bridge-out from Tempo from
5 txs + quote to 2 txs + quote. The wrapper is in production use
(LZ docs, Boltz Exchange integration) but is currently undocumented in
Tempo's docs, so users follow the manual flow unnecessarily.

Changes:
- Update 'Bridge from Tempo' intro to reference both flows and list the
  three accepted fee tokens (USDC.e, USDT0, pathUSD) per LZ docs
- Add 'Recommended: TempoOFTWrapper' section with cast and viem examples
  using the verified sendOFT ABI
- Document maxNativeFee semantics (reverts on re-quote overshoot)
- Add warning about wrapper-as-msg.sender breaking compose-with-refund
- Add tip about eth_call preflight to avoid dust
- Move the existing 5-tx flow under 'Manual flow' as fallback for cases
  the wrapper can't handle

References:
- https://docs.layerzero.network/v2/developers/tempo/how-to/support-ofts-and-oapps
- ABI verified against BoltzExchange/boltz-web-app integration

Co-Authored-By: Uddhav <255779543+letstokenize@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tempo-docs Ready Ready Preview, Comment May 14, 2026 7:33pm

Request Review

@letstokenize letstokenize self-assigned this May 14, 2026
The contracts table at the top of the page is the first place readers
look for canonical addresses. Adding TempoOFTWrapper there (alongside
EndpointV2 and LZEndpointDollar) ensures it is discoverable before
readers scroll into the per-flow walkthroughs and avoids them defaulting
to the manual 5-tx flow out of unawareness.

Also:
- Add a 'Purpose' column to the contracts table so each entry's role is
  clear at a glance, with anchor links to the relevant section.
- Add a one-liner listing the accepted fee tokens (USDC.e, USDT0,
  pathUSD) under the contracts table, since this is a top-level fact
  every outbound integrator needs.

Co-Authored-By: Uddhav <255779543+letstokenize@users.noreply.github.com>
For all standard bridging the TempoOFTWrapper is functionally
equivalent to the 5-tx manual flow. The manual flow is only required
for compose messages with refund-to-sender semantics, where the wrapper
becoming msg.sender breaks the refund.

Carrying the full 5-tx cast walkthrough plus the matching viem example
in Tempo docs encouraged readers to copy the worse path. Replace it
with a short pointer to LZ's direct-flow reference plus a one-line
breakdown of the call sequence so the structure is still discoverable.

Net change: ~190 lines removed from bridge-layerzero.mdx; the wrapper
flow remains the only fully documented bridge-out path on Tempo docs.

Co-Authored-By: Uddhav <255779543+letstokenize@users.noreply.github.com>
The previous draft of this section was top-heavy with framing. Trim it
to just what an integrator needs to copy and run:

- Drop the 'Recommended:' subheading and the parallel-flow framing.
  TempoOFTWrapper is the only flow worth documenting in Tempo's docs;
  the manual escape hatch is one warning callout pointing to LZ docs.
- One-line intro: address, what it does, accepted fee tokens.
- Cast walkthrough: 3 short steps (quote, approve, send) with the
  delivery-tracking URL folded into the send step.
- viem example: ~50 lines down from ~140. Use parseAbi for the wrapper
  signature instead of expanding the full nested ABI by hand.
- Drop the eth_call dust-preflight tip (advanced UX detail, not needed
  for the canonical example).

Co-Authored-By: Uddhav <255779543+letstokenize@users.noreply.github.com>
- Restore the 'Verify transaction status' step in the cast walkthrough.
  Folding it into the Send step's prose hid the LZ scan URL behind a
  paragraph; integrators expect a numbered step they can copy.
- Put --rpc-url and --private-key on separate lines in the approve and
  send blocks. Matches the formatting used everywhere else on the page
  (Bridge to Tempo + manual flow examples).

Co-Authored-By: Uddhav <255779543+letstokenize@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant