Try it Live
Run Hardfork examples in the interactive playground
Operator-Style API
gte mimics the >= operator for clearer code:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Check if hardfork is greater than or equal to target (alias for isAtLeast)
gte mimics the >= operator for clearer code:
import { CANCUN, LONDON } from 'tevm'
// Operator-style (reads like >= operator)
if (CANCUN.gte(LONDON)) {
// ...
}
// Equivalent semantic form
if (CANCUN.isAtLeast(LONDON)) {
// ...
}
import { Hardfork, LONDON } from 'tevm'
const fork = Hardfork(config.hardfork)
if (fork.gte(LONDON)) {
// EIP-1559 available
}
import { Hardfork, SHANGHAI } from 'tevm'
function validateVersion(fork: BrandedHardfork) {
if (!fork.gte(SHANGHAI)) {
throw new Error("Requires Shanghai or later")
}
}
FRONTIER (0) < HOMESTEAD (1) < ... < CANCUN (16) < PRAGUE (17)
Was this page helpful?
