Documentation Index
Fetch the complete documentation index at: https://docs.layerzero.network/llms.txt
Use this file to discover all available pages before exploring further.
Why Alt variants on Tempo
Tempo has no native gas token. Sendingmsg.value > 0 reverts, which means the standard fee payment path (fees via msg.value to the endpoint) does not work.
Tempo uses EndpointV2Alt instead of the standard EndpointV2. EndpointV2Alt replaces native token fee payment with ERC-20 token transfers using LZEndpointDollar (LZD). OFTAlt and OAppAlt are the contract variants designed to work with this ERC-20 fee path.
Building an OApp?
OAppAlt changes only the fee payment path: _payNative transfers LZD to the endpoint instead of using msg.value. The receive side is identical to OAppReceiver. Everything else (messaging, peer configuration, security) works the same way. Import from @layerzerolabs/oapp-alt-evm/contracts/oapp/OAppAlt.sol.How standard OFT fee payment works
On a typical EVM chain, OFT pays LayerZero messaging fees by attaching native value:_payNative function reads msg.value and forwards native tokens to the message library. The endpoint refunds excess native value to the sender.
EndpointV2Alt and the ERC-20 fee path
On Tempo,EndpointV2Alt overrides _payNative to delegate to _payToken, which:
- Rejects native value: reverts with
LZ_OnlyAltTokenifmsg.value > 0 - Reads ERC-20 balance:
_suppliedNative()returnsIERC20(nativeErc20).balanceOf(address(this))instead ofmsg.value - Exposes the fee token:
nativeToken()returns the LZD address instead ofaddress(0)
send(), the caller must approve and transfer LZD to the endpoint.
Comparison table
| Aspect | OFT | OFTAlt | OFTAdapter | OFTAdapterAlt |
|---|---|---|---|---|
| Fee payment | msg.value (native) | ERC-20 transferFrom (LZD) | msg.value (native) | ERC-20 transferFrom (LZD) |
| Endpoint | EndpointV2 | EndpointV2Alt | EndpointV2 | EndpointV2Alt |
| msg.value | required for fees | must be 0 | required for fees | must be 0 |
| Native drop | supported | not supported | supported | not supported |
| Token model | new omnichain token | new omnichain token | wraps existing token | wraps existing token |
| Import path | @layerzerolabs/oft-evm/contracts/OFT.sol | @layerzerolabs/oft-alt-evm/contracts/OFTAlt.sol | @layerzerolabs/oft-evm/contracts/OFTAdapter.sol | @layerzerolabs/oft-alt-evm/contracts/OFTAdapterAlt.sol |
Contract interface
OFTAlt extends the standard OFT interface but targets EndpointV2Alt:OFTAdapterAlt. This uses lock/unlock: it locks tokens in the adapter on send and unlocks on receive.
Fee payment differences
Standard OFT (other chains)
OFTAlt (Tempo)
Interoperability
OFTAlt on Tempo communicates with standard OFT deployments on other chains without issue. The LayerZero protocol handles translation between fee models:- Sending from Tempo: the sender pays fees in LZD via OFTAlt. The destination chain receives the message as usual.
- Receiving on Tempo: the sender on the source chain pays fees in the source chain’s native token using standard OFT. The Tempo-side OFTAlt receives the message without requiring LZD from the receiver.
Choosing the right contract
| Scenario | Tempo contract | Other chains |
|---|---|---|
| New ERC-20, minted on Tempo | OFTAlt | OFT |
| Existing ERC-20 on Tempo, lock/unlock bridging | OFTAdapterAlt | OFT or OFTAdapter |
| Existing TIP-20 on Tempo, mint/burn bridging | OFTBurnSelfMintAlt | OFT or OFTAdapter |
OFTBurnSelfMint variant for chains using EndpointV2Alt. It bridges TIP-20 tokens using a transfer-then-burn pattern: on send, it transfers tokens to itself first, then burns from the adapter address. This is required because TIP-20 tokens only support burn(amount) (burning from msg.sender), not burn(from, amount). On receive, it mints tokens directly to the recipient. The contract must hold ISSUER_ROLE on the TIP-20 token.
On other chains, keep using standard OFT or OFTAdapter. No changes needed. The Tempo-side adapter connects to EndpointV2Alt while the other chains continue using EndpointV2. LayerZero routes messages between them without extra configuration.