Docs

Contract

A "contract" is a wrapper around a smart contract that is deployed on a chain. It is what you use to create transactions and read contract state.

import { getContract } from "thirdweb";
import { ethereum } from "thirdweb/chains";
// get a contract
const contract = getContract({
// the client you have created via `createThirdwebClient()`
client,
// the chain the contract is deployed on
chain: ethereum,
// the contract's address
address: "0x123...",
// OPTIONAL: the contract's abi
abi: [...],
});

Contracts defined this way are lightweight and can be exported as consts accross your application to read or write to it.