β οΈ
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
- Foundry (opens in a new tab) is installed.
- You have the private key handy to an account that has testnet ETH on Taiko (to pay the transaction fee for deploying the contract).
- Have some testnet ETH on Taiko:
- First, request Sepolia ETH from the faucet.
- Then, use the bridge to send the testnet ETH to Taiko.
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.