• Hook for getting an instance of an Vote contract. This contract enables fully featured voting-based decentralized governance systems.

    Parameters

    • contractAddress: RequiredParam<string>

      the address of the Vote contract, found in your thirdweb dashboard

    Returns Vote | undefined

    Example

    import { useContract } from '@thirdweb-dev/react'

    export default function Component() {
    const { contract } = useContract("<YOUR-CONTRACT-ADDRESS>", "vote")

    // Now you can use the vote contract in the rest of the component

    // For example, this function will get all the proposals on this contract
    async function getProposals() {
    const proposals = await contract.getAll()
    return proposals
    }

    ...
    }

    Deprecated

    This hook is deprecated and will be removed in a future major version. You should use useContract instead.

    - const vote = useVote("0x1234...");
    + const vote = useContract("0x1234...", "vote").contract;

Generated using TypeDoc