Docs
πŸ§™ Deploy a contract
⚠️

Make sure you are using a test / throwaway wallet, to be safe. Don't ever reveal the private key of your main wallet!

This guide will help you deploy a smart contract to Taiko (Askja testnet) using Foundry.

Prerequisites

Steps

Create a project with Foundry

forge init hello_foundry && cd hello_foundry

Deploy the contract

Deploy the contract located at src/Counter.sol. Replace YOUR_PRIVATE_KEY below with your private key which has some testnet ETH on Taiko.

Note: The --legacy flag is needed because EIP-1559 is currently disabled on Taikoβ€”it will be re-enabled in the future.

forge create --legacy --rpc-url https://rpc.a2.taiko.xyz --private-key YOUR_PRIVATE_KEY src/Counter.sol:Counter

View your contract

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