Docs
Alpha-1 Testnet Guide
🚀 Deploy a contract

Deploy a contract

These steps will show you how to deploy a smart contract to Taiko A1 using Foundry. Read the Foundry Book (opens in a new tab) for the latest docs on Foundry.

Prerequisites

Steps

  1. Install Foundry (opens in a new tab) (if you haven't already).
  2. Create a project with Foundry, and cd into it:
    forge init hello_foundry && cd hello_foundry
  3. Deploy the contract from your project, located at src/Counter.sol. Replace YOUR_PRIVATE_KEY with your private key, mentioned in the previous prerequisites section.
    forge create --legacy --rpc-url https://l2rpc.a1.taiko.xyz --private-key YOUR_PRIVATE_KEY src/Counter.sol:Counter

    Note: The --legacy flag is needed because EIP-1559 is currently disabled on Taiko—there are plans to re-enable it in the future.

  4. Paste the address from the output into the L2 block explorer (opens in a new tab) to verify that the contract was deployed.