Core Workflow RivETH v1.7.4

Writing & Compiling

RivETH follows a strict naming convention so the browser UI can automatically locate and load your contract's ABI and bytecode from the local workspace.

1. Writing Your Contract

Save your Solidity source files inside the contracts/ directory. Sample contracts are included there for testing and learning.

Filename & Contract Name Must Match
Your file name should match the primary contract name inside it. For example, MyContract.sol should define contract MyContract { ... }.
Sample Contracts
The pre-written Solidity contracts in contracts/ are for testing and learning only. They are unaudited and must not be used in production.

2. Compiling Contracts

In a separate terminal window inside your project directory (while your Hardhat node keeps running), compile your contract without including the .sol extension:

Terminal — Compile Contract
# Method 1: Using the compile script (omit .sol)
./compile MyContract

# Method 2: Using the Makefile shortcut (omit .sol)
make MyContract
  • Shell Script

    Run ./compile [FILE_NAME] (omit the .sol extension) to invoke solc and generate artifacts.

  • Make Shortcut

    Alternatively run make [FILE_NAME] (omit .sol) for the exact same compilation pipeline.

  • Automatic Artifacts

    The compiler writes .abi and .bin files into artifacts/. Do not manually edit or write files in this directory.

3. Verifying Artifacts

After compiling, open the artifacts/ folder to confirm .abi and .bin files matching your contract name were generated. RivETH reads these files directly when you load a contract in the UI.