Foundry
Deploy smart contracts to Neura with Foundry using your existing EVM workflow. This guide covers installing Foundry, initializing a project, configuring Neura Testnet (RPC + chain ID), compiling, and deploying from a keystore (recommended). If you already use Foundry, just point your RPC to Neura and update the chain ID.
Tooling Requirements
Before you begin, make sure the following dependencies are installed:
Rust (required for Foundry setup):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shFoundryup (official installer for the Foundry toolchain):
curl -L https://foundry.paradigm.xyz | bashAfter installing foundryup, run the following:
foundryupThis will install the full toolchain:
forge– build & test toolcast– CLI for Ethereum RPC callsanvil– local Ethereum nodechisel– code generation utility
Project Initialization
Create a new Foundry project using the default template:
This will generate a basic contract workspace with default folders:
src/– Solidity contractstest/– test fileslib/– dependencies
Configuration for Neura
Foundry uses a foundry.toml file for configuration. You can optionally define the Neura RPC and chain ID directly in this file:
Alternatively, you can store sensitive values like eth-rpc-url in a .env file:
Then access them via:
Example Smart Contract
A minimal example is included in your Foundry project as src/Counter.sol:
Compile Smart Contract
Use the following command to compile your contract:
Compiled output will appear in the out/ directory, including the ABI and bytecode.
Wallet Setup and Deployment
Keystore-Based Deployment (Recommended)
Generate and securely store a new wallet in a keystore:
This will do the following:
Create a new private key.
Encrypt and save it as a keystore file.
Prompt you to set a password.
Retrieve the address of the keystore:
Deploy the Contract
Deploy the Counter contract to the Neura testnet:
Make sure you have testnet $ANKR (see faucet section below).
Sample Output
Neura Testnet Faucet
You can request testnet ANKR using the Neura faucet:
Paste your wallet address, solve the captcha, and claim your test tokens.
Last updated