This page covers the smart contract implementation details. See Glossary.
Prerequisites
- Foundry installed and available on
PATH - A Vehicle contract implementing
IVehicle - Working knowledge of the STEAM standard
Create the base test contract
Place the test file attest/vehicles/<your_vehicle>/<YourVehicle>Vehicle.t.sol and inherit from STEAMSingleAssetTester to activate the conformance suite.
Configure the test environment
The base tester exposes internal hooks for optional components. Each defaults toaddress(0); override the ones your Vehicle depends on.
Add vehicle-specific tests
STEAMSingleAssetTester covers the generic state machine. Extend it with tests that exercise your adapter’s protocol-specific logic — constructor guards, custom data field parsing, protocol edge cases.
Test composition pattern
Exercise the Vehicle under each supported configuration by creating variant test files that extend the base contract and override the component hooks.1
Baseline (no optional components)
MyVehicle.t.sol — the base file defined above. All hooks resolve to address(0).2
With FeeManager
Create
MyVehicle.WithFeeManager.t.sol:3
With ModulesManager
Create
MyVehicle.WithModulesManager.t.sol and override _get_modules_manager().4
With AccessControl
Create
MyVehicle.WithAccessControl.t.sol and override _get_access_control().Key helper methods
STEAMSingleAssetTester exposes the following internal helpers for use in custom test cases:
Inherited test categories
Inheriting fromSTEAMSingleAssetTester activates coverage across the following areas:
- State machine — valid and invalid transitions across every STEAM state
- Input validation — zero amounts, unsupported assets, invalid receivers
- Access control — enforcement of caller permissions on lifecycle methods
- Fee handling — correct accrual and settlement of deposit and redeem fees
- Module execution — interaction with protocol modules through
ModulesManager