Skip to main content
Skill — Copyable reference implementation. Use as-is or customize. See Skills Philosophy.

Source & Tests

Contract Pattern

A typed contract abstraction you copy into your codebase. Built on Voltaire primitives, customizable for your needs.
This is a Skill, not a library export. Copy the code below into your project and modify as needed. See Skills Philosophy for why Voltaire uses copyable implementations instead of rigid library abstractions.

Why Copy Instead of Import?

This implementation follows ethers.js patterns (contract.read.method(), contract.write.method()). LLMs have extensive training data on ethers and will write better code with familiar APIs.

Quick Start

Implementation

Copy these files into your project:

API Reference

Contract Factory

ContractInstance

Customization Ideas

Add Caching

Add Retry Logic

Add Custom Methods