Contract Component
The Contract is a UI component for debugging deployed contracts.
Import
import { Contract } from "@scaffold-ui/debug-contracts";Props
| Prop | Type | Default | Description |
|---|---|---|---|
contractName | string | - | The name of the contract to display |
contract | { address: Address, abi: Abi } | - | The abi and address of the contract to display |
chainId | number | - | The chain ID where the contract is deployed |
blockExplorerAddressLink | string | undefined | The block explorer link for the contract address |
Live Example:
Code
import React from "react";
import { Contract } from "@scaffold-ui/debug-contracts";
import { deployedContracts } from "./components/ContractExample/deployedContracts";
import { sepolia } from "viem/chains";
<Contract
contractName="YourCollectible"
contract={deployedContracts[sepolia.id]["YourCollectible"]}
chainId={sepolia.id}
/>;Example
name
owner
symbol
totalSupply
Read
balanceOf
owneraddress
getApproved
tokenIduint256
Multiply by 1e18 (wei)
isApprovedForAll
owneraddress
operatoraddress
ownerOf
tokenIduint256
Multiply by 1e18 (wei)
supportsInterface
interfaceIdbytes4
tokenByIndex
indexuint256
Multiply by 1e18 (wei)
tokenOfOwnerByIndex
owneraddress
indexuint256
Multiply by 1e18 (wei)
tokenURI
tokenIduint256
Multiply by 1e18 (wei)
Write
approve
toaddress
tokenIduint256
Multiply by 1e18 (wei)
Wallet not connected or in the wrong network
mintItem
toaddress
uristring
Wallet not connected or in the wrong network
renounceOwnership
Wallet not connected or in the wrong network
safeTransferFrom
fromaddress
toaddress
tokenIduint256
Multiply by 1e18 (wei)
Wallet not connected or in the wrong network
safeTransferFrom
fromaddress
toaddress
tokenIduint256
Multiply by 1e18 (wei)
databytes
Wallet not connected or in the wrong network
setApprovalForAll
operatoraddress
approvedbool
Wallet not connected or in the wrong network
transferFrom
fromaddress
toaddress
tokenIduint256
Multiply by 1e18 (wei)
Wallet not connected or in the wrong network
transferOwnership
newOwneraddress
Wallet not connected or in the wrong network