Documentation Index Fetch the complete documentation index at: https://voltaire.tevm.sh/llms.txt
Use this file to discover all available pages before exploring further.
Try it Live Run Hardfork examples in the interactive playground
Usage Patterns
Version Detection
Check for newer versions:
import { Hardfork , CANCUN } from 'tevm'
const fork = Hardfork ( config . hardfork )
if ( fork . isAfter ( CANCUN )) {
console . log ( "Running post-Cancun hardfork with unknown features" )
console . log ( "Consider upgrading documentation" )
}
Feature Availability
Check for features beyond a certain version:
import { Hardfork , SHANGHAI } from 'tevm'
function hasNewFeatures ( fork : BrandedHardfork ) : boolean {
// Check if this is a newer hardfork with additional features
return fork . isAfter ( SHANGHAI )
}
Network Configuration
Validate forward compatibility:
import { Hardfork , PRAGUE } from 'tevm'
function validateTestnetConfig ( fork : BrandedHardfork ) {
if ( fork . isAfter ( PRAGUE )) {
console . warn (
`Hardfork ${ Hardfork . toString ( fork ) } is newer than Prague. ` +
`Some features may not be fully tested.`
)
}
}
Chronological Ordering
Uses chronological deployment order:
LONDON (11) < MERGE (14) < SHANGHAI (15) < CANCUN (16) < PRAGUE (17)
Strict Inequality
Important: isAfter returns false when versions are equal:
import { CANCUN } from 'tevm'
CANCUN . isAfter ( CANCUN ) // false - not strictly after itself
For “greater than or equal”, use isAtLeast or gte :
import { CANCUN , LONDON } from 'tevm'
// Greater than or equal
CANCUN . isAtLeast ( CANCUN ) // true
CANCUN . gte ( CANCUN ) // true
// Strictly greater than
CANCUN . isAfter ( CANCUN ) // false
CANCUN . isAfter ( LONDON ) // true
Time Complexity: O(1) - Array index comparison
Typical Time: ~10-20ns per call
See Also
isAtLeast - Check if greater than or equal
isBefore - Check if strictly less than
gt - Alias for isAfter (greater than)
gte - Greater than or equal