Skip to main content

useContract

Callable

  • useContract(address: string, ABI: ContractInterface, options?: { staticProvider?: { chainId: string; enable: boolean } }): { contract: null | Contract; error: null | Error }

  • Returns an ethers contract instance which can be used with other hooks as well as directly calling functions on the contract.


    Parameters

    • address: string
    • ABI: ContractInterface
    • optionaloptions: { staticProvider?: { chainId: string; enable: boolean } }

    Returns { contract: null | Contract; error: null | Error }

    • contract: null | Contract
    • error: null | Error