RISE Logo-Light

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

Install Foundry

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

This installs forge, cast, anvil, and chisel.

Create a Project

Initialize Project

Create a new Foundry project:

forge init my-rise-project
cd my-rise-project

This creates a project with:

  • src/ - Your smart contracts
  • test/ - Your tests
  • script/ - Deployment scripts
  • foundry.toml - Configuration file

Configure for RISE

Update your foundry.toml to add the RISE network:

foundry.toml
[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:

.env
PRIVATE_KEY=your_private_key_here

Load it in your shell:

source .env

Never commit your .env file to version control.

Review the Default Contract

Foundry creates a default Counter.sol contract:

src/Counter.sol
// 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++;
    }
}

Build the Project

Compile your contracts:

forge build

This generates artifacts in the out/ directory.

Next Steps