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.
MyContract.sol should define contract MyContract { ... }.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:
# 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.solextension) to invokesolcand generate artifacts. -
Make Shortcut
Alternatively run
make [FILE_NAME](omit.sol) for the exact same compilation pipeline. -
Automatic Artifacts
The compiler writes
.abiand.binfiles intoartifacts/. 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.