@tevm/contract is Tevm's shared, type-safe contract kernel. It defines the contract surface used by both the
Tevm core node and Tevm's bundler packages, so contract descriptions and
generated actions have one stable representation across the ecosystem.
This repository is the standalone home of the package formerly maintained at packages/contract in the Tevm
monorepo. Its Git history was preserved during the extraction.
pnpm add @tevm/contractThe package does not require a Tevm node at runtime. Consumers that execute the actions produced here should install the appropriate Tevm client separately.
import { createContract } from '@tevm/contract'
const greeter = createContract({
name: 'Greeter',
humanReadableAbi: ['function greet() view returns (string)'],
address: '0x0000000000000000000000000000000000000001',
})
const action = greeter.read.greet()createContract accepts either a human-readable ABI or a JSON ABI. The returned value exposes typed read, write,
event, deployment, withAddress, and withCode action creators.
This repository uses Node.js 24 and pnpm 9.
pnpm install
pnpm lint
pnpm typecheck
pnpm build
pnpm testPackage releases are managed with Changesets. Add a changeset with pnpm changeset; merging the generated version PR
publishes to npm with provenance.
The documentation site lives in site/ and is built with vocs 2.x. It deploys to
contract.tevm.sh. The umbrella Tevm documentation remains at tevm.sh.
pnpm docs:dev # local dev server
pnpm docs:build # production build -> site/dist/public
pnpm docs:preview # serve the production buildpnpm docs is separate: it runs TypeDoc to regenerate the markdown API reference in docs/ from source
JSDoc.