Skip to main content
This guide catalogs common errors encountered when developing and deploying LayerZero contracts on Starknet, with explanations and solutions.

Account Errors

Account Not Deployed

Error:
Cause: You’re trying to use an account that hasn’t been deployed yet. On Starknet, accounts are smart contracts that must be deployed before use. Solution:

Insufficient Balance for Fee

Error:
Cause: Your account contract doesn’t have enough STRK or ETH to pay transaction fees. Solution:
  1. Fund your account with STRK or ETH
  2. For testnet, use the Starknet Faucet
  3. For mainnet, bridge funds via Starkgate

Account Prefunding Required

Error:
Cause: Before deploying an account contract, the computed address must be funded. Starknet computes the address deterministically, so you can fund it before deployment. Solution:

Declare Errors

Class Already Declared

Error:
Cause: You’re trying to declare a contract class that already exists on the network. Solution:

Compilation Failed

Error:
Cause: Cairo compilation errors in your contract. Solution:

Deploy Errors

Wrong Owner (UDC Footgun)

Error: After deployment, the owner is set to an unexpected address (the UDC address). Cause: When deploying via the Universal Deployer Contract (UDC), get_caller_address() in the constructor returns the UDC address, not your account. Wrong pattern:
Solution:

Invalid Constructor Calldata

Error:
or
Cause: Constructor calldata doesn’t match the expected parameters. Solution:
  1. Verify parameter order matches constructor signature
  2. Check ByteArray encoding (length, data, pending_word, pending_len)
  3. Verify felt252 encoding for addresses and numbers

Resource Bounds Exceeded

Error:
or
Cause: The transaction requires more resources than your specified limits. Solution:
1 STRK = 10^18 fri

Configuration Errors

Peer Not Set

Error:
Cause: Attempting to send a message to a chain without a configured peer. Solution:
Remember: Peers must be set bidirectionally on both chains.

Invalid Peer

Error:
Cause: Received a message from an address that doesn’t match the configured peer. Causes:
  1. Peer set incorrectly on either chain
  2. Using Object ID instead of contract address
  3. Peer not set at all on sending chain
Solution:

Library Not Set

Error:
Cause: No send or receive library configured for the pathway. Solution: Use default libraries or set custom ones:

Serialization Errors

Felt Overflow

Error:
Cause: Attempting to store a value larger than ~2^251 in a felt252. Solution:

ByteArray Encoding Error

Error:
Cause: Incorrect ByteArray encoding in calldata. ByteArray structure:
Solution: For short strings (< 31 bytes), use simplified encoding with --arguments:
When using --arguments, sncast handles ByteArray encoding automatically. You can pass strings directly in quotes.

Execution Errors

Unauthorized

Error:
or
Cause: Calling an owner-only function from a non-owner account. Solution:

Contract Not Pausable

Error:
Cause: Calling a function on a paused contract. Solution:

Rate Limit Exceeded

Error:
Cause: Transfer volume exceeds configured rate limits (OFTMintBurnAdapter). Solution:

Crosschain Errors

Insufficient Fee

Error:
Cause: Not enough tokens approved or sent for LayerZero messaging fees. Solution:

Slippage Exceeded

Error:
Cause: After dust removal and fees, the received amount is less than min_amount_ld. Solution:

Message Execution Failed

Error (on LayerZero Scan):
Cause: The destination contract’s _lz_receive reverted. Debug Steps:
  1. Check LayerZero Scan for the transaction details
  2. Look for the LzReceiveAlert event
  3. Decode the reason array for error details
  4. Simulate the transaction locally
Common causes:
  • Insufficient gas (increase enforced options)
  • Contract paused on destination
  • Rate limit exceeded
  • Application logic error

Build Errors

Missing Dependencies

Error:
Cause: Dependencies not properly configured in Scarb.toml. Solution:
Install the LayerZero Starknet package first: npm install @layerzerolabs/protocol-starknet-v2

Version Mismatch

Error:
Cause: Scarb/Cairo version doesn’t match project requirements. Solution:

Debugging Tips

1. Use LayerZero Scan

Track your crosschain transactions at LayerZero Scan.

2. Check Transaction Status

3. Simulate Locally

Test your logic with snforge test before deploying.

4. Increase Verbosity

5. Check Events

Query contract events via block explorer or RPC:

Next Steps