I want to query public variable names on-chain #2495
Unanswered
Olanetsoft
asked this question in
Q&A
Replies: 1 comment
-
|
You can simply put the public variable name into the functionName:
Also, you can pass index, key or whatever the map/array variable uses as index to retrieve item in it:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
wagmiuses:const { data: useContractReadData } = useContractRead({
address: AVALANCHE_CONTRACT_ADDRESS,
abi: SendMessageContract.abi,
functionName: "getValue",
watch: true,
});
To read function, but I want to read a public variable in the contract, how can I achieve that?
Beta Was this translation helpful? Give feedback.
All reactions