useScaffoldContract
Use this hook to get your contract instance by providing the contract name. It enables you to interact with your contract methods.
Use this hook to get your contract instance by providing the contract name. It enables you to interact with your contract methods. For reading data or sending transactions, it’s recommended to use useScaffoldReadContract
and useScaffoldWriteContract
.
This example uses the useScaffoldContract
hook to obtain a contract instance for the YourContract
smart contract.
Configuration
Return Value
-
data
: Object representing viem’s contract instance. Which can be used to callread
andwrite
of the contract. -
isLoading
: Boolean indicating if the contract is being loaded.