Get Started
Set up a Foundry project for RISE development
Foundry is a blazing fast, portable, and modular toolkit for Ethereum application development written in Rust.
Prerequisites
- A wallet with testnet ETH from the RISE Faucet
Install Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryupThis installs forge, cast, anvil, and chisel.
Create a Project
Initialize Project
Create a new Foundry project:
forge init my-rise-project
cd my-rise-projectThis creates a project with:
src/- Your smart contractstest/- Your testsscript/- Deployment scriptsfoundry.toml- Configuration file
Configure for RISE
Update your foundry.toml to add the RISE network:
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
solc = "0.8.30"
[rpc_endpoints]
rise = "https://testnet.riselabs.xyz"Set Environment Variables
Create a .env file for your private key:
PRIVATE_KEY=your_private_key_hereLoad it in your shell:
source .envNever commit your .env file to version control.
Review the Default Contract
Foundry creates a default Counter.sol contract:
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
contract Counter {
uint256 public number;
function setNumber(uint256 newNumber) public {
number = newNumber;
}
function increment() public {
number++;
}
}