Skip to main content

What is LZD

LZEndpointDollar (LZD) is the canonical USD-denominated fee token for LayerZero on Tempo. Because Tempo has no native gas token, EndpointV2Alt uses LZD as the ERC-20 token for all LayerZero messaging fees. The endpoint could accept a single TIP-20 token directly, but that would force users to hold one specific stablecoin. LZD is an ERC-20 wrapper around multiple whitelisted 6-decimal stablecoins (pathUSD, USDC.e, or USDT0), so users can pay fees with whichever USD stablecoin they have. Users wrap a supported stablecoin into LZD, then approve the endpoint or OFT to spend it.

Endpoint mode detection

On any EVM chain, you can check the endpoint type by calling nativeToken(). On Tempo, it returns the LZD address:

Fee payment flow

Paying LayerZero fees on Tempo requires wrapping a whitelisted stablecoin into LZD before sending:
  1. Quote: call quoteSend(sendParam, _payInLzToken) to receive both nativeFee and lzTokenFee. LayerZero lets you choose the fee token via _payInLzToken. At the time of writing, _payInLzToken is not enabled on Tempo, so set it to false and use nativeFee (LZD).
  2. Approve stablecoin: approve the LZD contract to spend your stablecoin.
  3. Wrap: call LZD.wrap(feeToken, recipient, amount) to convert your stablecoin into LZD.
  4. Approve LZD: approve the OFT contract to spend your LZD.
  5. Send: call send() with msg.value = 0 and MessagingFee(nativeFee, 0).
At the time of writing, _payInLzToken is not enabled on Tempo, so set it to false.

API reference

wrap

Wraps a whitelisted stablecoin into LZD. Transfers the underlying token from msg.sender and mints LZD to _to.

Parameters

unwrap

Unwraps LZD back into a whitelisted stablecoin. Burns LZD from msg.sender and transfers the underlying token to _to.

Parameters

whitelistToken

Adds a token to the whitelist. This is an owner-only admin function, so new fee tokens can only be added by the LZD contract owner. The token must have exactly 6 decimals and must not already be whitelisted.

Parameters

unwhitelistToken

Removes a token from the whitelist.

Parameters

isWhitelistedToken

Returns whether a token is whitelisted.

Parameters

getWhitelistedTokens

Returns all whitelisted token addresses.

getTokenBalance

Returns the contract’s balance of a specific underlying token.

Parameters

decimals

Returns 6. LZD uses 6 decimals to match its underlying whitelisted stablecoins.

Events

TokenWrapped

Emitted when a whitelisted token is wrapped into LZD.

TokenUnwrapped

Emitted when LZD is unwrapped back into a whitelisted token.

TokenWhitelisted

Emitted when a token is added to or removed from the whitelist.

Errors

Quoting fees

quoteSend() returns a MessagingFee with both nativeFee and lzTokenFee. LayerZero lets applications choose the payment token via _payInLzToken. At the time of writing, _payInLzToken is not enabled on Tempo, so set it to false and read the fee from nativeFee (LZD):

msg.value behavior

Tempo’s EndpointV2Alt rejects any transaction that sends native value:
  • msg.value > 0 reverts with LZ_OnlyAltToken
  • There is no native drop. addExecutorNativeDropOption is not supported
Always set msg.value = 0 when calling send() on Tempo. Do not attach any native value to LayerZero transactions.

Failure modes

Contract addresses