Skip to content

OffchainLabs/arbitrum-docs / .agents/skills/arbitrum-best-practices

arbitrum-best-practices

Verified

Arbitrum L2 development best practices. Use when implementing bridges, Orbit chains, SDK integrations, or debugging cross-chain transactions. Triggers on Arbitrum, L2, rollup, bridge, retryable, Orbit, Nitro, or cross-chain contexts.

rules/bridge-l1-l2-messaging.md

View on GitHub
---
title: Use SDK for L1-to-L2 Messages
impact: CRITICAL
impactDescription: prevents stuck funds
tags: bridge, l1-l2, messaging, sdk
---

## Use SDK for L1-to-L2 Messages

L1-to-L2 messaging uses retryable tickets—L2 transactions created from L1. The SDK handles gas estimation, parameter ordering, and status tracking that are error-prone when done manually.

**Incorrect (manual Inbox interaction):**

```typescript
// Bad: Direct Inbox calls are error-prone with 8+ parameters
const inbox = new Contract(inboxAddress, inboxAbi, l1Signer)
await inbox.createRetryableTicket(to, l2CallValue, maxSubmissionCost, refundAddress, refundAddress, gasLimit, maxFeePerGas, data)
```

**Correct (SDK L1ToL2MessageCreator):**

```typescript
// Good: SDK handles gas estimation and provides type safety
const creator = new L1ToL2MessageCreator(l1Signer)
const ticket = await creator.createRetryableTicket({
  to: l2ContractAddress,
  l2CallValue: parseEther('0.1'),
  data: calldata,
  callValueRefundAddress: sender,
  excessFeeRefundAddress: sender,
}, l2Provider)
```

The SDK automatically estimates `maxSubmissionCost` and `gasLimit` with appropriate buffers. Manual Inbox calls require calculating these yourself and risk under-funding.

For detailed implementation, see [L1 to L2 Messaging](https://docs.arbitrum.io/how-arbitrum-works/arbos/l1-l2-messaging).
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall