Skill — Copyable reference implementation. Use as-is or customize. See Skills Philosophy.
L2 Skills
Arbitrum
Build on Arbitrum One and Arbitrum Nova
Build on Arbitrum with native bridging and Stylus support.
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Build on Arbitrum One and Arbitrum Nova
import { Arbitrum } from './Arbitrum.js';
const arb = Arbitrum({
l1Provider,
l2Provider,
l1Gateway: L1_GATEWAY_ROUTER,
l2Gateway: L2_GATEWAY_ROUTER,
});
// Deposit ETH to L2
await arb.depositEth({
amount: parseEther('1'),
signer: l1Signer,
});
// Deposit ERC20
await arb.depositToken({
l1Token: USDC_L1,
amount: parseUnits('1000', 6),
signer: l1Signer,
});
// Withdraw to L1 (7 day delay)
await arb.withdrawEth({
amount: parseEther('1'),
signer: l2Signer,
});
// Create L1->L2 message
const ticket = await arb.createRetryableTicket({
to: l2Contract,
l2CallValue: 0n,
data: encodedCall,
maxSubmissionCost,
gasLimit: 1000000n,
maxFeePerGas,
signer: l1Signer,
});
// Redeem failed ticket
await arb.redeemRetryable({
ticketId,
signer: l2Signer,
});
// Get L1 block number
const l1Block = await arb.arbSys.arbBlockNumber();
// Get L2 to L1 tx count
const count = await arb.arbSys.sendTxToL1Count();
Was this page helpful?
