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 | sh
  • Foundryup (official installer for the Foundry toolchain):

curl -L https://foundry.paradigm.xyz | bash

After installing foundryup, run the following:

foundryup

This will install the full toolchain:

  • forge – build & test tool

  • cast – CLI for Ethereum RPC calls

  • anvil – local Ethereum node

  • chisel – 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 contracts

  • test/ – test files

  • lib/ – 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

  1. 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.

  1. 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