Automated Workflows (.riveth)
Added in v1.7.0, RivETH supports declarative automated scripting using .riveth files. Instead of clicking through the same deployment, minting, and approval
steps manually after every recompile, you can encode repeatable test sequences in a single workflow
file.
.riveth workflows currently execute against local Hardhat development accounts
and are not yet configured for injected browser wallets (MetaMask / Frame).1. Workflow File Anatomy
Each .riveth file starts with the RivETH => workflow<= header
followed by one or more Run blocks delimited by <=:
-
RivETH => workflow<=
Header declaration required at the top of every
.rivethscript file. -
Run <StepName> => ... <=
Defines a named execution step. Use
Run deploywithfunction: _to pass constructor parameters. -
function: & params:
Specifies the contract function name (or
_for deployment) and comma-separated arguments. -
caller: & value:
Optionally override the
msg.senderHardhat account address and ETH value attached to the step. Leave blank to use defaults.
2. Example: ERC20.riveth
Sample workflows are included inside the tests/ directory of the RivETH
repository (including ERC20.riveth, Raffle.riveth, WrappedETH.riveth, and AppStore.riveth):
RivETH => workflow<=
Run deploy =>
function: _
params: "My Token", "MTK"
<=
Run Mint =>
function: mintTokens
params: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266, 200
caller:
value:
<=
Run ApproveSpender =>
function: approve
params: 0x70997970C51812dc3A010C7d01b50e0d17dc79C8, 100
caller: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
value:
<=
Run CheckBalance =>
function: balanceOf
params: 0x70997970C51812dc3A010C7d01b50e0d17dc79C8
caller:
value:
<=3. Multi-Caller Testing
By setting caller: to different pre-funded Hardhat addresses across steps, a
single workflow can simulate multi-user token approvals, transfers, and permission checks in
seconds—and every transaction still appears in RivETHScan and your Hardhat terminal
logs.