Skip to main content

Overview

Arbitrum-focused template for L2 development. Includes L1-to-L2 and L2-to-L1 bridge messaging contracts, a bidirectional token gateway, and a gas-efficient ERC-20 token. Pre-configured to fork Arbitrum mainnet with Blockscout explorer.

Quick Start

Generated Files

my-arb
dokrypt.yaml
foundry.toml
README.md
contracts
token
ArbitrumToken.sol
bridge
L1ToL2MessageSender.sol
L2ToL1MessageSender.sol
gateway
TokenGateway.sol
test
ArbitrumToken.t.sol
L1ToL2Message.t.sol
TokenGateway.t.sol
scripts
deploy.js
bridge-tokens.js

Contracts

ArbitrumToken.sol

Gas-efficient ERC-20 optimized for Arbitrum. Includes batch transfers and gateway-authorized minting/burning for bridge operations.

Bridge Module

L1ToL2MessageSender.sol

Sends messages from L1 to L2 via Arbitrum’s Delayed Inbox pattern. Creates retryable tickets with configurable gas parameters.

L2ToL1MessageSender.sol

Sends messages from L2 to L1 via the ArbSys precompile (0x0000000000000000000000000000000000000064). Includes target allowlisting and nonce tracking.

TokenGateway.sol

Bidirectional token bridging using lock-and-mint (L1 to L2) and burn-and-release (L2 to L1) pattern.

Deployment

Deploy All Contracts

Deploys ArbitrumToken, L1ToL2MessageSender, L2ToL1MessageSender, and TokenGateway. Configures gateway linking and token mappings.

Bridge Token Flow

Demonstrates a full L1-to-L2 deposit and L2-to-L1 withdrawal cycle.

Testing Workflows

Bridge Testing

Token Gateway Testing

Fork Testing