useScaffoldReadContract
Use this hook to read public variables and get data from read-only functions of your smart contract.
Use this hook to read public variables and get data from read-only functions of your smart contract.
typescript
This example retrieves the data returned by the userGreetingCounter
function of the YourContract
smart contract.
Configuration
You can also pass other arguments accepted by useReadContract wagmi hook.
Return Values
- The retrieved data is stored in the
data
property of the returned object. - You can refetch the data by calling the
refetch
function. - The extended object includes properties inherited from wagmi useReadContract. You can check the useReadContract return values documentation to check the types.